Announcement Announcement Module
No announcement yet.
field:select not initialized with correct selected value Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • field:select not initialized with correct selected value


    I'm using roo 1.2.3 in combination with spring data for mongodb and jspx/tiles to show my ui.

    On my domain class I have a field like

        @ManyToOne    //many to one to force use of select field in ui
        private Category category;
    On my update.jspx page for that entity, it produces an input field like

            <field:select field="category" id="c_dk_rl_pdfbrowser_domain_PdfFile_category" itemValue="id" items="${categorys}" path="/categorys" required="true" z="8R8620DBGyAiLQOLueF59FZgaMA="/>
    which is as expected. But the problem is that when I access the update page, the select field are populated with all available options for the category, but the correct option is not selected. I would expect the combobox to display the category setted for the entity you are editing, but it always just display the first option from the list.

    Is that a bug? Or how should I force the combobox to display the actual selected category on my entity, instead of just the first one available. If I change the input type to a textfield, the name of the selected category is shown correctly in the textfield.

    In the markup for the html all options are like

    <option value="25115080317610238519379680847">name_807 description_807</option>
    <option value="25115084468127743141689715818">name_2147483647 description_2147483647</option>
    and none has selected="selected"

    When I create an empty example using a derby embedded database, the correct element are selected in the combobox

    Best Regards
    Last edited by boldt; Feb 23rd, 2013, 08:08 AM. Reason: additional information