Question

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") ?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top