Announcement Announcement Module
Collapse
No announcement yet.
JSF + Webflow popup question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hi mfb,

    It would be easier to help you if you can put all your configuration files here, btw are you trying to use <p:dialog> or spring web flow pop up?

    Thanks,
    Vijay

    Comment


    • #17
      Hello Vijay,
      at first thank you very much that you try to help me!!

      The xhtml page, on which I try to open the popup looks like this:
      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
      				...
      			        template="templates/template.xhtml">
      			
      	<ui:define name="title">
      		Title Welcome
      	</ui:define>
      
      	<ui:define name="content">
      	
      		<h:form id="form">
      		 	
      		 	<p:commandButton 	 			 		
      		 		action="selectLanguage" 
      		 		process="@form"
      		 		update="form:panelPopupContent"
      		 		oncomplete="popupDialog.show()"
      		 		value="#{label.lbl_select_language}" />  
      
      			<p:dialog id="popupDialog" widgetVar="popupDialog" modal="false">	
      	 			<p:outputPanel id="panelPopupContent" />
      	 		</p:dialog>	 		
      		</h:form>		 
      	</ui:define>	
      </ui:composition>
      The template is only responsible for the layout, so there's nothing special inside.

      The flow which controlls this page looks like this:
      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <flow xmlns="http://www.springframework.org/schema/webflow"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://www.springframework.org/schema/webflow 
              					http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
      
      	<view-state id="welcome" view="/WEB-INF/views/welcome.xhtml">
      		<transition on="selectLanguage" to="subflowSelectLanguage" />
      	</view-state>
      
      	<subflow-state id="subflowSelectLanguage" subflow="language-flow" >
      		<input name="mode" value="'embedded'"/>	
      		<transition on="finish" to="welcome" />
      	</subflow-state>
      	
      	<end-state id="finish" />		
      </flow>
      The subflow which is called when the button is pressed to open the popup (see above):
      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <flow xmlns="http://www.springframework.org/schema/webflow"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://www.springframework.org/schema/webflow 
              					http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
      
      	<view-state id="selectLanguage" view="/WEB-INF/views/language.xhtml">
      		<transition on="selectLang" />
      		<transition on="close" to="finish">
      		</transition>		
      	</view-state>
      		
      	<end-state id="finish" />  		
      </flow>
      Now the xhtml which should be rendered in popup:
      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
      				...		    
      			        template="templates/template.xhtml">
      			    
      	<ui:define name="content">	
      		<h:form id="form">
      		    <p:panel id="panelPopupContent">
      		 	<p:commandButton value="#{label.lbl_lang_german}" action="selectLang" style="clear:both;float:left;" >
      		 	    <f:param name="language" value="DE" />
      		 	</p:commandButton>
      		 	<p:commandButton value="#{label.lbl_lang_english}" action="selectLang" style="clear:both;float:left;" >
      		 	    <f:param name="language" value="EN" />
      		 	</p:commandButton> 	
      		        <p:commandButton value="close" action="close" />
      	            </p:panel>	       
      	 	</h:form>	 	
       	</ui:define> 	
      </ui:composition>
      When I press the button to open the popup, the popup opens and I can see it for a moment, but the content is empty. The content is shown instead my actual browser window. I hope you have any idea??

      Thanks a lot for an answer...

      Comment


      • #18
        Hi, could you try removing your template from the page containg your ajax response like so and perhaps wrapping your panel with an outputPanel with the ID panelPopupContent like so :

        PHP Code:
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
        >

        <
        ui:composition xmlns="http://www.w3.org/1999/xhtml"
            
        xmlns:ui="http://java.sun.com/jsf/facelets"
            
        xmlns:f="http://java.sun.com/jsf/core"
            
        xmlns:h="http://java.sun.com/jsf/html"
            
        xmlns:p="http://primefaces.prime.com.tr/ui"
           
        >
        <
        h:form id="form">
            <
        p:outputPanel id="panelPopupContent">
            <
        p:panel >
                 <
        p:commandButton value="#{label.lbl_lang_german}" 
                                          
        action="selectLang" style="clear:both;float:left;" >
                         <
        f:param name="language" value="DE" />
                 </
        p:commandButton>
                 <
        p:commandButton value="#{label.lbl_lang_english}" 
                                    
        action="selectLang" style="clear:both;float:left;" >
                         <
        f:param name="language" value="EN" />
                 </
        p:commandButton>     
                        <
        p:commandButton value="close" action="close" />
               </
        p:panel>      
              </
        p:outputPanel>     
        </
        h:form>         

        </
        ui:composition

        Comment


        • #19
          Hello ufasoli,
          thank you for your answer, but it's sadly not the solution. I've made the changes you've suggested, but it's still the same behaviour...
          I've send you a mail on thursday, because you've written in the forum "...the problem was the response sent by my subflow, it wasn't well formed once that modified...".
          What do you mean by this?

          Comment


          • #20
            Originally posted by mfb View Post
            Hello ufasoli,
            thank you for your answer, but it's sadly not the solution. I've made the changes you've suggested, but it's still the same behaviour...
            I've send you a mail on thursday, because you've written in the forum "...the problem was the response sent by my subflow, it wasn't well formed once that modified...".
            What do you mean by this?
            Hi there sorry about that I never got that email. What I meant was that the structure of my popup content wasn't the same one as the one on the page calling the popup. Once I changed that one it was OK.

            Your code seems OK now so it's weird you're getting the same behavior. Are you using SWF 2.3.0 and Primefaces 2.2.1?
            Have you tried starting your main flow in embedded mode??

            Comment


            • #21
              Yes, I use SWF 2.3.0 and Primefaces 2.2.1; how can I start the main flow in embedded mode?
              I only know that I have to set an input param for embedded mode of the subflow as shown above...

              Comment


              • #22
                Originally posted by mfb View Post
                Yes, I use SWF 2.3.0 and Primefaces 2.2.1;
                ok
                Originally posted by mfb View Post
                how can I start the main flow in embedded mode?
                you need to pass mode=embedded as a url parameter
                like for example

                PHP Code:

                http
                ://yourapp/myFlow?mode=embedded 

                Comment


                • #23
                  That's great, the popup opens!!! Now I have only the problem that nothing happens,
                  when I press a button on the popup (select language, close popup, ... See code above)
                  Do you have also an idea what can be the problem for this behaviour?

                  Comment


                  • #24
                    Originally posted by mfb View Post
                    That's great, the popup opens!!! Now I have only the problem that nothing happens,
                    when I press a button on the popup (select language, close popup, ... See code above)
                    Do you have also an idea what can be the problem for this behaviour?
                    remove the :

                    PHP Code:
                     <input name="mode" value="'embedded'" /> 
                    when you call your popup

                    Comment


                    • #25
                      I've tested, but that's not the problem. I've seen that there were no "update"- attributes in my p:commandButton- Tags.
                      When I put the "update"- attributes inside it works, but I don't understand the difference between these attributes and
                      the render- Tag in my Webflow?! I think in the swf documentation they say , that render- Tags can still used in combination
                      with jsf 2.0?! Do you know?

                      My next problem is that since I've set the embedded- param by calling the main flow other buttons which are not calling
                      a popup don't still work, nothing happens... For example:
                      Code:
                      		<h:form id="form">
                      		 		 	
                      		 	<p:commandButton value="Page 01" action="goToPage01" />	 	
                      		 	
                      		 	<p:commandButton 	 			 		
                      		 		action="selectLanguage" 
                      		 		process="@form"
                      		 		update="form:panelPopupContent"
                      		 		oncomplete="popupDialog.show()"
                      		 		value="#{label.lbl_select_language}" />  
                      
                      			<p:dialog id="popupDialog" widgetVar="popupDialog" modal="false">	
                      	 			<p:outputPanel id="panelPopupContent" />
                      	 		</p:dialog>	
                      	 		
                      		</h:form>

                      Comment


                      • #26
                        ...if I press the button to go to page 01 nothing happens...

                        Comment


                        • #27
                          Make your commandButtons non ajax like so :

                          PHP Code:
                          <p:commandButton ajax="false" /> 

                          Comment


                          • #28
                            That's fantastic! Now everything works!! I thank you so much, because I spent a lot of time on finding a solution...
                            If you have a problem next time yourself then tell me, I will also try to to help you!

                            With best regards to Strasbourg,
                            Michael

                            Comment


                            • #29
                              My pleasure, glad to see you managed to get it working

                              Comment


                              • #30
                                sure anytime

                                Comment

                                Working...
                                X