I had a similar problem.

I had the managedBean in requestScope and when the button is pressed the request ends so the managedBean is not anymore in scope.

In the “restoreView” phase the id is null so the rendered is false and the action won’t be fired. Solved this by putting the managedBean in sessionScope.

Note that this was without seam, don’t know much about seam so it might be another problem.

 

Greetins

Markus

 


Von: Angelo Luis [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 28. September 2006 14:06
An: MyFaces Discussion
Betreff: VERY VERY VERY VERY strange behavior!!!

 

Just look this code:

<f:facet name="footer">
    <h:panelGroup>
        <h:panelGroup>
              <h:commandButton id="newButton0" action=""> marcacaoConsulta" value="New" style="margin-top: 5px;" immediate="true"/>                                   
        </h:panelGroup>                       

       <h:panelGroup rendered=" #{consulta.id != null}">
               <h:commandButton id="newButton1" action="">marcacaoConsulta " value="New" style="margin-top: 5px;" immediate="true"/>                                   
       </h:panelGroup>                                                       
   </h:panelGroup>                       
<f:facet>

The 2 commandButton call the action "marcacaoConsulta" but just the first in (newButton0) works, the second redisplay the page. 

Thats happen beacuse i put this #{consulta.id != null} in my rendered attribute... so when the consulta have a id property that's not null the button is rendered, but the action of this button is not call and the page is redisplay... I put one above that ( newButton0) that the panel group that's don't have a rendered attribute and he works fine... when i see the source the buttons is rendered in the same way, oi cannot understand why one works and other don't:


<input id="pacienteViewForm:newButton0" name
="pacienteViewForm:newButton0" type="submit" value=
"Nova consulta 0" onclick="clear_pacienteViewForm();" style=
"margin-top: 5px;" />
<input id="pacienteViewForm:newButton1"
name="pacienteViewForm:newButton1" type="submit" 
value="Nova consulta"   onclick="clear_pacienteViewForm();" 
style="margin-top: 5px;" />

 

Reply via email to