Yes, I think using jsp code is going to cause you problems.
The JSF way to do this is to use the "rendered" attribute on components.
If you have multiple components, you can use a grouping component
(like h:panelGroup) to render (or not render) on all enclosed
components.
ie,
<h:panelGroup id="IsPrgAbertaTags" rendered="#{prg.prgAberta}">
</h:panelGroup>
Also, under JSF, you should use one form per page. It looks like
you're missing a starting form tag on the code you posted below.
On 3/15/06, Vladimir Coutinho <[EMAIL PROTECTED]> wrote:
> I think the problem is I'm mixing jsf with jsp.
>
> How do I make an "if" test in JSF? I'm trying to do like a did in JSP, but
> is not working.
>
> <t:saveState id="savePrg" value="#{Prorrogacao}" />
>
> Prorrogacao prg = (Prorrogacao) request.getAttribute("Prorrogacao");
> if (prg.isPrgAberta()){%>
> <h:outputText value="J� h� prorroga��o em aberto para este cliente: #{
> Prorrogacao.nrPrgAberta}"/><BR>
> <h:form>
> <h:commandButton value="Gerar s�mula"
> action="#{Prorrogacao.gerarSumula}"/>
> </h:form>
> <%}else{%>
> <h:outputText styleClass="label" escape="false" value="Abertura de
> prorroga��o para #{Prorrogacao.cliente.NM_CLI}"/><BR>
> <t:inputDate id="novo_vencimento" popupCalendar="true"
> type="date" lang="pt-br"
> required="true" value="#{Prorrogacao.limite.DT_VNCT }"/>
>
> <h:commandButton id="gravar" value="Gravar"
> style="margin-left:8px;margin-top:8px;" styleClass="label"
> action="#{Prorrogacao.gravaProrrogacao }"/>
> </h:form>
>
>
> The method Prorrogacao.gravaProrrogacao only returns to this page (for
> test).
>
>
>
>
>
>
>
> On 3/14/06, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> > It'd probably help if you posted parts of your page tags. Using
> > t:saveState should work, so if it's not working, there's probably
> > something else involved.
> >
> >
> >
> > On 3/14/06, Vladimir Coutinho < [EMAIL PROTECTED]> wrote:
> > >
> > > But I'm using saveState in both pages.
> > >
> > > The user fill some parts of the form, press "save" button e he goes to
> > > other page with saveState to complete the form or came back to the same
> page
> > > (case is not necessary fill the second form). But the object is not
> being
> > > saved.
> > >
> > >
> > >
> > > On 3/10/06, Mike Kienenberger <[EMAIL PROTECTED] > wrote:
> > > > On 3/10/06, Vladimir Coutinho <[EMAIL PROTECTED]> wrote:
> > > > > I'm using saveState to preserve a request backing bean from a page
> to
> > > other.
> > > > > In the other page the user fill other fields of the form. But in the
> > > action,
> > > > > the properties that I'm do not put in the 2nd page are not being
> > > preserved.
> > > > > Do I have to put the fields of the form 1 as hidden input in the
> form in
> > > 2nd
> > > > > page?
> > > >
> > > > No, just use identical saveState tags on both pages.
> > > >
> > >
> > >
> > >
> > > --
> > > Vladimir M Coutinho
> >
>
>
>
> --
> Vladimir M Coutinho