tamseo,
Let me amend my last message. I can use <t:label> in the form as long as
its not a child of the <t:radiogroup> component!
It's also important to note that my label components fail to find the
component indicated in the for attribute, unless that component declares
its id in the t: namespace. So, <t:radio id="reg-agent"/> will not work,
but <t:radio t:id="reg-agent"/> will.
I think if you remove the label component your code will work.
Yeah, removing the label component works, but I should be able to use it
shouldn't I?
or add "label" attribute for Radio like this
<t:Label for="reg-agent"/>
<t:Radio id="reg-agent" type="radio" value="listerType" label="xxx" />
I tried this and it still doesn't work!
in my opinion we can't use Label like this <t:Label
for="reg-agent">Type</t:Label>
You're right here - the label component does not render its body.
Here is what my template looks like now:
<t:form t:id="register">
<t:radiogroup t:value="listerType" t:encoder="stringEncoder">
<t:label for="reg-agent"/> <!-- label with in RadioGroup
causes error! -->
<t:radio t:id="reg-agent" value="listerType" label="the label"/>
<t:radio t:id="reg-fsbo" value="listerType"/>
</t:radiogroup>
<t:textfield t:id="text" value="literal:can't submit literals"/>
<t:submit value="Login"/>
</t:form>
Chris Lewis wrote:
Hello,
I'm trying to get a simple form with some radio buttons and labels
working, without success. Following is the source for my Login page
template and class. Note that the page is rendering in a layout
component.
Login.html:
<div t:type="layouts/General"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<t:Form>
<t:RadioGroup value="listerType" encoder="stringEncoder">
<t:Label for="reg-agent">Type</t:Label>
<t:Radio id="reg-agent" type="radio" value="listerType"/>
<t:Radio id="reg-fsbo" type="radio" value="listerType"/>
</t:RadioGroup>
</t:Form>
</div>
Login.java
public class Login {
public static final String AGENT_LISTER="AGENT";
public static final String AGENT_FSBO="FSBO";
private String listerType = AGENT_LISTER;
private StringValueEncoder stringEncoder = new StringValueEncoder();
/**
* @return the listerType
*/
public String getListerType() {
return listerType;
}
/**
* @param listerType the listerType to set
*/
public void setListerType(String listerType) {
this.listerType = listerType;
}
/**
* @return the stringEncoder
*/
public StringValueEncoder getStringEncoder() {
return stringEncoder;
}
}
When I visit the page I am greeted with a "Failure reading parameter
for of component listers/Login:label: Component listers/Login does not
contain an embedded component with id 'reg-agent'." exception, but
there is a component with id reg-agent!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]