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

  • field:select not initialized with correct selected value

    Hi,

    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

    Code:
        @NotNull
        @DBRef
        @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

    Code:
            <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

    Code:
    <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
    Niels
    Last edited by boldt; Feb 23rd, 2013, 08:08 AM. Reason: additional information
Working...
X