Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 45

Thread: JSF + Webflow popup question

  1. #31

    Default

    Quote 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

  2. #32

    Default

    Quote 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 at 11:38 PM.

  3. #33

    Default

    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

  4. #34
    Join Date
    Mar 2011
    Location
    Strasbourg,France
    Posts
    24

    Default

    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

  5. #35

    Default

    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

  6. #36
    Join Date
    Mar 2011
    Location
    Strasbourg,France
    Posts
    24

    Default

    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

  7. #37

    Default

    Quote 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

  8. #38
    Join Date
    Mar 2011
    Location
    Strasbourg,France
    Posts
    24

    Default

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

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

  9. #39

    Default

    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

  10. #40
    Join Date
    Mar 2011
    Location
    Strasbourg,France
    Posts
    24

    Default

    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"/> 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •