You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Benedict <pa...@yahoo.com> on 2006/07/24 06:35:20 UTC

HTML Tags and ID

Do the Struts tags allow the HTML id attribute to be set in its form taglibs? I was hoping to find an htmlId or id attribute but did not see one. Am I correct?

My goal was to accomplish this:
<html:checkbox name="enable" htmlId="enable" /><label for="enable"></label>

The <label> connects to an HTML ID, not a name.

Paul

 		
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1¢/min.

Re: HTML Tags and ID

Posted by Paul Benedict <pa...@yahoo.com>.
Instad of switching tag libraries, I may want to add the attribute to the tag. It makes sense to me.

Wendy Smoak <ws...@gmail.com> wrote: On 7/23/06, Paul Benedict 
 wrote:
> Wendy, unfortunately no. This is not a style, but a DOM element ID. That's what the  connects to. It's a really cool thing: if you connect a label to a checkbox, you can actually check and uncheck the box by clicking on the label -- just like good old thick-client programs :)

Try this instead:  http://www.rabago.net/struts/html2/

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org




 		
---------------------------------
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail Beta.

Re: HTML Tags and ID

Posted by Wendy Smoak <ws...@gmail.com>.
On 7/23/06, Paul Benedict <pa...@yahoo.com> wrote:
> Wendy, unfortunately no. This is not a style, but a DOM element ID. That's what the <label for> connects to. It's a really cool thing: if you connect a label to a checkbox, you can actually check and uncheck the box by clicking on the label -- just like good old thick-client programs :)

Try this instead:  http://www.rabago.net/struts/html2/

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: HTML Tags and ID

Posted by Michael Jouravlev <jm...@gmail.com>.
Tag's "class" attribute conflicts with java.lang.Object.getClass(),
therefore it was renamed to styleClass along with styleID. These names
are aligned with HTML "style" attribute.

ID is a CSS selector, its other use like in the DOM tree is entirely
up to a developer.

There were opinions that java.lang.Object.getClass() is just a getter
while a tag needs a setter, so these methods do not conflict. On the
other hand, they do conflict if considered accessors of the same
property.

Anyway, I guess it is too late to change these names :)

On 7/24/06, Paul Benedict <pa...@yahoo.com> wrote:
> Thanks everyone. That's what I was looking for. It's named badly, imo, because styling may use an id, but its main purpose is for the DOM tree.
>
> vijay venkataraman <vi...@ltp.soft.net> wrote: Hi,
> As Thomas Joseph mentioned, styleId is a the way to get 'id' in your
> html document when you are using struts html tags. The value you set in
> styleId will be set as id of the html element. All input elements that
> can be represented by struts html tags has a attribute styleId and you
> can use it to set the 'id' on the html element. I have used this
> extensively for label id mapping. A single tag, which takes care of this
> association, and generation of label would have been great.
>
> Thanks,
> Vijay Venkataraman
>
> Thomas Joseph wrote:
>
> >Hi Paul, but I guess, what you want is styleId itself. This will be rendered as an HTML id attruibute.
> >
> >http://struts.apache.org/1.2.9/userGuide/struts-html.html#checkbox
> >
> >Although named style Id, this is the id what we use in DOM.
> >
> >Thanks and Regards,
> >Thomas Joseph
> >  ----- Original Message -----
> >  From: Paul Benedict
> >  To: Struts Users Mailing List
> >  Sent: Monday, July 24, 2006 10:21 AM
> >  Subject: Re: HTML Tags and ID
> >
> >
> >  Wendy, unfortunately no. This is not a style, but a DOM element ID. That's what the  connects to. It's a really cool thing: if you connect a label to a checkbox, you can actually check and uncheck the box by clicking on the label -- just like good old thick-client programs :)
> >
> >  Wendy Smoak  wrote: On 7/23/06, Paul Benedict
> >   wrote:
> >
> >  > Do the Struts tags allow the HTML id attribute to be set in its form taglibs? I was hoping to find an htmlId or id attribute but did not see one. Am I correct?
> >  >
> >  > My goal was to accomplish this:
> >  >
> >  >
> >  > The  connects to an HTML ID, not a name.
> >
> >  Does the 'styleId' attribute do what you want?
> >
> >  http://struts.apache.org/1.x/struts-taglib/tlddoc/html/checkbox.html
> >
> >  --
> >  Wendy
> >
> >  ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >  For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
> >
> >
> >  ---------------------------------
> >  Groups are talking. We´re listening. Check out the handy changes to Yahoo! Groups.
> >
> >
>
>
> ------------------------------DISCLAIMER------------------------------
> This message is for the named person's use only. It may contain
> confidential, proprietary or legally privileged information. No
> confidentiality or privilege is waived or lost by any mistransmission.
>
> If you receive this message in error, please immediately delete it and
> all copies of it from your system, destroy any hard copies of it and
> notify the sender. You must not, directly or indirectly, use, disclose,
> distribute, print, or copy any part of this message if you are not the
> intended recipient.
>
> Lisle Technology Partners Pvt. Ltd. and any of its subsidiaries each
> reserve the right to monitor all e-mail communications through its
> networks.
>
> Any views expressed in this message are those of the
> individual sender, except where the message states otherwise and the
> sender is authorized to state them to be the views of any such entity.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
>  Everyone is raving about the  all-new Yahoo! Mail Beta.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: HTML Tags and ID

Posted by Paul Benedict <pa...@yahoo.com>.
Thanks everyone. That's what I was looking for. It's named badly, imo, because styling may use an id, but its main purpose is for the DOM tree.

vijay venkataraman <vi...@ltp.soft.net> wrote: Hi,
As Thomas Joseph mentioned, styleId is a the way to get 'id' in your 
html document when you are using struts html tags. The value you set in 
styleId will be set as id of the html element. All input elements that 
can be represented by struts html tags has a attribute styleId and you  
can use it to set the 'id' on the html element. I have used this 
extensively for label id mapping. A single tag, which takes care of this 
association, and generation of label would have been great.

Thanks,
Vijay Venkataraman

Thomas Joseph wrote:

>Hi Paul, but I guess, what you want is styleId itself. This will be rendered as an HTML id attruibute. 
>
>http://struts.apache.org/1.2.9/userGuide/struts-html.html#checkbox
>
>Although named style Id, this is the id what we use in DOM.
>
>Thanks and Regards,
>Thomas Joseph
>  ----- Original Message ----- 
>  From: Paul Benedict 
>  To: Struts Users Mailing List 
>  Sent: Monday, July 24, 2006 10:21 AM
>  Subject: Re: HTML Tags and ID
>
>
>  Wendy, unfortunately no. This is not a style, but a DOM element ID. That's what the  connects to. It's a really cool thing: if you connect a label to a checkbox, you can actually check and uncheck the box by clicking on the label -- just like good old thick-client programs :)
>
>  Wendy Smoak  wrote: On 7/23/06, Paul Benedict 
>   wrote:
>
>  > Do the Struts tags allow the HTML id attribute to be set in its form taglibs? I was hoping to find an htmlId or id attribute but did not see one. Am I correct?
>  >
>  > My goal was to accomplish this:
>  > 
>  >
>  > The  connects to an HTML ID, not a name.
>
>  Does the 'styleId' attribute do what you want?
>
>  http://struts.apache.org/1.x/struts-taglib/tlddoc/html/checkbox.html
>
>  -- 
>  Wendy
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>  For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>    
>  ---------------------------------
>  Groups are talking. We´re listening. Check out the handy changes to Yahoo! Groups.
>  
>


------------------------------DISCLAIMER------------------------------
This message is for the named person's use only. It may contain 
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission. 

If you receive this message in error, please immediately delete it and 
all copies of it from your system, destroy any hard copies of it and 
notify the sender. You must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message if you are not the 
intended recipient. 

Lisle Technology Partners Pvt. Ltd. and any of its subsidiaries each 
reserve the right to monitor all e-mail communications through its 
networks. 

