Combo box default value display problem

0
I have a display issue with a combo box.In my domain model, there is a Node entity that stores a value attribute — this value holds the ID of a Ruleset entity returned from a nanoflow. However, I want my <select> (combo box) to display the Ruleset name instead of the ID. The problem is that when I reopen the page, the combo box initially shows the Ruleset ID as the default value, not the Ruleset name. Has anyone encountered this issue before? How can I make the combo box correctly display the Ruleset name even when the value stored is the Ruleset ID?       My mendix version is 10.24.8   Thanks in advance!
asked
1 answers
0

Use an Association instead of ID

  1. In your domain model:

    • Create an association → Node_RuleSet (between Node and RuleSet).

    • Remove the plain string attribute storing RuleSet ID (optional).

  2. In your page Combo Box:

    • Data source: RuleSet entity (XPath or nanoflow).

    • Display attribute: RuleSetName (or Name).

    • Value (reference): Node_RuleSet.

  3. In your nanoflow (when RuleSet is selected):

    • changeObject(NodeObj, { Node_RuleSet: selectedRuleSet });

  4. When you reopen the page, Mendix automatically loads the associated RuleSet and displays its Name instead of ID.

answered