1. John Vanleeuwe
  2. PowerBuilder
  3. Thursday, 24 October 2024 16:52 PM UTC

Hi guys,

 

We have an inputscreen with about 100 inputfields.

My goal is to have a database driven tooltip functionality.

I can create a global function that has inputarguments for example : the column name and the language of the user

How can i call my global function for each column name please without having to manually enter each datawindow column name in the Tooltip expression please ? I want to use a generic solution.

 

TIA

John

 

 

 
John Vanleeuwe Accepted Answer Pending Moderation
  1. Friday, 25 October 2024 07:20 AM UTC
  2. PowerBuilder
  3. # 1

Hi Chris,

 

English isn't my native language. I am probably not expressing my goal clearly enough.

I don't want to run through all my datawindow columns at opening of my dw , this seems overkill to me.

I want to refer to the actual dw column from within my Expression of the tooltip of that specific column.

Something like "getcolumnname" or something like that :)  But without coding or loading all the column names.

 

So I can set it once in the dw painter for each column, and it will only run when the tooltip is being activated.

 

TIA

John

 

 

 
Comment
  1. John Fauss
  2. Friday, 25 October 2024 16:03 PM UTC
@Arnd - Mr. Vanleeuwe wants to implement this functionality in DataWindow expressions, not in PowerScript code, so the normal/typical methods that one would use are not available.

@Chris - Examining and using the name of the current column only works if the tooltip that needs to be displayed is for the current column... however, a tooltip appears in response to the DWObject the mouse hovers over, which may not be the current column object, particularly if the DW contains about 100 columns, as John stated in his original post.
  1. Helpful
  1. Arnd Schmidt
  2. Friday, 25 October 2024 16:19 PM UTC
@John

I understood: He wants to use a global function.

"How can I call my global function...."

  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 25 October 2024 17:09 PM UTC
Hi John;

You can also use my approach for a "Mouse Over" implementation as well.\ using the GetObjectAtPointer()M method ;-)

Regards .. Chris
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 24 October 2024 18:08 PM UTC
  2. PowerBuilder
  3. # 2

Hi John;

FYI ...

  1. You can use the following command to get a list of all objects in any DWO ... <DW Control Name>.Describe ("DataWindow.Objects")
  2. Then you can use this command to determine each DWO's type... <DW Control Name>.Describe ("<Columnname>.Type")
  3. Once you have identified the list of "Column" objects from step #2, you can then feed these into your function.
  4. Then you fnction could update the ToolTip text .. <DW Control Name>.Modify ("<Columnname>.Tooltip.Tip='<string>'")
  5. Then it could also update the Title ... <DW Control Name>.Modify ("<Columnname>.Tooltip.Title='<string>'")

Note: To also update the expression for the above, you would also add "~tIF(x,y,z)" to the Modify command string. 

HTH

Regards .. Chris

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 24 October 2024 18:58 PM UTC
Hi John .. I have updated my original answer. Does this now seem a better / clearer answer?
  1. Helpful 1
  1. John Vanleeuwe
  2. Thursday, 24 October 2024 19:31 PM UTC
HI Chris, this seems so "heavy" to me :) Does your solution/answer also means a "no" to my question, if we can refer to the column itself from within an expression ? Cause that makes more sense to me , but maybe it just can't be done :)
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 24 October 2024 20:58 PM UTC
Absolutely, the IF (X,Y,Z) would be the expression you would have entered in the DW Painter. So if it works there, it will work when dynamically added.

For example ...

String ls_mod = ls_colName

ls_mod += " .Tooltip.Title='" + "Default>"

ls_mod += "~tIF ( " + "<Columnname>" + "expression" + "," + "Tile A," + "Title B" )

<DW Control Name>.Modify ("<Columnname>.Tooltip.Title=' + ls_mod + "'")
  1. Helpful 1
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.