Any views expressed in this message are those of the 
individual sender, except where the message states otherwise and the 
sender is authorized to state them to be the views of any such entity.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



 		
---------------------------------
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail Beta.

Re: HTML Tags and ID

Posted by vijay venkataraman <vi...@ltp.soft.net>.
Hi,
As Thomas Joseph mentioned, styleId is a the way to get 'id' in your 
html document when you are using struts html tags. The value you set in 
styleId will be set as id of the html element. All input elements that 
can be represented by struts html tags has a attribute styleId and you  
can use it to set the 'id' on the html element. I have used this 
extensively for label id mapping. A single tag, which takes care of this 
association, and generation of label would have been great.

Thanks,
Vijay Venkataraman

Thomas Joseph wrote:

>Hi Paul, but I guess, what you want is styleId itself. This will be rendered as an HTML id attruibute. 
>
>http://struts.apache.org/1.2.9/userGuide/struts-html.html#checkbox
>
>Although named style Id, this is the id what we use in DOM.
>
>Thanks and Regards,
>Thomas Joseph
>  ----- Original Message ----- 
>  From: Paul Benedict 
>  To: Struts Users Mailing List 
>  Sent: Monday, July 24, 2006 10:21 AM
>  Subject: Re: HTML Tags and ID
>
>
>  Wendy, unfortunately no. This is not a style, but a DOM element ID. That's what the <label for> connects to. It's a really cool thing: if you connect a label to a checkbox, you can actually check and uncheck the box by clicking on the label -- just like good old thick-client programs :)
>
>  Wendy Smoak <ws...@gmail.com> wrote: On 7/23/06, Paul Benedict 
>   wrote:
>
>  > Do the Struts tags allow the HTML id attribute to be set in its form taglibs? I was hoping to find an htmlId or id attribute but did not see one. Am I correct?
>  >
>  > My goal was to accomplish this:
>  > 
>  >
>  > The  connects to an HTML ID, not a name.
>
>  Does the 'styleId' attribute do what you want?
>
>  http://struts.apache.org/1.x/struts-taglib/tlddoc/html/checkbox.html
>
>  -- 
>  Wendy
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>  For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>    
>  ---------------------------------
>  Groups are talking. We&acute;re listening. Check out the handy changes to Yahoo! Groups.
>  
>


------------------------------DISCLAIMER------------------------------
This message is for the named person's use only. It may contain 
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission. 

If you receive this message in error, please immediately delete it and 
all copies of it from your system, destroy any hard copies of it and 
notify the sender. You must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message if you are not the 
intended recipient. 

Lisle Technology Partners Pvt. Ltd. and any of its subsidiaries each 
reserve the right to monitor all e-mail communications through its 
networks. 

Any views expressed in this message are those of the 
individual sender, except where the message states otherwise and the 
sender is authorized to state them to be the views of any such entity.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: HTML Tags and ID

Posted by Thomas Joseph <th...@kottsoftware.com>.
Hi Paul, but I guess, what you want is styleId itself. This will be rendered as an HTML id attruibute. 

http://struts.apache.org/1.2.9/userGuide/struts-html.html#checkbox

Although named style Id, this is the id what we use in DOM.

Thanks and Regards,
Thomas Joseph
  ----- Original Message ----- 
  From: Paul Benedict 
  To: Struts Users Mailing List 
  Sent: Monday, July 24, 2006 10:21 AM
  Subject: Re: HTML Tags and ID


  Wendy, unfortunately no. This is not a style, but a DOM element ID. That's what the <label for> connects to. It's a really cool thing: if you connect a label to a checkbox, you can actually check and uncheck the box by clicking on the label -- just like good old thick-client programs :)

  Wendy Smoak <ws...@gmail.com> wrote: On 7/23/06, Paul Benedict 
   wrote:

  > Do the Struts tags allow the HTML id attribute to be set in its form taglibs? I was hoping to find an htmlId or id attribute but did not see one. Am I correct?
  >
  > My goal was to accomplish this:
  > 
  >
  > The  connects to an HTML ID, not a name.

  Does the 'styleId' attribute do what you want?

  http://struts.apache.org/1.x/struts-taglib/tlddoc/html/checkbox.html

  -- 
  Wendy

  ---------------------------------------------------------------------
  To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
  For additional commands, e-mail: user-help@struts.apache.org




    
  ---------------------------------
  Groups are talking. We&acute;re listening. Check out the handy changes to Yahoo! Groups.

