Page 1 of 2

Nested pe:switch

Posted: 04 Oct 2012, 18:59
by Babas007
Hi,

It seems that nested switch does not work. The switch with id "switch" used to work before I add the switch "main_switch"

Code: Select all

    <ui:define name="content">
        <pe:switch id="main_switch" value="#{profilBean.action}" >
            <pe:defaultCase>
                <h:panelGrid columns="2" width="100%">
                    <p:panel >
                        <h:panelGrid columns="3" cellpadding="20px">
                            <h:panelGrid style="text-align: center">
                                <h:graphicImage value="image?path=#{resourceServiceBean.getResource('profil.png')}" />
                                <p:commandLink value="Mon Profil" actionListener="#{profilBean.setOption('profil')}" update="switch" />
                            </h:panelGrid>

                            <h:panelGrid style="text-align: center">
                                <h:graphicImage value="image?path=#{resourceServiceBean.getResource('identity.png')}" />
                                <h:outputLabel value="Identifiants" />
                            </h:panelGrid>
                    </p:panel>
                    <p:panel header="Options">
                        <pe:switch id="switch" value="#{profilBean.option}" >
                            <pe:defaultCase >
                                <p align="center">
                                    Bienvenue dans votre espace membre!
                                </p>
                            </pe:defaultCase>

                            <pe:case value="profil">
                                <h:outputLink value="diver.xhtml?diver=#{sessionBean.diver.id}">Voir mon profil actuel</h:outputLink><br />
                                <p:commandLink value="Modifier mes informations publiques" actionListener="#{profilBean.setAction('m_public_infos')}" /><br />
                                <h:outputLink >Changer de signature et de citation</h:outputLink><br />
                                <h:outputLink >Changer d'avatar</h:outputLink><br />
                                <h:outputLink >Supprimer mon compte</h:outputLink><br />
                            </pe:case>
                        </pe:switch>
                    </p:panel>
                </h:panelGrid>
            </pe:defaultCase>
            
            <pe:case value="m_public_infos" >
                ziouezoiuezoifru
            </pe:case>
        </pe:switch>
    </ui:define>
Tested with PF 3.4 and PFE 0.6.0, Mojarra Implementation

Re: Nested pe:switch

Posted: 04 Oct 2012, 20:00
by tandraschko
Should work but you can create an issue and we will have a look at it.

Re: Nested pe:switch

Posted: 04 Oct 2012, 21:31
by Babas007
I digged a bit, and action listener method is not called, since I added the first switch.

Code: Select all

<p:commandLink value="Mon Profil" actionListener="#{profilBean.setOption('profil')}" update="switch" />//setOption not called

Re: Nested pe:switch

Posted: 04 Oct 2012, 23:48
by tandraschko
Fixed the problem with actions. Could you please try it again and also test the nested switch with the trunk version?

Re: Nested pe:switch

Posted: 08 Oct 2012, 18:44
by fabiomargarido
Hi zoigl,

We've also been bitten by this bug. Is there any chance of a bugfix release soon? This is kind of a showstopper for us.
Thank you very much.

Re: Nested pe:switch

Posted: 08 Oct 2012, 19:10
by tandraschko
I think we will release a bugfix release next month or end of this month. I will talk with Oleg.
It's already fixed in trunk, you can build it from source if you need it now.

Re: Nested pe:switch

Posted: 08 Oct 2012, 20:12
by tandraschko
I talked with Oleg and we will release a bugfix release next week.

Re: Nested pe:switch

Posted: 08 Oct 2012, 22:42
by fabiomargarido
That would be awesome!

Thanks a lot.

Re: Nested pe:switch

Posted: 09 Oct 2012, 14:20
by fabiomargarido
Hi zoigl.

Just a quick update. I've built the trunk code and tested my application again, but it's still not working. My code is as simple as this:

Code: Select all

<pe:switch id="actionWindow" value="#{chartViewBean.action}">
	<pe:defaultCase />

	<pe:case value="CUSTOMIZE">
		<p:commandLink action="#{chartViewBean.setAction('YADDAYADDA')}" process="@this" update="actionWindow">LINK 1</p:commandLink>
	</pe:case>
</pe:switch>

<p:commandLink action="#{chartViewBean.setAction('YADDAYADDA')}" process="@this" update="actionWindow">LINK 2</p:commandLink>
Link 1 doesn't work, link 2 works as expected. Any suggestions?
Thanks

Re: Nested pe:switch

Posted: 09 Oct 2012, 14:30
by tandraschko
Please check the trunk showcase, i added exmaples for this. #{chartViewBean.action} should be View or Session Scoped ofc. Also be sure that you use the right jar! (0.6.1-SNAPSHOT) in your app.