tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jakarta-tapestry Wiki] Update of "TapestryAndApplets" by gabrielh
Date Mon, 24 Oct 2005 20:00:14 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-tapestry Wiki" for change
notification.

The following page has been changed by gabrielh:
http://wiki.apache.org/jakarta-tapestry/TapestryAndApplets

New page:
The HTML:
You want to set the hidden input (called document.appletForm.someData.value) with the applet
method result of document.myApplet.getSomeData().
You want to pass the data back to the applet using the <param> tag, hence the ognl:getAppletParameters()
insert.


{{{
<form jwcid="appletForm@Form">
    <applet name="myApplet" code="Applet.class" archive="somejar.jar" width="310" height="335">
     
      <span jwcid="@Insert" value="ognl:getAppletParameters()" raw="true"/>
    </applet>
    <input type="submit" jwcid="@Submit" listener="ognl:listeners.save" value="Save" onClick="return
getAppletValues()"/>    
    <input jwcid="someData@Hidden" value="ognl:someData"/>  
</form>

<script type="text/javascript">
function getAppletValues() {
   document.appletForm.someData.value = document.myApplet.getSomeData();
   return true;
}
}}}

The applet class:
{{{
 public String getSomeData() { return s; }
 public void setSomeData(String s) { this.s = s; }
}}}

The page java class:
{{{
/**
 * Get the applet parameters.
 * @return Applet parameters
 */
 public String getAppletParameters() {
   return "<param name=\"someData\" value=\"" + getSomeData() + "\">";
 }

}}}


 

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message