This discussion is archived
8 Replies Latest reply: Jan 15, 2013 7:42 AM by Timo Hahn RSS

navigating using go link

adf009 Explorer
Currently Being Moderated
hi i have a situation where i what to navigate from one page to another using golink,e.g i got dept list on the table in one screen and the golink in a column,i what to click the golink and navigate to next page whith employees related to that department,for example if i click golink next to department IT WHEN I GO TO NEXT PAGE I MUST SEE ALL EMPLOYEE in department IT AM in jdeveloper 11.1.1.6.0
my task flow is
<?xml version="1.0" encoding="windows-1252" ?>
<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
  <task-flow-definition id="EMPtask-flow-definition">
    <default-activity id="__1">dept</default-activity>
    <view id="dept">
      <page>/dept.jsff</page>
    </view>
    <view id="emp">
      <page>/emp.jsff</page>
    </view>
    <control-flow-rule id="__2">
      <from-activity-id id="__3">dept</from-activity-id>
      <control-flow-case id="__4">
        <from-outcome id="__6">goemp</from-outcome>
        <to-activity-id id="__5">emp</to-activity-id>
      </control-flow-case>
    </control-flow-rule>
    <control-flow-rule id="__7">
      <from-activity-id id="__8">emp</from-activity-id>
      <control-flow-case id="__9">
        <from-outcome id="__11">back</from-outcome>
        <to-activity-id id="__10">dept</to-activity-id>
      </control-flow-case>
    </control-flow-rule>
    <use-page-fragments/>
  </task-flow-definition>
</adfc-config>

<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
          xmlns:f="http://java.sun.com/jsf/core">
  <af:panelCollection id="pc1">
    <f:facet name="menus"/>
    <f:facet name="toolbar"/>
    <f:facet name="statusbar"/>
    <af:table value="#{bindings.DepartmentVO2.collectionModel}" var="row"
              rows="#{bindings.DepartmentVO2.rangeSize}"
              emptyText="#{bindings.DepartmentVO2.viewable ? 'No data to display.' : 'Access Denied.'}"
              fetchSize="#{bindings.DepartmentVO2.rangeSize}"
              rowBandingInterval="0" id="t1">
      <af:column sortProperty="DepartmentName" sortable="false"
                 headerText="#{bindings.DepartmentVO2.hints.DepartmentName.label}"
                 id="c1">
        <af:inputText value="#{row.bindings.DepartmentName.inputValue}"
                      label="#{bindings.DepartmentVO2.hints.DepartmentName.label}"
                      required="#{bindings.DepartmentVO2.hints.DepartmentName.mandatory}"
                      columns="#{bindings.DepartmentVO2.hints.DepartmentName.displayWidth}"
                      maximumLength="#{bindings.DepartmentVO2.hints.DepartmentName.precision}"
                      shortDesc="#{bindings.DepartmentVO2.hints.DepartmentName.tooltip}"
                      id="it1">
          <f:validator binding="#{row.bindings.DepartmentName.validator}"/>
        </af:inputText>
      </af:column>
      <af:column id="c2">
        <af:goLink text="Edit" id="gl1"/>
        <af:commandButton text="test" id="cb1" action="goemp"/>
      </af:column>
    </af:table>
  </af:panelCollection>
</jsp:root>


