Nested pe:switch

Community Driven Extensions Project
Babas007
Posts: 251
Joined: 24 May 2011, 09:42

04 Oct 2012, 18:59

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

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

04 Oct 2012, 20:00

Should work but you can create an issue and we will have a look at it.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Babas007
Posts: 251
Joined: 24 May 2011, 09:42

04 Oct 2012, 21:31

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

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

04 Oct 2012, 23:48

Fixed the problem with actions. Could you please try it again and also test the nested switch with the trunk version?
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

fabiomargarido
Posts: 10
Joined: 24 Sep 2012, 17:15

08 Oct 2012, 18:44

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.

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

08 Oct 2012, 19:10

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.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

08 Oct 2012, 20:12

I talked with Oleg and we will release a bugfix release next week.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

fabiomargarido
Posts: 10
Joined: 24 Sep 2012, 17:15

08 Oct 2012, 22:42

That would be awesome!

Thanks a lot.

fabiomargarido
Posts: 10
Joined: 24 Sep 2012, 17:15

09 Oct 2012, 14:20

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

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

09 Oct 2012, 14:30

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.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Post Reply

Return to “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests