You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Angelo Luis <an...@gmail.com> on 2006/09/28 14:05:42 UTC
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;" />
Re: VERY VERY VERY VERY strange behavior!!!
Posted by Mario Ivankovits <ma...@ops.co.at>.
> maybe
>
> marcacaoConsulta "
>
> vs ?
>
> marcacaoConsulta"
Hehe - good catch :-D
Ciao,
Mario
Re: VERY VERY VERY VERY strange behavior!!!
Posted by Matthias Wessendorf <ma...@apache.org>.
maybe
marcacaoConsulta "
vs ?
marcacaoConsulta"
(blank at the end)
-M
On 9/28/06, Angelo Luis <an...@gmail.com> wrote:
> 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;" />
>
>
>
--
Matthias Wessendorf
http://tinyurl.com/fmywh
further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com
Re: VERY VERY VERY VERY strange behavior!!!
Posted by Jeff Bischoff <jb...@klkurz.com>.
> Thats happen beacuse i put this #{consulta.id <http://consulta.id> !=
> null} in my rendered attribute...
Are you sure that's the significant difference? Best way to check is to
move the "rendered" attribute to the top button. Then, if the top button
no longer works, but the bottom one does you know you are correct about
the rendered attribute. Otherwise, you need to keep looking.
Angelo Luis wrote:
> 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 <http://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 <http://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;" />
>
>
>
Re: VERY VERY VERY VERY strange behavior!!!
Posted by Angelo Luis <an...@gmail.com>.
The page is something like this:
Its a view of a register, but the first time the page is rendered tha page
is a confirmation page (nothing is save in database), and this apge have a
save button (consulta.id == null), when the user save the register the same
page is rendered and the conversation is ended... now i have a NEW button (
consulta.id != null) that point to a blank form and so on...
The problem is that i my logic to show thats buttons is in the rendered
attribute...
On 9/28/06, Mario Ivankovits <ma...@ops.co.at> wrote:
>
> Hi Angelo!
> > i think that's the problem , but i cannot make a solution... i think
> > that t:saveState is conflict with Seam... and when the button is
> > rendered the conversation is End, so when i press the button the
> > consulta dont exist...
> Yes, I think there should be no need for saveState with seam.
>
> Do you mean, the conversation has been ended when the page is first
> rendered, or will it be ended "on button press"?
> In the second case, the conversation should end AFTER the action method,
> no?
> Well, I don't know much about seam here. At least its how we did it in
> our conversationTag.
>
> But maybe you'll have better support in seam's forum.
>
> Still, did you check the problem Matthias pointed out? - The space after
> the action name ... that way no navigation takes place and JSF simply
> reloads the page.
>
> Ciao,
> Mario
>
>
Re: VERY VERY VERY VERY strange behavior!!!
Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi Angelo!
> i think that's the problem , but i cannot make a solution... i think
> that t:saveState is conflict with Seam... and when the button is
> rendered the conversation is End, so when i press the button the
> consulta dont exist...
Yes, I think there should be no need for saveState with seam.
Do you mean, the conversation has been ended when the page is first
rendered, or will it be ended "on button press"?
In the second case, the conversation should end AFTER the action method, no?
Well, I don't know much about seam here. At least its how we did it in
our conversationTag.
But maybe you'll have better support in seam's forum.
Still, did you check the problem Matthias pointed out? - The space after
the action name ... that way no navigation takes place and JSF simply
reloads the page.
Ciao,
Mario
Re: VERY VERY VERY VERY strange behavior!!!
Posted by Angelo Luis <an...@gmail.com>.
i think that's the problem , but i cannot make a solution... i think that
t:saveState is conflict with Seam... and when the button is rendered the
conversation is End, so when i press the button the consulta dont exist...
On 9/28/06, Mario Ivankovits <ma...@ops.co.at> wrote:
>
> Hi Angelo!
> > <h:panelGroup rendered=" #{consulta.id <http://consulta.id> !=
> > null}">
> > <h:commandButton id="newButton1"
> > action="marcacaoConsulta " value="New" style="margin-top: 5px;"
> > immediate="true"/>
> > </h:panelGroup>
> >
> You have to ensure that the "consulta.id != null" is true, even if the
> user pressed the button. It is not sufficient to just render the button,
> JSF will not fire the action if the button is not rendered.
> In other words "consulta.id != null" has to be true even between
> multiple requests (as long as you would like to do something with the
> button)
>
> There are different ways to achieve this, one is, to save the bean (in
> your case "conulta") for the next request using t:saveState
>
> Ciao,
> Mario
>
>
Re: VERY VERY VERY VERY strange behavior!!!
Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi Angelo!
> <h:panelGroup rendered=" #{consulta.id <http://consulta.id> !=
> null}">
> <h:commandButton id="newButton1"
> action="marcacaoConsulta " value="New" style="margin-top: 5px;"
> immediate="true"/>
> </h:panelGroup>
>
You have to ensure that the "consulta.id != null" is true, even if the
user pressed the button. It is not sufficient to just render the button,
JSF will not fire the action if the button is not rendered.
In other words "consulta.id != null" has to be true even between
multiple requests (as long as you would like to do something with the
button)
There are different ways to achieve this, one is, to save the bean (in
your case "conulta") for the next request using t:saveState
Ciao,
Mario