Topic
  • 4 replies
  • Latest Post - ‏2014-03-07T15:57:55Z by MyDeveloerWorks
MyDeveloerWorks
MyDeveloerWorks
41 Posts

Pinned topic Dependent Attribute lists

‏2014-03-06T11:48:37Z |
Hello Dxl community,
 
I would like  to create a "dependent list box".  I have two attributes: "Req Type" and "SW  Req Type".  I want to make "SW Req Type " dependent on "Req Type". The full set of enum values for  "Req Type" are the following:
"HW","MECH","SW", "INFO", "DOC"

The full set of enum values for "SW Req Type" are the following:

"Not SW", "SW Info", "SW System", "SW Subsystem"

 

If I choose "Req Type" as "HW","MECH","INFO", "DOC" ( anything but "SW"), then I would like the list box of enum values for "SW Req Type" to be reduced to the following:
"Not SW", "SW Info"

Currently I have a work around that involves creating a view that shows illegal attribute combinations.( An "illegal" example would be "HW" and "SW System"). However my QA manager wants to filter the set of allowed enum values on "SW Req Type" depending on what was chosen on "Req Type".  I tried with  DXL attribute but of course this is limited to can generating single non-editable values, AFAIK.

Has anyone any ideas on dynamic attribute lists?
best regards
Colm
  • llandale
    llandale
    3010 Posts
    ACCEPTED ANSWER

    Re: Dependent Attribute lists

    ‏2014-03-06T18:58:39Z  

    A pre-attr-save trigger could disallow an "illegal" change; or present a sub-dialog explaining why and giving you the two options.  Yes, you do see the illegal options and first time users won't know not to select one.

  • GregM_dxler
    GregM_dxler
    166 Posts
    ACCEPTED ANSWER

    Re: Dependent Attribute lists

    ‏2014-03-06T21:43:07Z  

    Hello,

    I just found a link to a script that offers a neat solution

    http://www.smartdxl.com/content/?p=395

    Thanks Tony Goodman!

    Does anyone know what we should call the file that is placed in formalPopupFiles ?

     
    /*
        Creates a menu option to invoke the editCategory.dxl script.
     
        Install this file in DOORSHOME/lib/dxl/config/formalPopupFiles
        for this menu option to appear on the formal module popup menu.
     
        Tony Goodman.
    */
     
    createItem(alwaysOn,
    ...

     

    Hi,

    I call the file, My_Right_Menu_Items.dxl because it contains the menu items that I put in for my right click menu.  But that is just me.

    For your initial posting, we do something similar using dialog boxes.  Once an attribute selection is made, it activates another dialog box element that has the selections based on the first selection.  This allows me to change the second one based on the first.  It will change the second selection depending if the first selection is a multivalue enumeration, single value enumeration, integer, real or string type.  You probably don't need this, but you could make the available selections change depending on the first selection.

    In reality, the dialog box is set up with a callback function so when the selection is made on the first attribute, the callback calls a function that populates the dialog box element for the second attribute.  If you wanted to be real sneaky, you could diable the second one until the first selection is made.

    I'm much more of a fan of providing dialog boxes to guide the developer on the right selections than trying to make triggers and such to tell them when they did something wrong.  Unfortunately, it is hard to get them to use the scripts instead of just directly editing things!

    Hope this helps,

    Greg

  • MyDeveloerWorks
    MyDeveloerWorks
    41 Posts

    Re: Dependent Attribute lists

    ‏2014-03-06T14:01:49Z  

    Hello,

    I just found a link to a script that offers a neat solution

    http://www.smartdxl.com/content/?p=395

    Thanks Tony Goodman!

    Does anyone know what we should call the file that is placed in formalPopupFiles ?

     
    /*
        Creates a menu option to invoke the editCategory.dxl script.
     
        Install this file in DOORSHOME/lib/dxl/config/formalPopupFiles
        for this menu option to appear on the formal module popup menu.
     
        Tony Goodman.
    */
     
    createItem(alwaysOn,
    ...

     

  • llandale
    llandale
    3010 Posts

    Re: Dependent Attribute lists

    ‏2014-03-06T18:58:39Z  

    A pre-attr-save trigger could disallow an "illegal" change; or present a sub-dialog explaining why and giving you the two options.  Yes, you do see the illegal options and first time users won't know not to select one.

  • GregM_dxler
    GregM_dxler
    166 Posts

    Re: Dependent Attribute lists

    ‏2014-03-06T21:43:07Z  

    Hello,

    I just found a link to a script that offers a neat solution

    http://www.smartdxl.com/content/?p=395

    Thanks Tony Goodman!

    Does anyone know what we should call the file that is placed in formalPopupFiles ?

     
    /*
        Creates a menu option to invoke the editCategory.dxl script.
     
        Install this file in DOORSHOME/lib/dxl/config/formalPopupFiles
        for this menu option to appear on the formal module popup menu.
     
        Tony Goodman.
    */
     
    createItem(alwaysOn,
    ...

     

    Hi,

    I call the file, My_Right_Menu_Items.dxl because it contains the menu items that I put in for my right click menu.  But that is just me.

    For your initial posting, we do something similar using dialog boxes.  Once an attribute selection is made, it activates another dialog box element that has the selections based on the first selection.  This allows me to change the second one based on the first.  It will change the second selection depending if the first selection is a multivalue enumeration, single value enumeration, integer, real or string type.  You probably don't need this, but you could make the available selections change depending on the first selection.

    In reality, the dialog box is set up with a callback function so when the selection is made on the first attribute, the callback calls a function that populates the dialog box element for the second attribute.  If you wanted to be real sneaky, you could diable the second one until the first selection is made.

    I'm much more of a fan of providing dialog boxes to guide the developer on the right selections than trying to make triggers and such to tell them when they did something wrong.  Unfortunately, it is hard to get them to use the scripts instead of just directly editing things!

    Hope this helps,

    Greg

  • MyDeveloerWorks
    MyDeveloerWorks
    41 Posts

    Re: Dependent Attribute lists

    ‏2014-03-07T15:57:55Z  

    Hi,

    I call the file, My_Right_Menu_Items.dxl because it contains the menu items that I put in for my right click menu.  But that is just me.

    For your initial posting, we do something similar using dialog boxes.  Once an attribute selection is made, it activates another dialog box element that has the selections based on the first selection.  This allows me to change the second one based on the first.  It will change the second selection depending if the first selection is a multivalue enumeration, single value enumeration, integer, real or string type.  You probably don't need this, but you could make the available selections change depending on the first selection.

    In reality, the dialog box is set up with a callback function so when the selection is made on the first attribute, the callback calls a function that populates the dialog box element for the second attribute.  If you wanted to be real sneaky, you could diable the second one until the first selection is made.

    I'm much more of a fan of providing dialog boxes to guide the developer on the right selections than trying to make triggers and such to tell them when they did something wrong.  Unfortunately, it is hard to get them to use the scripts instead of just directly editing things!

    Hope this helps,

    Greg

    Hi Greg,

    Thanks for the advice (to both Greg and Louie)

    At the moment I cant get a DOORS license to try things. Will try next week and follow up this thread with an answer.

     

    Colm