Search this blog ...

Tuesday, August 17, 2010

ADF11g Add javascript to jspx / trigger javascript onLoad event

<?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">
      <f:facet name="metaContainer">
        <af:group id="g1">
          <af:resource type="javascript">
            function someFunction()
            {
              alert('hello');
            }
          </af:resource>
          <af:resource type="javascript" source="xxx.js"/>
        </af:group>
      </f:facet>
      <af:clientListener method="someFunction" type="load"/>
      <af:form id="f1"> …
      </af:form>
    </af:document>
  </f:view>
</jsp:root>

No comments:

Post a Comment