3 Replies Latest reply on Mar 12, 2009 5:48 AM by Ilya Shaikovsky

    reRender and UI local values

    Dmitri Ilyin Newbie

      Hi,

      i have i problem for that i can not find a solution. My be someone has it already.

      The form is shown in a modal panel. The modal panel has two ajax buttons: ok and cancel. In a form a have 3 input fields.
      With ok Button i submit a form and it is validated.

      If the validation of one of fields is failed the form is redisplayed. The values in input fields stays the same. That works fine.

      So, now i want to close the modal panel. With a cancel Button i send singleAjax Request and just make call hide() oncomplete. It works also.

      Next time i want to show modal panel again i make a reRender of the panel. The modal Panel use a bean from request scope. So the modal panel and the form must show the values from the bean (from reguest scope) i hoped.
      Well if the validation, last time the modal panel and my form on it was submitted, was succesful, the form shows values from the bean as desired. BUT if the validation last time was failed, the fields still have values from last time modal panel was shown. They are sticky. It looks like the values are not read from my bean but the UIComponent local values used instead.

      Well, it could be a common JSF issue, i'm not sure.

      What i need, is that the modal panel with a form each time, i call it, use the model values from my bean. Simple using reRender the panel work not to 100%. I need a way to reset the form or the panel after failed valildation.

      i hope i could explane my problem clearly, posting a code is difficult since i have to send a hole project, to get it work.

      thanks for any advises.
      regards
      Dmitri