You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by "Matthes R." <m....@googlemail.com> on 2007/05/22 15:40:42 UTC

[tomahawk sandbox] dynamic PPR content changes

hi all,

i've got a problem with dynamically changing the content of my page with the
PPR components of the sandbox.
i'm using myfaces-core-1.1.5, tomahawk-1.1.5 and
tomahawk-sandbox-1.1.6-SNAPSHOT.

here is my code:
-----------------
<h:form id="form1">

    <t:commandLink id="switchToPage2" action="#{
contentIncludeBean.switchToPage2}" value="switch content"/>
    <f:verbatim><br /></f:verbatim>

    <s:pprPanelGroup id="pageContent" partialTriggers="switchToPage2">
        <f:subview id="page1Content" rendered="#{
contentIncludeBean.includeString == 'page1'}">
            <f:verbatim><div>page1</div></f:verbatim>
        </f:subview>
        <f:subview id="page2Content" rendered="#{
contentIncludeBean.includeString == 'page2'}">
            <f:verbatim><div>page2</div></f:verbatim>
        </f:subview>
        <h:outputText value="#{contentIncludeBean.includeString ==
'page1'}"></h:outputText>
        <h:outputText value="#{contentIncludeBean.includeString ==
'page2'}"></h:outputText>
    </s:pprPanelGroup>

</h:form>
-----------------

and the bean has this method:

-----------------
    public void switchToPage2() {
        includeString = "page2";
    }
-----------------

when loading the page for the first time the subview "page1Content" is
rendered, so its working correct. then when i hit the commandLink both
subviews are not rendered but the boolean values calculated below are
correct: false / true.

is there a way to fix this problem? or is there another (perhaps better) way
to get this to work?

regards,
Matthes Rieke

Re: [tomahawk sandbox] dynamic PPR content changes

Posted by "Matthes R." <m....@googlemail.com>.
hi,

aaah ok. fixed that one. i'm kind of new to myfaces so things like this
happen to me often :-)
thanks for the help!

regards,
Matthes


2007/5/22, Volker Weber <v....@inexso.de>:
>
> Hi,
>
> you cant use f:verbatim in ppr updates.
>
> content of verbatim is transient and not restored at rerendering.
>
>
> Regards,
>     Volker
>
>
> 2007/5/22, Matthes R. <m....@googlemail.com>:
> > hi all,
> >
> > i've got a problem with dynamically changing the content of my page with
> the
> > PPR components of the sandbox.
> > i'm using myfaces-core-1.1.5, tomahawk-1.1.5 and
> > tomahawk-sandbox-1.1.6-SNAPSHOT.
> >
> >  here is my code:
> > -----------------
> > <h:form id="form1">
> >
> >     <t:commandLink id="switchToPage2"
> > action="#{contentIncludeBean.switchToPage2}" value="switch
> > content"/>
> >     <f:verbatim><br /></f:verbatim>
> >
> >     <s:pprPanelGroup id="pageContent"
> > partialTriggers="switchToPage2">
> >         <f:subview id="page1Content" rendered="#{
> > contentIncludeBean.includeString == 'page1'}">
> >             <f:verbatim><div>page1</div></f:verbatim>
> >         </f:subview>
> >         <f:subview id="page2Content" rendered="#{
> > contentIncludeBean.includeString == 'page2'}">
> >             <f:verbatim><div>page2</div></f:verbatim>
> >         </f:subview>
> >         <h:outputText
> > value="#{contentIncludeBean.includeString ==
> > 'page1'}"></h:outputText>
> >         <h:outputText
> > value="#{contentIncludeBean.includeString ==
> > 'page2'}"></h:outputText>
> >     </s:pprPanelGroup>
> >
> > </h:form>
> > -----------------
> >
> > and the bean has this method:
> >
> > -----------------
> >     public void switchToPage2() {
> >         includeString = "page2";
> >     }
> > -----------------
> >
> > when loading the page for the first time the subview "page1Content" is
> > rendered, so its working correct. then when i hit the commandLink both
> > subviews are not rendered but the boolean values calculated below are
> > correct: false / true.
> >
> > is there a way to fix this problem? or is there another (perhaps better)
> way
> > to get this to work?
> >
> > regards,
> > Matthes Rieke
> >
>

Re: [tomahawk sandbox] dynamic PPR content changes

Posted by Volker Weber <v....@inexso.de>.
Hi,

you cant use f:verbatim in ppr updates.

content of verbatim is transient and not restored at rerendering.


Regards,
    Volker


2007/5/22, Matthes R. <m....@googlemail.com>:
> hi all,
>
> i've got a problem with dynamically changing the content of my page with the
> PPR components of the sandbox.
> i'm using myfaces-core-1.1.5, tomahawk-1.1.5 and
> tomahawk-sandbox-1.1.6-SNAPSHOT.
>
>  here is my code:
> -----------------
> <h:form id="form1">
>
>     <t:commandLink id="switchToPage2"
> action="#{contentIncludeBean.switchToPage2}" value="switch
> content"/>
>     <f:verbatim><br /></f:verbatim>
>
>     <s:pprPanelGroup id="pageContent"
> partialTriggers="switchToPage2">
>         <f:subview id="page1Content" rendered="#{
> contentIncludeBean.includeString == 'page1'}">
>             <f:verbatim><div>page1</div></f:verbatim>
>         </f:subview>
>         <f:subview id="page2Content" rendered="#{
> contentIncludeBean.includeString == 'page2'}">
>             <f:verbatim><div>page2</div></f:verbatim>
>         </f:subview>
>         <h:outputText
> value="#{contentIncludeBean.includeString ==
> 'page1'}"></h:outputText>
>         <h:outputText
> value="#{contentIncludeBean.includeString ==
> 'page2'}"></h:outputText>
>     </s:pprPanelGroup>
>
> </h:form>
> -----------------
>
> and the bean has this method:
>
> -----------------
>     public void switchToPage2() {
>         includeString = "page2";
>     }
> -----------------
>
> when loading the page for the first time the subview "page1Content" is
> rendered, so its working correct. then when i hit the commandLink both
> subviews are not rendered but the boolean values calculated below are
> correct: false / true.
>
> is there a way to fix this problem? or is there another (perhaps better) way
> to get this to work?
>
> regards,
> Matthes Rieke
>