Re: T5: radio, label

2007-08-16 Thread Nick Westgate

The problem is actually in the Radio component.
Copy its source to make your own component and apply these changes:
https://issues.apache.org/jira/browse/TAPESTRY-1709

Cheers,
Nick.


Chris Lewis wrote:

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!



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: radio, label

2007-08-16 Thread Chris Lewis
Nick, thanks for pointing that out and I'm glad to see its a known issue 
(hopefully that means a fix is coming). Thanks for your solution, but 
I'd rather just use the raw label tag. I'm not entirely sure what the 
benefit of using the the label component is to be honest, but it was one 
of those thing where I felt like I had to understand what was happening 
(I'm new to tap).

Thanks again!

chris

Nick Westgate wrote:

The problem is actually in the Radio component.
Copy its source to make your own component and apply these changes:
https://issues.apache.org/jira/browse/TAPESTRY-1709

Cheers,
Nick.


Chris Lewis wrote:

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!



-
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]



Re: T5: radio, label

2007-08-16 Thread Nick Westgate (Work)

You're welcome.
It wasn't a known issue before you found it. I just debugged and logged it.

The benefits of using the label component are:
- DRY: a component declares its label once, and the Label refers to it
- validation decoration of the resulting label

Cheers,
Nick.



Chris Lewis-5 wrote:
 
 Nick, thanks for pointing that out and I'm glad to see its a known issue 
 (hopefully that means a fix is coming). Thanks for your solution, but 
 I'd rather just use the raw label tag. I'm not entirely sure what the 
 benefit of using the the label component is to be honest, but it was one 
 of those thing where I felt like I had to understand what was happening 
 (I'm new to tap).
 Thanks again!
 
 chris
 
 Nick Westgate wrote:
 The problem is actually in the Radio component.
 Copy its source to make your own component and apply these changes:
 https://issues.apache.org/jira/browse/TAPESTRY-1709

 Cheers,
 Nick.


 Chris Lewis wrote:
 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!


 -
 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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-radio%2C-label-tf4276314.html#a12183202
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



T5: radio, label

2007-08-15 Thread Chris Lewis

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-agentType/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]



Re: T5: radio, label

2007-08-15 Thread Chris Lewis
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-agentType/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]



Re: T5: radio, label

2007-08-15 Thread tamseo

Hi Chris!

I think if you remove the label component your code will work.

or add label attribute for Radio like this

t:Label for=reg-agent/
t:Radio id=reg-agent type=radio value=listerType label=xxx /

in my opinion we can't use Label like this t:Label
for=reg-agentType/t:Label



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-agentType/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]




-- 
View this message in context: 
http://www.nabble.com/T5%3A-radio%2C-label-tf4276314.html#a12174382
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: radio, label

2007-08-15 Thread Chris Lewis

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-agentType/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-agentType/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]




  




Re: T5: radio, label

2007-08-15 Thread tamseo

Chris !

I followed RadioDemo test in T5 source, and i'm in the same situation with
you.
Now I'using  HTML label and waiting for answer from T5 experienced user.



-- 
View this message in context: 
http://www.nabble.com/T5%3A-radio%2C-label-tf4276314.html#a12174593
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: radio, label

2007-08-15 Thread Chris Lewis

tamseo,

I didn't see RadioDemo, so thanks for pointing that out! Have you run it 
and does it work? The only difference from my example I can see is that 
the radio and label components are rendered in a child loop of the 
containing radio group, but that shouldn't make a difference.


tamseo wrote:

Chris !

I followed RadioDemo test in T5 source, and i'm in the same situation with
you.
Now I'using  HTML label and waiting for answer from T5 experienced user.



  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: radio, label

2007-08-15 Thread tamseo

This is my simple example, I craeted it just to check how to use Radio 

html:

div t:type=form
div t:type=radiogroup t:id=nameoption
  div t:type=radio t:id=radio1 t:value=name1
/label${name1}/label
  br/
 div t:type=radio t:id=radio2
t:value=name2/label${name2}/label
/div 
p
  input type=submit value=Select/
  /p
/div

  div t:type=if t:test=nameoption
  ${nameoption} has been selected
  /div


Page class

@Persist
private String nameoption;
private String name1 = Option1;
private String name2 = Option2;

 i ignore setter and getter here.
-- 
View this message in context: 
http://www.nabble.com/T5%3A-radio%2C-label-tf4276314.html#a12174779
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]