MenuNodeGetProperty(hNode, iField) - Possible bug or mismatch with Help File?

Hi,

I'm getting some return values that do not match what's stated in the help file for Function : MenuNodeGetProperty(hNode, iField)

Field values:


7 Comment gives me the "Display Name" field not "Comment" field.

8 Cluster -Display correct

9 Equipment -Display correct

13 Target Page -Display correct

101 Returns both "Page" and Content" separated with a comma, i.e 'MyPage, My_FP' it does not display the Custom 1 field content.

Does anyone get the same results? 

Rune

Parents
  • Hi Rune,

    It's a bit hidden... we forgot to expose it as a function.

    Try this, put a button on the Alarm page of the ExampleSA project.

    In the command, enter these two lines of code:

    DspSetMetadataFromName("EquipmentTree.Properties", "UseDisplayNames", "TRUE")
    PageSetInt("__TreeviewPos_" + IntToStr(DspGetAnFromName("EquipmentTree")) + "_Refresh", 1);

    At runtime when you press the button it will switch the tree into using the text from the "Display Name" field of your equipment.

    If you want to switch back, write "FALSE" to that metadata.

    How it works.
    The treeview genie on the Alarm Page has an AN name of "EquipmentTree". It has a hidden rectangle as one of its child objects called "Properties". You can see this if you open the DefaultAlarm_HD1080 page, select the treeview genie and press CTRL+G.
    From the Goto object dialog, if you open the properties up of this "Properties" rectangle object, you can then browse the metadata tab. You will see a number of metadata, of which one is "UseDisplayNames". We expose this via the genie form but not via a cicode function.

    The treeview code, however, was written expecting this to be dynamic at runtime, you'll see that in the "_Treeview_UpdateNodes" function.

    The "PageSetInt" command is how we "force" a refresh of the treeview control. Ideally we should have had a function for this... but at least you can enable this capability without modifying the treeview itself!

    cheers,

    bradley
Reply
  • Hi Rune,

    It's a bit hidden... we forgot to expose it as a function.

    Try this, put a button on the Alarm page of the ExampleSA project.

    In the command, enter these two lines of code:

    DspSetMetadataFromName("EquipmentTree.Properties", "UseDisplayNames", "TRUE")
    PageSetInt("__TreeviewPos_" + IntToStr(DspGetAnFromName("EquipmentTree")) + "_Refresh", 1);

    At runtime when you press the button it will switch the tree into using the text from the "Display Name" field of your equipment.

    If you want to switch back, write "FALSE" to that metadata.

    How it works.
    The treeview genie on the Alarm Page has an AN name of "EquipmentTree". It has a hidden rectangle as one of its child objects called "Properties". You can see this if you open the DefaultAlarm_HD1080 page, select the treeview genie and press CTRL+G.
    From the Goto object dialog, if you open the properties up of this "Properties" rectangle object, you can then browse the metadata tab. You will see a number of metadata, of which one is "UseDisplayNames". We expose this via the genie form but not via a cicode function.

    The treeview code, however, was written expecting this to be dynamic at runtime, you'll see that in the "_Treeview_UpdateNodes" function.

    The "PageSetInt" command is how we "force" a refresh of the treeview control. Ideally we should have had a function for this... but at least you can enable this capability without modifying the treeview itself!

    cheers,

    bradley
Children
No Data