Announcement Announcement Module
Collapse
No announcement yet.
How to hold fields form than are not in the model object ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to hold fields form than are not in the model object ?

    Hi,

    My model object is store in the session by the "formBackingObject" function.

    In my jsp page i use a selector with radio button, when i select one of them, it's send a submit, i make few operations to modify form informations (in the onSubmit function) and return to the form.

    But when i return to the form, the radio button is not checked of course because no one hold his value. So what is the best way to hold this type of value ?

    Thanks,

    Fabien.

  • #2
    The value should be returned in the request object, not the command object.

    Comment


    • #3
      Hi,

      In fact i use the referenceData to map property not in my modele like this :

      in my jsp

      <select name="idAffrete" onchange="call('choixAffrete');">
      </select>

      in my controller

      protected Map referenceData(HttpServletRequest request, Object command, Errors errors) throws Exception {
      String idAffrete=request.getParameter("idAffrete");

      ....

      refData.put("idAffrete", idAffrete);
      }

      My jsp post the idAffrete to a request parameter, so i can use it in all the controller fonction (submit, onbindvalidate...) : classical.

      Before i return to the view, the fonction referenceData is called and i put the request value in the map with the same name. And my jsp use this value to display it and when i post ...

      It works fine for me, if anyone has another method, i will be happy to speak with him ;-),

      Fabien.

      Comment

      Working...
      X