<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
          xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
          xmlns:f="http://java.sun.com/jsf/core">
  <af:panelCollection id="pc1">
    <f:facet name="menus"/>
    <f:facet name="toolbar">
      <af:toolbar id="t2">
        <af:commandButton text="back" id="cb1" action="back"/>
      </af:toolbar>
    </f:facet>
    <f:facet name="statusbar"/>
    <af:table value="#{bindings.EmployeesVO2.collectionModel}" var="row"
              rows="#{bindings.EmployeesVO2.rangeSize}"
              emptyText="#{bindings.EmployeesVO2.viewable ? 'No data to display.' : 'Access Denied.'}"
              fetchSize="#{bindings.EmployeesVO2.rangeSize}"
              rowBandingInterval="0" id="t1">
      <af:column sortProperty="FirstName" sortable="false"
                 headerText="#{bindings.EmployeesVO2.hints.FirstName.label}"
                 id="c6">
        <af:inputText value="#{row.bindings.FirstName.inputValue}"
                      label="#{bindings.EmployeesVO2.hints.FirstName.label}"
                      required="#{bindings.EmployeesVO2.hints.FirstName.mandatory}"
                      columns="#{bindings.EmployeesVO2.hints.FirstName.displayWidth}"
                      maximumLength="#{bindings.EmployeesVO2.hints.FirstName.precision}"
                      shortDesc="#{bindings.EmployeesVO2.hints.FirstName.tooltip}"
                      id="it6">
          <f:validator binding="#{row.bindings.FirstName.validator}"/>
        </af:inputText>
      </af:column>
      <af:column sortProperty="LastName" sortable="false"
                 headerText="#{bindings.EmployeesVO2.hints.LastName.label}"
                 id="c7">
        <af:inputText value="#{row.bindings.LastName.inputValue}"
                      label="#{bindings.EmployeesVO2.hints.LastName.label}"
                      required="#{bindings.EmployeesVO2.hints.LastName.mandatory}"
                      columns="#{bindings.EmployeesVO2.hints.LastName.displayWidth}"
                      maximumLength="#{bindings.EmployeesVO2.hints.LastName.precision}"
                      shortDesc="#{bindings.EmployeesVO2.hints.LastName.tooltip}"
                      id="it3">
          <f:validator binding="#{row.bindings.LastName.validator}"/>
        </af:inputText>
      </af:column>
      <af:column sortProperty="CommissionPct" sortable="false"
                 headerText="#{bindings.EmployeesVO2.hints.CommissionPct.label}"
                 id="c4">
        <af:inputText value="#{row.bindings.CommissionPct.inputValue}"
                      label="#{bindings.EmployeesVO2.hints.CommissionPct.label}"
                      required="#{bindings.EmployeesVO2.hints.CommissionPct.mandatory}"
                      columns="#{bindings.EmployeesVO2.hints.CommissionPct.displayWidth}"
                      maximumLength="#{bindings.EmployeesVO2.hints.CommissionPct.precision}"
                      shortDesc="#{bindings.EmployeesVO2.hints.CommissionPct.tooltip}"
                      id="it1">
          <f:validator binding="#{row.bindings.CommissionPct.validator}"/>
          <af:convertNumber groupingUsed="false"
                            pattern="#{bindings.EmployeesVO2.hints.CommissionPct.format}"/>
        </af:inputText>
      </af:column>
      <af:column sortProperty="Email" sortable="false"
                 headerText="#{bindings.EmployeesVO2.hints.Email.label}"
                 id="c5">
        <af:inputText value="#{row.bindings.Email.inputValue}"
                      label="#{bindings.EmployeesVO2.hints.Email.label}"
                      required="#{bindings.EmployeesVO2.hints.Email.mandatory}"
                      columns="#{bindings.EmployeesVO2.hints.Email.displayWidth}"
                      maximumLength="#{bindings.EmployeesVO2.hints.Email.precision}"
                      shortDesc="#{bindings.EmployeesVO2.hints.Email.tooltip}"
                      id="it2">
          <f:validator binding="#{row.bindings.Email.validator}"/>
        </af:inputText>
      </af:column>
      <af:column sortProperty="HireDate" sortable="false"
                 headerText="#{bindings.EmployeesVO2.hints.HireDate.label}"
                 id="c3">
        <af:inputDate value="#{row.bindings.HireDate.inputValue}"
                      label="#{bindings.EmployeesVO2.hints.HireDate.label}"
                      required="#{bindings.EmployeesVO2.hints.HireDate.mandatory}"
                      shortDesc="#{bindings.EmployeesVO2.hints.HireDate.tooltip}"
                      id="id1">
          <f:validator binding="#{row.bindings.HireDate.validator}"/>
          <af:convertDateTime pattern="#{bindings.EmployeesVO2.hints.HireDate.format}"/>
        </af:inputDate>
      </af:column>
      <af:column sortProperty="PhoneNumber" sortable="false"
                 headerText="#{bindings.EmployeesVO2.hints.PhoneNumber.label}"
                 id="c2">
        <af:inputText value="#{row.bindings.PhoneNumber.inputValue}"
                      label="#{bindings.EmployeesVO2.hints.PhoneNumber.label}"
                      required="#{bindings.EmployeesVO2.hints.PhoneNumber.mandatory}"
                      columns="#{bindings.EmployeesVO2.hints.PhoneNumber.displayWidth}"
                      maximumLength="#{bindings.EmployeesVO2.hints.PhoneNumber.precision}"
                      shortDesc="#{bindings.EmployeesVO2.hints.PhoneNumber.tooltip}"
                      id="it5">
          <f:validator binding="#{row.bindings.PhoneNumber.validator}"/>
        </af:inputText>
      </af:column>
      <af:column sortProperty="Salary" sortable="false"
                 headerText="#{bindings.EmployeesVO2.hints.Salary.label}"
                 id="c1">
        <af:inputText value="#{row.bindings.Salary.inputValue}"
                      label="#{bindings.EmployeesVO2.hints.Salary.label}"
                      required="#{bindings.EmployeesVO2.hints.Salary.mandatory}"
                      columns="#{bindings.EmployeesVO2.hints.Salary.displayWidth}"
                      maximumLength="#{bindings.EmployeesVO2.hints.Salary.precision}"
                      shortDesc="#{bindings.EmployeesVO2.hints.Salary.tooltip}"
                      id="it4">
          <f:validator binding="#{row.bindings.Salary.validator}"/>
          <af:convertNumber groupingUsed="false"
                            pattern="#{bindings.EmployeesVO2.hints.Salary.format}"/>
        </af:inputText>
      </af:column>
    </af:table>
  </af:panelCollection>
</jsp:root>
  • 1. Re: navigating using go link
    Timo Hahn Oracle ACE
    Currently Being Moderated
    Adf0994,
    Again a thread of yours where we have to do the work, including finding out what went wrong with your code.
    Add long as you don't provide more info where your problem is we can't help.

    Timo
  • 2. Re: navigating using go link
    codigoadf Oracle ACE
    Currently Being Moderated
    Hi,
    check this thread {thread:id=2485024}
  • 3. Re: navigating using go link
    adf009 Explorer
    Currently Being Moderated
    hi timo my use case is i have two views dept and employees,they are both in two diffirent jsf page,this is what i what,the first jsf page list depatment name with column having a golink button which i need to click it and able to navigate to next page which got employees tables,i what to click the go link button and able to navigate to employes page and list those employees belong to that depat i click in depat page golink i click
    when i click this golink i must navigate to emppoyees page for thos employee belong to that dept i click
    <af:goLink text="Edit" id="gl1"/>
    
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:f="http://java.sun.com/jsf/core">
      <af:panelCollection id="pc1">
        <f:facet name="menus"/>
        <f:facet name="toolbar"/>
        <f:facet name="statusbar"/>
        <af:table value="#{bindings.DepartmentVO2.collectionModel}" var="row"
                  rows="#{bindings.DepartmentVO2.rangeSize}"
                  emptyText="#{bindings.DepartmentVO2.viewable ? 'No data to display.' : 'Access Denied.'}"
                  fetchSize="#{bindings.DepartmentVO2.rangeSize}"
                  rowBandingInterval="0" id="t1">
          <af:column sortProperty="DepartmentName" sortable="false"
                     headerText="#{bindings.DepartmentVO2.hints.DepartmentName.label}"
                     id="c1">
            <af:inputText value="#{row.bindings.DepartmentName.inputValue}"
                          label="#{bindings.DepartmentVO2.hints.DepartmentName.label}"
                          required="#{bindings.DepartmentVO2.hints.DepartmentName.mandatory}"
                          columns="#{bindings.DepartmentVO2.hints.DepartmentName.displayWidth}"
                          maximumLength="#{bindings.DepartmentVO2.hints.DepartmentName.precision}"
                          shortDesc="#{bindings.DepartmentVO2.hints.DepartmentName.tooltip}"
                          id="it1">
              <f:validator binding="#{row.bindings.DepartmentName.validator}"/>
            </af:inputText>
          </af:column>
          <af:column id="c2">
            <af:goLink text="Edit" id="gl1"/>
            <af:commandButton text="test" id="cb1" action="goemp"/>
          </af:column>
        </af:table>
      </af:panelCollection>
    </jsp:root>
  • 4. Re: navigating using go link
    Timo Hahn Oracle ACE
    Currently Being Moderated
    adf0994,
    if you want to navigate to an other page you should use a af:link instead of the af:goLink. the af:goLink is used to open new browser window (or tab) and your use case did not mention this.
    Then your data model should have a relationship between the department and the employee tables (via the dep.id=emp.did). In your model project the model should look like this image http://tompeez.files.wordpress.com/2011/12/blogcascadingtable-001-oracle-jdeveloper-11g-release-2-blogcascadingtable-jws--bctmodel-jpr--q__applications_blogcascadingtable_bctmodel_src_de_hahn_blog_ct_model_facade_bctappmodule.jpg?w=300&h=103 which I extracted from my blog http://tompeez.wordpress.com/2011/12/29/jdeveloper-11-1-2-1-cascading-tables/
    The rest is a no brainer as you only have to select the department on the first page (which will set up the relationship). Then you navigate to the next page by just using a normal navigation rule from page dep to page emp. On the emp page you drag the the EmployeeView3 (in my image) to the page and drop it as af:table. That should do it.

    Timo
  • 5. Re: navigating using go link
    adf009 Explorer
    Currently Being Moderated
    di you mean
    <af:commandLink text="edit" id="cl1"/>
    
    am not able to see af:link am in jdeveloper 11.1.1.6.0 i can only see go image link,go link under common components
    
    i don't just what to navigate to employee jsf page ,i what to see the employee of the department i selecte in first page
    
    like this
    <af:commandButton text="edit" id="cb1" action="goemp"
                              actionListener="#{pageFlowScope.navigatebean.navemp}"
                              binding="#{navigatebean.checknav}"/>
    
    
        public void navemp(ActionEvent actionEvent) {
            // Add event code here...
            ControllerContext ccontext = ControllerContext.getInstance();
            //set the viewId - the name of the view activity to
            //go to - to display
            String viewId = "emp";
            ccontext.getCurrentViewPort().setViewId(viewId);
        }
    currently when i navigate i see all employees for all deprtment,i only what to see employee for the department i select
    Edited by: adf0994 on 2013/01/14 5:07 PM

    Edited by: adf0994 on 2013/01/14 5:08 PM
  • 6. Re: navigating using go link
    Timo Hahn Oracle ACE
    Currently Being Moderated
    Half of it,yes.

    I meant a af:commandLink. That all. remove your actionListener, remove it from the bean and from the component. The action property of the component should do the navigation. All you need for this is a navigation case in the task-Flow (e.g. adcf-config.xml) or any bounded task flow definition you use. In your code it's called 'goemp':
    <af:commandLink text="edit" id="cb1" action="goemp"/>
    should do.

    Timo
  • 7. Re: navigating using go link
    adf009 Explorer
    Currently Being Moderated
    hi timo am able to navigate to next page using <af:commandLink but my problem is i what to see only those employees of the dept i select in my first page selection,i don't what to see all employees as is currently doing,i try to do this
    <af:commandLink text="edit" id="cl1" action="goemp"
                            actionListener="#{pageFlowScope.navigatebean.navemp}"/>
    
        public void navemp(ActionEvent actionEvent) {
            // Add event code here...
            ControllerContext ccontext = ControllerContext.getInstance();
            //set the viewId - the name of the view activity to
            //go to - to display
            String viewId = "emp";
            ccontext.getCurrentViewPort().setViewId(viewId);
        }
  • 8. Re: navigating using go link
    Timo Hahn Oracle ACE
    Currently Being Moderated
    Well, if the dat amodel behind this is setup in a way I showed you inthe other post (the image) and you did as I told you (the drag and drop of the vo onto the page) it should run out of the box.

    As you still have the action event in your code, you did not as I told you and I can't help you any further.

    Try this out creating a fresh fusion web applictaion using the HR schema and add just the two needed pages to the adfc-config.xml. Set the navigation from P1 to P2. In the model you create a daoa model liek shown here http://tompeez.wordpress.com/2011/12/29/jdeveloper-11-1-2-1-cascading-tables/
    Then drag the DepartmentsView1 onto the frist page as adf table (read only) with single selection. Change the one column to a af:commandLink and add the navigation to the second page to it. On the sewcond page drag the EmployeesView3 onto hte page and drop is as adf form.
    That 's it.

    Timo

Legend

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