Results 1 to 3 of 3

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

  1. #1

    Default 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. #2

    Default

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

  3. #3

    Default

    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.

Similar Threads

  1. Replies: 3
    Last Post: Jun 8th, 2010, 03:27 AM
  2. Replies: 9
    Last Post: May 4th, 2006, 09:53 AM
  3. Replies: 2
    Last Post: Oct 10th, 2005, 05:12 PM
  4. Form model and hibernate object id
    By riankruger in forum Data
    Replies: 1
    Last Post: Sep 15th, 2005, 02:21 AM
  5. Content Provider vs View Model
    By Martin Kersten in forum Swing
    Replies: 21
    Last Post: Mar 10th, 2005, 02:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •