Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Automatically click a JSF page commandButton after the page loaded

1057523Jun 9 2014 — edited Jun 10 2014

I need to automatically click  the command button "refreshPage" after the JSF page below is loaded: ( having tried the code in Blue commented out I am unlucky. Please help!)

<?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"
          xmlns:pe="http://xmlns.oracle.com/adf/pageeditor"
          xmlns:cust="http://xmlns.oracle.com/adf/faces/customizable">

  <f:loadBundle basename="oracle.webcenter.portalframework.sitestructure.resource.PortalAppPageResource"
                var="portalResource"/>
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>      

  <f:view>
 
  <af:document id="d1" title="#{portalResource['home_title']}">
 
<!-- <af:clientListener method="callRefreshButton" type="load"/>            
<af:resource type="javascript">
    function callRefreshButton()
    {
    var buttton = AdfPage.PAGE.findComponentByAbsoluteId("refreshPage");
    ActionEvent.queue(button,true);
    }
</af:resource>  -->
     
       <af:messages id="m1"/> 
      <af:form id="f1">  

        <af:pageTemplate value="#{bindings.pageTemplateBinding.templateModel}" id="pt1"
                         viewId="/oracle/webcenter/portalapp/pagetemplates/pageTemplate_swooshy.jspx">
          <f:attribute name="showNavigation" value="#{true}"/>
          <f:facet name="content">
            <af:group id="g1">        
              <af:inputText label="Label 1" id="it1"/>
            </af:group>
          </f:facet>
        </af:pageTemplate>
       
      <!-- <af:commandLink id="refreshPage" text="refreshPage"                            
                                action="#{WangBean.reloadPage}"
                                rendered="true"
                                inlineStyle="font-size:small; color:White;"
                                partialSubmit="true" clientComponent="true">  
           </af:commandLink> -->
       
        <af:inputText value="#{bindings.Sdan8.inputValue}"
                      columns="#{bindings.Sdan8.hints.displayWidth}"
                      maximumLength="#{bindings.Sdan8.hints.precision}"
                      shortDesc="#{bindings.Sdan8.hints.tooltip}" id="it2"
                      visible="false"
                      inlineStyle="font-size:medium; font-weight:bold;">
          <f:validator binding="#{bindings.Sdan8.validator}"/>
          <af:convertNumber groupingUsed="false"
                            pattern="#{bindings.Sdan8.format}"/>      
        </af:inputText>                 

      </af:form>  

    </af:document>  
  </f:view>
</jsp:root>

This post has been answered by 1057523 on Jun 10 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 8 2014
Added on Jun 9 2014
8 comments
4,221 views