-
Jul 8th, 2012, 05:15 AM
#1
customize web view for integer field
Hi roo users !
Just making my first steps with roo and the MVC scaffolding. (jspx tags)
I am working on a simple asessment form and my entity needs to store an integer value but in the
UI this should be presented as a dropdown list where initially nothing is selected. So the model looks
something like this:
- please select
value : 1 should be displayed as "first option"
value : 2 should be displayed as "second option"
The example from the spring reference documentation "17.2.4.11 The options tag" looks good to me but
I am confused about the difference between "select" and "form:select" tags. The tags in the auto generated
jspx files use other tags <field:select> which do not support nested option elements as shown in the spring docs.
Can anyone provide me with an example that would work with my scenario ?
Thanks,
Dirk
-
Jul 8th, 2012, 11:50 AM
#2
The select has an items attribute. This must reference the list with your options.
It should be automatically added when your number is an enum.
-
Jul 8th, 2012, 12:49 PM
#3
I do not need an enum, I am just looking for a way to distinguish between the value that is actually stored (1,2,3,4....) in my case
and the label in the drop down that is displayed to the user.
And my confusion is about the various <select> tags available. The code in the spring docs seems to use a different taglib
than the one used in the generated jspx code. I want to modify the generated jspx file according to the example in the docs but don't know how to archive this.
In my case (an asessment form) I dont wan't the first possible value to be automatically selected I need some "please choose" dummy element to force the user to explicitly make a choice.
Regards,
Dirk
-
Jul 8th, 2012, 12:56 PM
#4
Roo indeed does not use the form:select from the spring taglib.
Just use the select-tag from roo and provide an items-attribute with itemLabel and itemValue. You have to put this into the model in your controller.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules