收录日期:2021/01/22 02:34:38 时间:2010-04-08 23:36:53 标签:java,tapestry

My form has a custom element like below, created using custom ajax:

<select jwcid="testtest <at> Any">
<option value="x">California -- CA</option>
<option value="y">Colorado -- CO</option>
<option value="z">Connecticut -- CN</option>
</select>

After the form is submitted, how do I get the value of this custom html element?

cycle.getPage().getComponents().get("testtest") ?

If I understand you correctly, you have a form element generated not by Tapestry, but by something else.

First of all, jwcid has no place in your HTML code, it's only used in Tapestry component templates. Second, the select element must have a name attribute or else your browser won't submit it at all:

<select name="name-of-element">
...
</select>

To get the submitted value on the server side, use cycle.getParameter("name-of-element") in your page/component class.