Re: HTML Tags for JComboBox

Posted by Paul Benedict <pa...@yahoo.com>.
Chetan,

Hmmm.. Usually when you want to use a combo box, you provide both the value and the label for each item. Struts has a class called LabelValueBean; use this to assign the value to each label. Then pass in the array/list of LabelValueBean into <html:options> or <html:optionsCollections>.

Struts cannot magically determine what values you want. So in this instance it is using the label as the value (and vice-versa) because that's all you specified. To get the index, do what I described above -- values cannot be guessed at; you have to supply them.

Paul

Chetan Pandey <cp...@BLUEsingapore.com> wrote: Hi List:

I am using a JComboBox in the following manner:


:


 


 


Where holidexCodeVector is a Vector of Strings ( e.g. "BLUES", "IHG",
"SINGTEL" etc )

I only want the index of the chosen item, not the String.

For examples if User chose "IHG" I should get integer 1 , not the String
"IHG"

How is this possible as the underlying data structure is a "int" not String.

Thanks.

Chetan




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



 			
---------------------------------
See the all-new, redesigned Yahoo.com.  Check it out.

HTML Tags for JComboBox

Posted by Chetan Pandey <cp...@BLUEsingapore.com>.
Hi List:

I am using a JComboBox in the following manner:

<tr>
<td><bean:message key="attendee.holidexCode"/>:</td>
<td>
<html:select property="attendeeVO.holidexCode" >
<html:options name="holidexCodeVector" /> 
</html:select>
</td>
</tr> 


Where holidexCodeVector is a Vector of Strings ( e.g. "BLUES", "IHG",
"SINGTEL" etc )

I only want the index of the chosen item, not the String.

For examples if User chose "IHG" I should get integer 1 , not the String
"IHG"

How is this possible as the underlying data structure is a "int" not String.

Thanks.

Chetan




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: HTML Tags and ID

Posted by Paul Benedict <pa...@yahoo.com>.
Wendy, unfortunately no. This is not a style, but a DOM element ID. That's what the <label for> connects to. It's a really cool thing: if you connect a label to a checkbox, you can actually check and uncheck the box by clicking on the label -- just like good old thick-client programs :)

Wendy Smoak <ws...@gmail.com> wrote: On 7/23/06, Paul Benedict 
 wrote:

> Do the Struts tags allow the HTML id attribute to be set in its form taglibs? I was hoping to find an htmlId or id attribute but did not see one. Am I correct?
>
> My goal was to accomplish this:
> 
>
> The  connects to an HTML ID, not a name.

Does the 'styleId' attribute do what you want?

http://struts.apache.org/1.x/struts-taglib/tlddoc/html/checkbox.html

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org




 		
---------------------------------
Groups are talking. We&acute;re listening. Check out the handy changes to Yahoo! Groups. 

Re: HTML Tags and ID

Posted by Wendy Smoak <ws...@gmail.com>.
On 7/23/06, Paul Benedict <pa...@yahoo.com> wrote:

> Do the Struts tags allow the HTML id attribute to be set in its form taglibs? I was hoping to find an htmlId or id attribute but did not see one. Am I correct?
>
> My goal was to accomplish this:
> <html:checkbox name="enable" htmlId="enable" /><label for="enable"></label>
>
> The <label> connects to an HTML ID, not a name.

Does the 'styleId' attribute do what you want?

http://struts.apache.org/1.x/struts-taglib/tlddoc/html/checkbox.html

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org