Announcement Announcement Module
Collapse
No announcement yet.
Dynamic modelAttribute for form ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamic modelAttribute for form ?

    Hi,

    Ive got a jsp view (a view state in a web flow) in which I want to display x tabs (using jqueryui tabs plugin).

    The jsp will access a List of XXXModel's from a variable in the flowscope and iterate over each one using c:forEach in order to create a form on each tab.

    Trouble is, i need to be able to specify the modelAttribute or command for the form and it doesnt seem to allow me to use the variable name in my jstl iterator

    in example below manufacturerNoticeOfSeizureModels is a List of XXXModel's

    <c:forEach var="manufacturerNoticeOfSeizureModel"
    items="${manufacturerNoticeOfSeizureModels}">
    <div id="xxx">
    <form:form modelAttribute="<CANNOT USE var here!>"
    id="createNoticeOfSeizureForm">
    <fieldset>
    <legend>
    etc
    </form:form>

    anyone know a way around this ?

    thanks

  • #2
    The spring form tag worked for me using a jstl variable. Here is what I did as a test.

    Code:
    <c:set var="formToUse" value="resetPasswordBean"/>
    <form:form modelAttribute="${formToUse}" method="post">
    ...
    </form:form>
    You must be having a issue somewhere else.

    Marty

    Comment

    Working...
    X