13 Replies Latest reply: May 2, 2013 11:31 AM by Frank Nimphius-Oracle RSS

    Anchoring in adf

    1004526
      I have requirement to anchor to specific section of the page.
      I have gone through different threads but none of them have perfect solution.

      I have tried:
      - af:scrollComponentIntoViewBehavior
      reason for not working: doesn't work if it is inside iterator
      - goLink
      reason for not working: server not found, PPR exception
      - a:href
      reason for not working: server not found, PPR exception
      - Jquery
      reason for not working: no perfect code, i tried with classes but #id dont work in adf

      I am using jdev 11.1.6

      Can anyone let me a simple anchoring example which will work ? thanks
        • 1. Re: Anchoring in adf
          Suresh Karunarathne
          HI,
          Check following will useful
          Need help with using anchors in adf.
          • 2. Re: Anchoring in adf
            Frank Nimphius-Oracle
            Hi,


            - af:scrollComponentIntoViewBehavior
            reason for not working: doesn't work if it is inside iterator

            - goLink
            reason for not working: server not found, PPR exception

            Can you provide the page code for the two attempts above?

            Frank
            • 3. Re: Anchoring in adf
              1004526
              Hello Frank,

              For goLink i tried below code which is giving server not found exception which i suppose is error due to PPR as per forums, but there was no answer to fix this PPR error
              <af:panelGroupLayout styleclass="abc">
              <af:goLink id="test" destination="#anchor1"/>
              <af:goLink id="anchor1" destination=""/>
              </af:panelGroupLayout>

              For scrollComponentIntoViewBehavior i tied below code but i suppose it fails as it doesnt work with server-rendered components

              <af:panelGroupLayout styleclass="abc">
              <af:iterator>
              <af:commandButton immediate="true" text="Scroll into view">
              <af:scrollComponentIntoViewBehavior componentid="idInputText" subTargetid="content" focus="true"/>
              </af:commandButton>
              <af:inputText inlineStyle="width: 350px" id="idInputText2" clientComponent="true" Label="String Value with Large Label"/>
              </af:iterator>
              <af:panelGroupLayout styleclass="abc">

              @Suresh,

              I followed that link, but unfortunately it doesn't have solution like many other threads on this topic (anchors in adf).
              • 4. Re: Anchoring in adf
                Timo Hahn
                This works for me:
                <?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:h="http://java.sun.com/jsf/html"
                          xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
                  <jsp:directive.page contentType="text/html;charset=UTF-8"/>
                  <f:view>
                    <af:document id="d1">
                      <af:form id="f1">
                        <af:panelStretchLayout topHeight="50px" id="psl1">
                          <f:facet name="top"/>
                          <f:facet name="center">
                            <af:panelGroupLayout id="pgl1" layout="scroll">
                              <af:goLink text="goLink 1" id="gl1" destination='#anchor1'/>
                              <af:spacer width="10" height="1000" id="s1"/>
                              <af:inputText label="Label 1" id="it1"/>
                              <af:goLink text="goLink 2" id="anchor1"/>
                            </af:panelGroupLayout>
                            <!-- id="af_one_column_header_stretched"  -->
                          </f:facet>
                        </af:panelStretchLayout>
                      </af:form>
                    </af:document>
                  </f:view>
                </jsp:root>
                The anchor does not have a destination! if you specify one you get an error.

                Timo
                • 5. Re: Anchoring in adf
                  1004526
                  I tried to modify code to my requirements but it doesn't work for me yet.. it still gives a server not found exception (error due to PPR as per other threads)

                  test.jsff

                  <?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:dt="http://xmlns.oracle.com/webcenter/content/templates" xmlns:f="http://java.sun.com/jsf/core"
                  xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fn="http://java.sun.com/jsp/jstl/functions"
                  xmlns:pe="http://xmlns.oracle.com/adf/pageeditor">
                  <dt:contentTemplateDef var="node">
                       <af:panelGroupLayout id="pgl5" layout="vertical">
                       <af:goLink text="goLink 1" id="gl1" destination='#anchor1'/>
                  <af:spacer width="10" height="1000" id="s1"/>
                  <af:inputText label="Label 1" id="it1"/>
                  <af:goLink text="goLink 2" id="anchor1"/>
                       </af:panelGroupLayout>
                  </dt:contentTemplateDef>
                  </jsp:root>
                  • 6. Re: Anchoring in adf
                    1004526
                    This below code gives me also the same error.. server not found exception..(error due to PPR as per other threads)
                    Timo Hahn wrote:
                    This works for me:
                    <?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:h="http://java.sun.com/jsf/html"
                    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
                    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
                    <f:view>
                    <af:document id="d1">
                    <af:form id="f1">
                    <af:panelStretchLayout topHeight="50px" id="psl1">
                    <f:facet name="top"/>
                    <f:facet name="center">
                    <af:panelGroupLayout id="pgl1" layout="scroll">
                    <af:goLink text="goLink 1" id="gl1" destination='#anchor1'/>
                    <af:spacer width="10" height="1000" id="s1"/>
                    <af:inputText label="Label 1" id="it1"/>
                    <af:goLink text="goLink 2" id="anchor1"/>
                    </af:panelGroupLayout>
                    <!-- id="af_one_column_header_stretched"  -->
                    </f:facet>
                    </af:panelStretchLayout>
                    </af:form>
                    </af:document>
                    </f:view>
                    </jsp:root>
                    The anchor does not have a destination! if you specify one you get an error.

                    Timo
                    • 7. Re: Anchoring in adf
                      Timo Hahn
                      I tested this again in 11.1.1.6.0 and it works!

                      Have you tried it in a fresh jspx page?

                      Timo
                      • 8. Re: Anchoring in adf
                        1004526
                        Hello Timo,

                        I tried it in fresh jspx page only. But after i click the link, it does scrolling and give me server not found exception.
                        • 9. Re: Anchoring in adf
                          Timo Hahn
                          I used chrome...
                          Which browser do you use?

                          Timo
                          • 10. Re: Anchoring in adf
                            1004526
                            I used chrome as well.
                            • 11. Re: Anchoring in adf
                              Timo Hahn
                              Last thing to try is to create a new fusion web application and test it in there.

                              Timo
                              • 12. Re: Anchoring in adf
                                1004526
                                I have adf webcenter application, is web center a problem ?
                                • 13. Re: Anchoring in adf
                                  Frank Nimphius-Oracle
                                  Hi,

                                  can you try the testcase outside of WebCenter to see if it behaves as it should? If it does then you found the problem with WebCenter. If not then WebCenter is not a problem. I think this is easier to test than discuss

                                  Frank