Ok so I learned that the id parameter must be in the t: namespace, so changing the radio component to have 't:id="reg-agent"'. Now I'm greeted with a new exception:

"No object of type org.apache.tapestry.RadioContainer is available from the Environment."

And then it lists several objects in teh environment. What's annoying is that the component ref says that the RadioGroup (or some impl of RadioContainer) must contain radio components, so my code should work. However I looked at the source for RadioGroup, and doesn't implement the RadioContainer interface!! Is this a bug?

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]

Reply via email to