This discussion is archived
10 Replies Latest reply: Jun 17, 2013 12:54 AM by Arunkumar Ramamoorthy RSS

How to show bounded taskflow contains fragment as a pop up

user10977928 Newbie
Currently Being Moderated

Hi All,

 

     Is there any way to show a bounded task flow containing fragments as pop up.

     I know if the bounded task flow contain .jspx page then we can show that task flow as a pop up or we can use pop up component and then us dialog to show the pop up.

     But in several fusion application pages I noticed the that bounded task flows contain fragments shows as a pop up.

 

    How can i achieve this functionality ?

 

    Thanks in advance.

  • 1. Re: How to show bounded taskflow contains fragment as a pop up
    Shay Shmeltzer Employee ACE
    Currently Being Moderated

    add an af:popup component to your page and then drop the taskflow you want into that.

  • 2. Re: How to show bounded taskflow contains fragment as a pop up
    Cvele_new_account Expert
    Currently Being Moderated

    after adding af:popup to your page, set following popup properties:

    ContentDelivery: lazyUncached

    ChildCreation: deferred

    PopupFetchListener: you need a way to activate (= start) TF that you put in the popup.
    This can be achieved in several ways, what I usually do, is to put a some flag in the pageFlowScope of the calling taskFlow. For example, here is my popupFetchListener:


    [code]

    public void myPopupFetchListener(PopupFetchEvent popupFetchEvent){

        Map pageFlowScope = ADFContext.getCurrent().getPageFlowScope();

        pageFlowScope.put("popupTFActive", "true");

    }

    [/code]

     

    Then, drag&drop you taskFlow as a (static) Region to the popup.

    After that, you will find taskFlow binding in the pageDef. Adjust following properties as follows:

     

    Refresh: ifNeeded

    activation: conditional

    active : remember PopupFetchListener above ? Here we specify a condition under which the TF is active. So, you can tell, according to the popupFetchListener, the following:


    #{pageFlowScope.popupTFActive eq true}

     

    Of course, you need a way to de-activate TF also, when popup closed. This can be achieved by using

     

    [code]

    public void serverPopupClosedMetod(ClientEvent event){

         ADFContext.getCurrent().getPageFlowScope().put("popupTFActive", "false");

    }

    [/code]

     

    Just use that metod as a af:serverListener's 'method' property. So, what you need on the popup,is a

            <af:clientListener type="popupClosed" method="popupClosedListener"/>

    <af:serverListener type="serverPopupClosed"

                                   method="#{yourBackingBean.serverPopupClosedMetod}"/>

    And, - that's it ;-)

  • 3. Re: How to show bounded taskflow contains fragment as a pop up
    user10977928 Newbie
    Currently Being Moderated

    Hi,

    Thanks you so much for your quick reply.

      I have tried your solution but at the time drag&drop bounded the taskFlow contains only fragments as a (static) Region to the popup the IDE giving the below  error.

    "Cannot create a region from a task flow containing facelets fragments in a jspx page".

     

    Here is my main.jspx page

    <?xml version='1.0' encoding='UTF-8'?>

    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"

              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">

        <jsp:directive.page contentType="text/html;charset=UTF-8"/>

        <f:view>

            <af:document title="mainpage.jspx" id="d1" binding="#{backingBeanScope.backing_mainpage.d1}">

                <af:form id="f1" binding="#{backingBeanScope.backing_mainpage.f1}">

                    <af:panelStretchLayout id="psl1" binding="#{backingBeanScope.backing_mainpage.psl1}">

                        <f:facet name="center">

                            <af:panelBox text="PanelBox1" id="pb1" binding="#{backingBeanScope.backing_mainpage.pb1}">

                                <f:facet name="toolbar">

                                    <af:toolbar id="t1" binding="#{backingBeanScope.backing_mainpage.t1}"/>

                                </f:facet>

                                <af:panelGroupLayout id="pgl1" binding="#{backingBeanScope.backing_mainpage.pgl1}"

                                                     inlineStyle="height:30px; width:143px;">

                                    <af:popup childCreation="deferred" autoCancel="disabled" id="p1"

                                              binding="#{backingBeanScope.backing_mainpage.p1}"

                                              contentDelivery="lazyUncached"

                                              popupFetchListener="#{popupfetchlsntr.myPopupFetchListener}"/>

                                    <af:commandButton text="commandButton 1" id="cb1"

                                                      binding="#{backingBeanScope.backing_mainpage.cb1}" action="GoToEmp"/>

                                </af:panelGroupLayout>

                            </af:panelBox>

                            <!-- id="af_one_column_stretched"   -->

                        </f:facet>

                    </af:panelStretchLayout>

                </af:form>

            </af:document>

        </f:view>

        <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_mainpage-->

    </jsp:root>

     

     

    Bounded task flow

    <?xml version="1.0" encoding="windows-1252" ?>

    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">

      <task-flow-definition id="btfemp">

        <default-activity>employeefragment</default-activity>

        <view id="employeefragment">

          <page>/employeefragment.jsff</page>

        </view>

        <use-page-fragments/>

      </task-flow-definition>

    </adfc-config>

     

     

    Could you please help me what is wrong here ?

    Thanks in advance.

  • 4. Re: How to show bounded taskflow contains fragment as a pop up
    user10977928 Newbie
    Currently Being Moderated

    Hi Shay,

      Thanks for your reply.

      I am using JDEV11.1.2.1 version and  when i tried to drag the task flow getting the below error

    "Cannot create a region from a task flow containing facelets fragments in a jspx page".

     

    Here is my main.jspx page

    <?xml version='1.0' encoding='UTF-8'?>

    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"

              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">

        <jsp:directive.page contentType="text/html;charset=UTF-8"/>

        <f:view>

            <af:document title="mainpage.jspx" id="d1" binding="#{backingBeanScope.backing_mainpage.d1}">

                <af:form id="f1" binding="#{backingBeanScope.backing_mainpage.f1}">

                    <af:panelStretchLayout id="psl1" binding="#{backingBeanScope.backing_mainpage.psl1}">

                        <f:facet name="center">

                            <af:panelBox text="PanelBox1" id="pb1" binding="#{backingBeanScope.backing_mainpage.pb1}">

                                <f:facet name="toolbar">

                                    <af:toolbar id="t1" binding="#{backingBeanScope.backing_mainpage.t1}"/>

                                </f:facet>

                                <af:panelGroupLayout id="pgl1" binding="#{backingBeanScope.backing_mainpage.pgl1}"

                                                     inlineStyle="height:30px; width:143px;">

                                    <af:popup childCreation="deferred" autoCancel="disabled" id="p1"

                                              binding="#{backingBeanScope.backing_mainpage.p1}"

                                              contentDelivery="lazyUncached"

                                              popupFetchListener="#{popupfetchlsntr.myPopupFetchListener}"/>

                                    <af:commandButton text="commandButton 1" id="cb1"

                                                      binding="#{backingBeanScope.backing_mainpage.cb1}" action="GoToEmp"/>

                                </af:panelGroupLayout>

                            </af:panelBox>

                            <!-- id="af_one_column_stretched"   -->

                        </f:facet>

                    </af:panelStretchLayout>

                </af:form>

            </af:document>

        </f:view>

        <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_mainpage-->

    </jsp:root>

     

     

    Bounded task flow

    <?xml version="1.0" encoding="windows-1252" ?>

    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">

      <task-flow-definition id="btfemp">

        <default-activity>employeefragment</default-activity>

        <view id="employeefragment">

          <page>/employeefragment.jsff</page>

        </view>

        <use-page-fragments/>

      </task-flow-definition>

    </adfc-config>

     

     

    Could you please help me what is wrong here ?

    Thanks in advance.

  • 5. Re: How to show bounded taskflow contains fragment as a pop up
    user10977928 Newbie
    Currently Being Moderated

    Hi ,

      I am using JDEV 11.1.2.1 version and the bounded task flow working fine as pop up in a .jsf page but when i tried to apply on .jspx page as per your solution

      I am facing the below error "Cannot create a region from a task flow containing facelets fragments in a jspx page".

      So can we show the bounded task flow contain fragments as a pop up in a .jspx page ?

  • 6. Re: How to show bounded taskflow contains fragment as a pop up
    user10977928 Newbie
    Currently Being Moderated

    Below is my .jsf page and it's working fine

    <?xml version='1.0' encoding='UTF-8'?>

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

    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">

        <af:document title="untitled1.jsf" id="d1">

            <af:form id="f1">

                <af:pageTemplate viewId="/oracle/templates/threeColumnTemplate.jspx" id="pt1">

                    <f:facet name="center">

                        <af:popup childCreation="deferred" autoCancel="disabled" id="p1">

                            <af:panelWindow id="pw1">

                                <af:region value="#{bindings.btfemp1.regionModel}" id="r1"/>

                            </af:panelWindow>

                        </af:popup>

                    </f:facet>

                    <f:facet name="header"/>

                    <f:facet name="end"/>

                    <f:facet name="start">

                        <af:group id="g1">

                            <af:panelGroupLayout id="pgl1">

                                <af:commandButton text="Show PopUp" id="cb1" partialSubmit="true" immediate="true">

                                    <af:showPopupBehavior popupId="p1" triggerType="action"/>

                                </af:commandButton>

                            </af:panelGroupLayout>

                        </af:group>

                    </f:facet>

                    <f:facet name="branding"/>

                    <f:facet name="copyright"/>

                    <f:facet name="status"/>

                </af:pageTemplate>

            </af:form>

        </af:document>

    </f:view>

  • 7. Re: How to show bounded taskflow contains fragment as a pop up
    Cvele_new_account Expert
    Currently Being Moderated

    So, in the same application you have .jspx AND .jsf pages ?

    And you tried to add facelet to a non- facelet pages ?


    I am totally confused...

  • 8. Re: How to show bounded taskflow contains fragment as a pop up
    user10977928 Newbie
    Currently Being Moderated

        I have an application which contains one .jspx page and one .jsff page. I have created one bonded task flow which hold the .jsff page.

        I added one button in .jspx page and Now from a button action i want to show the bounded task flow as a pop up.

        So, my question is can I show the bounded task flow contains fragments as a pop up from a .jspx page?

     

       I have an another application which contains  one .jsf page and one .jsff page. I have created one bonded task flow which hold the .jsff page.

       To show the bounded task flow as a pop up from .jsf page is working fine for me.

  • 9. Re: How to show bounded taskflow contains fragment as a pop up
    Cvele_new_account Expert
    Currently Being Moderated

    So, your fragment TF is built on upon facelets (JSF 2.0 stuff), right, and you are trying to add him as a static region on the (JSF 1.2)  .jspx page ?

     

    You are trying to mix "grandmother and frogs", I am afraid...

  • 10. Re: How to show bounded taskflow contains fragment as a pop up
    Arunkumar Ramamoorthy Guru
    Currently Being Moderated

    Hi,

     

    Convert the facelet fragment to ADF Faces Fragment / recreate the fragment as ADF Faces Fragment and then re-drop it.

     

    -Arun

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points