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

  • #31
    Originally posted by mfb View Post
    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?
    Well, SWF seamlessly integrates with JSF 2.0, please refer this link ,
    Handling Ajax Events In JSF 2.0

    HTML Code:
    <view-state id="reviewHotels">
        <on-render>
            <evaluate expression="bookingService.findHotels(searchCriteria)" 
                      result="viewScope.hotels" result-type="dataModel" />
        </on-render>
        <transition on="next">
            <evaluate expression="searchCriteria.nextPage()" />
            <render fragments="hotels:searchResultsFragment" />
        </transition>
    </view-state>
    There is no transition to for such a JSF action and it means its ajax request and partial rendering is handled using <render fragments="hotels:searchResultsFragment" /> which declares all those client side id's which need to be re-rendered, quite similar to the update attribute of <p:commandButton>.

    Hope this helps..

    Thanks,
    Vijay

    Comment


    • #32
      Originally posted by ufasoli View Post
      ok

      you need to pass mode=embedded as a url parameter
      like for example

      PHP Code:

      http
      ://yourapp/myFlow?mode=embedded 
      I am using JSF with SWF, hence mostly I use <p:commandButton action="some_state" />, I am not sure how to invoke any flow in embedded mode passing url parameters.

      I know <input> params to all flows are request parameters, is there any other way?

      I have to try this for main flow, currently the example showed the subflow should be called in embedded mode and not the main flow. So I am bit confused here..

      Thanks,
      Vijay
      Last edited by joy192k; May 24th, 2011, 11:38 PM.

      Comment


      • #33
        This works for me <a href="main?mode=embedded">Main flow in embedded mode </a>, is there any JSF+SWF way to do this?

        I mean I would like to call a subflow in embedded mode, what configuration will work for me in the flow definition file??

        Thanks,
        Vijay

        Comment


        • #34
          With a command button :

          PHP Code:

          <p:commandButton action="myAction">
             <
          f:param name="myParam" value="myValue" />
          </
          p:commandButton
          With a command link :

          PHP Code:

          <p:commandLink action="myAction">
             <
          f:param name="myParam" value="myValue" />
          </
          p:commandButton
          you can then access those parameters in the flow definition file through the requestParameters variable for example:

          PHP Code:
           <subflow-state id="myAction" subflow="mySubflow">
                  <
          input name="myParam" value="requestParameters.myParam" />
                
              </
          subflow-state

          Comment


          • #35
            Thanks Ufasoli,

            I tried that.. but

            HTML 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="test">		
            		<transition on="test" to="main-flow" />
            	</view-state>
            
            
            	<subflow-state id="main-flow" subflow="main">
            		<input name="mode" value="'embedded'" />		
            		<transition on="end" to="test" />
            	</subflow-state>
            	
            	<end-state id="finish" />
            
            </flow>
            isn't working.... ???

            Thanks,
            Vijay

            Comment


            • #36
              do you need to go through the webflow navigation ? or you just need a way to output a link in a JSF way?

              If you just need to output a link you can use outputLink

              PHP Code:
              <h:outputLink value="myFlow">
                          <
              h:outputText value="myLink" />
                          
                          <
              f:param name="mode" value="embedded"/>
                     </
              h:outputLink
              this will render :

              PHP Code:

              <a href="myflow?mode=embedded">myLink</a

              Comment


              • #37
                Originally posted by ufasoli View Post
                do you need to go through the webflow navigation ? or you just need a way to output a link in a JSF way?

                If you just need to output a link you can use outputLink

                PHP Code:
                <h:outputLink value="myFlow">
                            <
                h:outputText value="myLink" />
                            
                            <
                f:param name="mode" value="embedded"/>
                       </
                h:outputLink
                this will render :

                PHP Code:

                <a href="myflow?mode=embedded">myLink</a
                Thanks for that quick reply, I saw that this works.. but I was curious to figure out the spring web flow navigation way.

                Thanks,
                Vijay

                Comment


                • #38
                  humm I see have you tried setting your commandButton to not be executed in ajax mode

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

                  Comment


                  • #39
                    PHP Code:
                        <h:form id="form">
                                
                                    
                                    <
                    h:commandLink value="test - doesnt work" action="test">
                                        <
                    f:param name="mode" value="'embedded'"/>
                                    </
                    h:commandLink>
                                        
                                    <
                    a href="main?mode=embedded">test this works</a>
                                    
                            </
                    h:form
                    PHP 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="test">        
                            <transition on="test" to="main-flow" />
                        </view-state>


                        <subflow-state id="main-flow" subflow="main">
                            <input name="mode" value="requestParameters.mode" />        
                            <transition on="end" to="test" />
                        </subflow-state>
                        
                        <end-state id="finish" />

                    </flow>
                    I am just curious this doesn't work why???

                    Thanks,
                    Vijay

                    Comment


                    • #40
                      Was the parent flow started in embedded mode?
                      I think you need to remove the single quotes in your xhtml page change

                      PHP Code:
                       <f:param name="mode" value="'embedded'"/> 
                      into

                      PHP Code:
                       <f:param name="mode" value="embedded"/> 

                      Comment


                      • #41
                        This doesn't work either...

                        PHP Code:
                        <h:commandLink value="test" action="test" ajax="false">
                            <
                        f:param name="mode" value="embedded"/>
                        </
                        h:commandLink
                        No the parent flow wasn't started in embedded mode, main-flow will call another sub-flow.

                        Thanks,
                        Vijay

                        Comment


                        • #42
                          Hummm. Are you trying to open the subflow inside a dialog or something like that? Because if i'm not wrong using embedded to open a subflow is usefull only in thoses cases (ajax + popup).

                          At least this is what I get from reading the Spring webflow documentation :

                          Normally the client-side redirect is transparent from a user's perspective. However, there are situations where POST-REDIRECT-GET may not bring the same benefits. For example sometimes it may be useful to embed a flow on a page and drive it via Ajax requests refreshing only the area of the page where the flow is rendered. Not only is it unnecessary to use client-side redirects in this case, it is also not the desired behavior with regards to keeping the surrounding content of the page intact.
                          Last edited by ufasoli; May 26th, 2011, 07:07 AM. Reason: typo

                          Comment


                          • #43
                            Originally posted by ufasoli View Post
                            Hummm. Are you trying to open the subflow inside a dialog or something like that? Because if i'm not wrong using embedded to open a subflow is usefull only in thoses cases (ajax + popup).
                            Yups, I am looking to create a generic search screen, which would be opened in a dialog, planning to use
                            HTML Code:
                            <p:diaglog>
                            and this generic search would be a sub-flow.

                            Thanks,
                            Vijay

                            Comment


                            • #44
                              Thanks Nicolas.

                              Comment


                              • #45
                                Yes, this is a javascript error. I included the Javascript files as described in the documentation. I checked in Firebug that all the resources are available.
                                http://www.ukcharmsale.com

                                Comment

                                Working...
                                X