Combo box derived from other

Combo box derived from other

  
Hello,

I'm having troubles to have a combo box to show a record list. What I need is to choose from one combo box the brand of a machine, e.g XPTO, and then have another combo box to show the items of that brand, perhaps jeans, t-shirts, shorts ...

What I did was to pass the id of the brand as an input argument and then in a new action retrieve the items of the ID brand and put it in a ItemListRecord. I also created a structure ITEM to the combo box and assign its values from the ItemListRecord.

In the Combo Box properties set:
Source Record List: ItemListRecord
Source Entity/Structure: Item (structure)
Source Atribute: Item_Name (structure)
Source Identifier Atribute: Item_Name

after all of this there must be something missing as I can't get any items in the 2nd combo box.
In attachment goes my oml if anybody could give me a hand I would much appreciate it.

Thanks in advance,
BonfaitFrance
Hello Bonfait

And welcome the the Agile Community TechCenter.

I've checked the espace you've provided, and i couldn't find any screen with multiple combo boxes in it, much like the pattern you've described.

However, from your description, I assume you want to have two combo boxes, one with the brand, and the other that' automatically filled with the content based on the chosen brand in the previous combo box. The way to do it is to have a the second combo box assigned to a record list local variable that's filled in a screen action, called by the On Change event of the first combo box, using an ajax refresh node.

In attachment you'll find a simple example using some system entities, to which you can choose the espace in the first combo box, and automatically, through an Ajax request, the second combo box will be filled with that espace's entities list. Much like your brand, and the correspondent items.

Hope it goes toward helping you in working this pattern out.

If you have any further problems with this, plese elaborate the pattern more clearily, and provide us with an espace with your design.

Thank you

Best regards

Miguel Simões João
Bonjour Miguel,

thank you very much for your help. I was missing the refresh AJAX. However I am having some dificulties editing the object as I cannot have the 2nd combobox to be displayed with the item previously saved.

In the espace I provided you can find the 2 combo boxes in the Object_Edit screen.

One more question, how can I make a combo box mandatory??

Once more Thank you very much and if you could help me out in the editing issue I would very much appreciate.

Kind Regards,
Bonfait
Hi Bonfait

Since combo boxes are discrete lists of values, the easiest way to make it mandatory is to only provide valid options in it. However, this is not very user-friendly and can lead the user to input false values, e.g. if one is selected as default.

The other way to do it is to validate, in the button(s) that the user can click, whether the value selected in the combo box is valid and return an error to the user if the value is invalid. You can also set the "valid" property of the combo to False, and the user will get visual feedback.
A simple way to see if the user has provided a valid value is to have "valid values" come out of a query, or an entity, and have the invalid value come out of a special list. Simply map a special variable in the appropriate property of the combo, and if its value is not an empty string, then an invalid value is selected.

If you have any problems with that I can make a simple example.
Miguel João wrote:
Hello Bonfait

And welcome the the Agile Community TechCenter.

I've checked the espace you've provided, and i couldn't find any screen with multiple combo boxes in it, much like the pattern you've described.

However, from your description, I assume you want to have two combo boxes, one with the brand, and the other that' automatically filled with the content based on the chosen brand in the previous combo box. The way to do it is to have a the second combo box assigned to a record list local variable that's filled in a screen action, called by the On Change event of the first combo box, using an ajax refresh node.

In attachment you'll find a simple example using some system entities, to which you can choose the espace in the first combo box, and automatically, through an Ajax request, the second combo box will be filled with that espace's entities list. Much like your brand, and the correspondent items.

Hope it goes toward helping you in working this pattern out.

If you have any further problems with this, plese elaborate the pattern more clearily, and provide us with an espace with your design.

Thank you

Best regards

Miguel Simões João
Hi There,

I'm also looking into the dependencies of the comboboxes.
And therefore the example oml is great! However I'm using an outputstructure so that I'm able to enter more attributes into the combobox making sure that I pick the right record.
Therefore I get an error if I put the local variable there?

How to cope with this?

Regards, Arnold Grippeling