Announcement Announcement Module
Collapse
No announcement yet.
Binding Multiple Fields to One Property Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Binding Multiple Fields to One Property

    Hello,
    I am having trouble binding multiple fields from my jsp to one property.

    Here is my situation:

    Code:
    <spring:bind path="inquiryCommand.asOfDate">
        <input type="text" name="${status.expression}" value="${status.value}"/>
        <input type="text" name="${status.expression}" value="${status.value}"/>
        <input type="text" name="${status.expression}" value="${status.value}"/>
    </spring:bind>
    * I have left out the static text to make it shorter

    I have created a custom property editor which expects a comma delimited String... which works. But, on the way back out (when my property editor calls getAsText()), I combine the fields back into a comma delimited String (just as it came into setAsText()). My problem is that I don't know how to display each individual field in each input like they came in... the entire comma delimited String is printed in each input.

    any thoughts?

    thanks,
    Ryan

  • #2
    You cannot really do this unfortunately

    Why not just use the (deprecated) methods of date (date.day, date.month, date.year), or write your own Date object?

    Comment


    • #3
      Originally posted by lindbird
      I have created a custom property editor which expects a comma delimited String... which works. But, on the way back out (when my property editor calls getAsText()), I combine the fields back into a comma delimited String (just as it came into setAsText()). My problem is that I don't know how to display each individual field in each input like they came in... the entire comma delimited String is printed in each input.
      I might be a little paranoid here - forget about the display problem, to begin with, how can we be sure that the three values in the comma delimited string will always be in the order we expect? In other words, does any user agent have to construct the string in the same order as the fields appear in the page?

      Comment


      • #4
        Originally posted by manifoldronin
        I might be a little paranoid here - forget about the display problem, to begin with, how can we be sure that the three values in the comma delimited string will always be in the order we expect? In other words, does any user agent have to construct the string in the same order as the fields appear in the page?
        Good question.....

        It has been my experience that most browsers *will* be consistent, but there is nothing to say which is first, which is second etc...

        I also do not think there is anything in the spec about it...

        Comment

        Working...
        X