Hello,

Try this:

<input t:type="checkbox" value="color1"/>

Tapestry will then assign the value of your checkbox to color1 by calling setColor1() in your java page.

Jayson


Gutemberg A. Da Silva wrote:
Hi guys,

   I have a problem with "RadioButton Component". I have this class:

<!-- Class -->
public class CheckBoxClass {

    @Property
    private final String[] colors = { "Blue", "Red", "Green" };

    @Property
    private String color;

    @Property
    private String teste;

    @Property
    private boolean color1 = false;

    //@BeginRender
    void onPrepare(String id) {
        //color1 = true;

        if (color1) {
            System.out.println("verdade..: " + id);
        } else {
            System.out.println("falso..: " + id);
        }
    }

    void onActivate(String id) {
        System.out.println("++++++++++++++++ " + id);
    }

}


and have this TML:

<!-- TML -->
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

    <head>
        <title>agenda Start Page</title>
    </head>

    <body>
        <form t:type="form" t:id="myForm">
            <table>
            <tr t:type="loop" source="colors" value="color" >
                <td>
                    <t:checkbox
                        controller="colorController"
                        value="${color1}" context="${color}"/> ${color}
                </td>
            </tr>
            <br/>
            <input t:type="submit"/>
            </table>
        </form>
    </body>

</html>

   when I click on Submit, it is shownd this error:

Failure writing parameter 'value' of component CheckBoxClass:checkbox:
Binding
org.apache.tapestry5.internal.services.attributeexpansionbind...@1f68272 is
read-only.
context
eventTypeaction
Can somebody help me in this Class Test with the "RadioButton" component?





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to