Reputation: 559
I have a requirement to accept an URL on a text box and enable hyperlink on the control. Grid columns are allowing to enter a value and mark the column as hyperlink where it is not allowing to do on an editable text control. Is there a way to open the URL by clicking on the text control?
Upvotes: 0
Views: 553
Reputation: 392
Similarly, you could try a PXButton with optional ImageKey and navigate to your URL using Redirect4: (or Redirect0: if the URL is in same domain):
public PXAction<DAC> ViewOnWeb;
[PXUIField(DisplayName = "View On Web",
MapEnableRights = PXCacheRights.Select,
MapViewRights = PXCacheRights.Select)]
[PXButton(ImageKey = PX.Web.UI.Sprite.Main.World)]
protected virtual IEnumerable viewOnWeb;(PXAdapter adapter)
{
if (this.DAC.Current != null)
{
throw new PXException("Redirect4:" +
string.Format("http://my.site.com/search?Id={0}", DAC.code));
}
return adapter.Get();
}
Upvotes: 0
Reputation: 559
I have examined the Web entry control in Business account aspx source code and used PXLinkEdit Control for accepting the URL and allow to open the page. Even though it is not hyperlinking the text, it allows opening the URL through an action button, which is part of the control
<px:PXLinkEdit ID="edURL" runat="server" DataField="UsrURL" CommitChanges="True" />
Upvotes: 1