3 Replies Latest reply: Nov 1, 2013 10:48 AM by MobileADFDev RSS

    onload in ADF Mobile amx pages

    MobileADFDev
      Can someone please help me to use onload method calls in amx pages? I just want to call a Bean class method while the page is getting loaded.
        • 1. Re: onload in ADF Mobile amx pages
          Frank Nimphius-Oracle
          Hi,

          depends on what you use case is to be honest

          1. use the lifecycle listener if it is initialization code that executes in context of a featureload
          2. Use method activity if it is a method that needs to execute before getting to a view (e.g. to prepare querying data)
          3. Try JavaScript if the code needs to execute when the page has loaded

          Frank
          • 2. Re: onload in ADF Mobile amx pages
            MobileADFDev
            Can you please provide some sample code for each of them. I am very new to ADF development.
            • 3. Re: onload in ADF Mobile amx pages
              MobileADFDev

              I was able to use a method call as the first activity in the task flow to make it work.

               

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

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

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

                  <default-activity>getSearchParams</default-activity>

                  <managed-bean id="__5">

                    <managed-bean-name>SearchBean</managed-bean-name>

                    <managed-bean-class>SearchBean</managed-bean-class>

                    <managed-bean-scope>pageFlow</managed-bean-scope>

                  </managed-bean>

                  <view id="Search">

                      <page>/Search.amx</page>

                  </view>

                  <method-call id="getSearchParams">

                    <method>#{pageFlowScope.SearchBean.getSearchParams}</method>

                    <outcome>

                      <fixed-outcome>viewsearchpage</fixed-outcome>

                    </outcome>

                  </method-call>

                  <control-flow-rule id="__10">

                    <from-activity-id>getSearchParams</from-activity-id>

                    <control-flow-case id="__11">

                      <from-outcome>viewsearchpage</from-outcome>

                      <to-activity-id>Search</to-activity-id>

                    </control-flow-case>

                  </control-flow-rule>

                </task-flow-definition>

              </adfc-mobile-config>