1. Paweł Kasperek
  2. PowerBuilder
  3. Thursday, 23 November 2023 17:17 PM UTC

Hi,

I  have to insert Hyperlink inside in cell (column) of DataWindow. Is possible to set a text as hyperlink and next call a website (via OpenUrl function) on clicking this link?

Regards,

Pawel

John Fauss Accepted Answer Pending Moderation
  1. Thursday, 23 November 2023 19:30 PM UTC
  2. PowerBuilder
  3. # 1

Hi, Pawel - 

I believe you will have to implement this functionality yourself, but it should not be too difficult.

If I were to do this, I would hold the actual URL in a non-visible column DWObject, and use a separate DWObject to display to the user the text of the "hyperlink", and put code in the DataWindow control's Clicked event to see if the user has clicked on the faux hyperlink DWObject. If so, grab the URL from the non-visible column DWObject and call the OpenURL PowerScript function. If you like, you could display the text of the faux hyperlink with underlining enabled to make it appear more like an actual hyperlink.

If you need or want to visibly indicate when the user has clicked on/visited a "hyperlink", consider using another non-visible column DWObject as a placeholder for a "VisitedURL" Yes/No or 1/0 status value, combined with the use an expression for the text color of the faux hyperlink DWObject to use either the special PB color named "Link" (RGB value: 134217856) or "Link Visited" (RGB value: 134217859). Of course, if you're using themes then any attempt to dictate color assignment pretty much goes out the (figurative) window... no pun intended.

Best regards, John

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.