Search code examples
ibm-doors

DXL simple attribute return


i am new to DXL.

What i am trying to achieve:

I would like to create a DXL column in a module which displays the object's ForeignID plus a prefix.

What i tried:

Module m = current

Object o

for o in m do {

string s = o."ForeignID"

displayRich("Prefix " s)

}

but this only results in the entire list Prefix+ForeignID of all module's objects within each cell of the DXL column.

What do i need to change so every object will only show it's own Prefix+ForeignID within the DXL cell.

Thanks in advance for your help


Solution

  • You can get some information here: https://www.ibm.com/docs/en/ermd/9.7.1?topic=definitions-dxl-attributes-layout-dxl-columns. Also check the DXL reference which is linked on that page

    The code in DXL Layout columns is executed for each Object, there is a variable called "obj", which points to the Object which is being calculated at the moment (N.B. that is NOT the "current" Object, which is the Object that the user has clicked on).

    Your code would simply be

    string s = obj."ForeignID"
    displayRich("Prefix " s)
    

    or as a one-liner

    displayRich("Prefix " obj."ForeignID" "")
    

    (in this case, display would suffice. displayRich is only need when you have RTF (formatted) text, like the one in "Object Text".)