[jboss-user] [JBoss Seam] - Problem with immediate="true" and refresh page display

anescu do-not-reply at jboss.com
Tue Jun 12 08:27:58 EDT 2007


Hi,

I have this situation:
It's a Seam-gen application (1.2.1). On one screen (Got entity Abc, managed by AbcHome), I added a checkbox:

<h:selectBooleanCheckbox value="#{abcHome.instance.useExisting}" onclick="doRefresh()">
  |  </h:selectBooleanCheckbox>
  | <h:commandButton id="submitter" style="visibility:hidden;" action="#{abcHome.refresh}" immediate="true">
  | </h:commandButton>
  | 
  | <script language="javascript">
  |     function doRefresh(){
  |         document.getElementById("abc:submitter").click();
  |     }
  | </script> 

So, i have some fields that are rendered or hidden based on the #{abcHome.instance.useExisting} value. I added the anonymous wrote : refresh()  method in the AbcHome class:
    public String refresh()
  |     {
  |         return "refresh";
  |     }

The code works almost ok, I mean if I change any of the fields that are displayed the first time and click the checkbox the values are kept, but the page is not rerendered (meaning all field hidden remain hidden, all field that should become hidden remain visible).
If I remove the anonymous wrote : immediate="true" part, then I find myself in another problem, the form validation is performed and the page is not sent to the server.

I also tried to use an anonymous wrote : s:link  instead, that would have sent me to the same page, but then I lost all the modifications I have already done.

Any idea what is wrong? Is this a known problem with Seam? Or any other solution/workaround.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4053494#4053494

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4053494



More information about the jboss-user mailing list