Re: S2 tags - dynamic attributes

2008-09-04 Thread stanlick
More like...

Ah... hrm. Tell 'em look at the TLD, then tell 'em to check the freemarker
template, then tell 'em they might have to escape the attribute. I love
Java.

On Wed, Sep 3, 2008 at 8:05 PM, Dave Newton [EMAIL PROTECTED] wrote:

 --- On Wed, 9/3/08, Wes Wannemacher wrote:
  If the TLD file declares dynamic-attributestrue/dynamic-attributes
  for a tag, the tag's class must implement the DynamicAttributes
  interface as well.

 Ah... hrm. Tell 'em, then tell 'em again. I love Java.

 Thanks,
 Dave


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




S2 tags - dynamic attributes

2008-09-03 Thread Jonny Cavell

What I need to do is very simple, but I'm beginning to wonder whether Struts2
actually lets me do it.

Firstly, I want the id attribute of any HTML tag to take a dynamic value, so
that I can code it at runtime.
Secondly I want the tag to take e.g. dojoType as an attribute:

s:iterator value=#xxx status=itStatus var = yyy
s:radio dojoType = zzz id = #{itStatus} list=#{'0':'', '1':'',
'2':'', '3':'', '4':'', '5':''}
/s:radio
s:iterator

Neither of these work.
If I can't do this (or use a simple workaround), I cannot use Struts tags.
Is it possible?

Jonny
-- 
View this message in context: 
http://www.nabble.com/S2-tags---dynamic-attributes-tp19291646p19291646.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: S2 tags - dynamic attributes

2008-09-03 Thread Dave Newton
--- On Wed, 9/3/08, Jonny Cavell wrote:
 Firstly, I want the id attribute of any HTML tag to take a
 dynamic value, so that I can code it at runtime. Secondly
 I want the tag to take e.g. dojoType as an attribute:
 
 s:iterator value=#xxx status=itStatus var = yyy
   s:radio dojoType=zzz id=#{itStatus} 
list=#{'0':'', '1':'', '2':'', '3':'', '4':'', '5':''}
   /s:radio
 s:iterator

(1) Your OGNL expression for the id attribute is incorrect, plus you need to 
force evaluation for id:

id=%{#itStatus.index}

Or .count, if you want it starting at 1. See [1,2].

(2) You can't just randomly add attributes to JSP tags... Depending on what 
your actual needs are you may be able to get by with an onclick handler and 
some JavaScript.

Dave

[1] Iterator tag: http://struts.apache.org/2.x/docs/iterator.html
[2] IteratorStatus: 
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/views/jsp/IteratorStatus.html


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



Re: S2 tags - dynamic attributes

2008-09-03 Thread Gabriel Belingueres
1) It can't see why not. BTW, id=#{...} doesn't work because the
expresions start with %, like in id='%{itStatus}'

2) Extrange enough, I tested this with S2.1.2: It works with
s:select but it doesn't work for s:radio.

2008/9/3, Jonny Cavell [EMAIL PROTECTED]:

 What I need to do is very simple, but I'm beginning to wonder whether Struts2
 actually lets me do it.

 Firstly, I want the id attribute of any HTML tag to take a dynamic value, so
 that I can code it at runtime.
 Secondly I want the tag to take e.g. dojoType as an attribute:

 s:iterator value=#xxx status=itStatus var = yyy
s:radio dojoType = zzz id = #{itStatus} list=#{'0':'', '1':'',
 '2':'', '3':'', '4':'', '5':''}
/s:radio
 s:iterator

 Neither of these work.
 If I can't do this (or use a simple workaround), I cannot use Struts tags.
 Is it possible?

 Jonny
 --
 View this message in context: 
 http://www.nabble.com/S2-tags---dynamic-attributes-tp19291646p19291646.html
 Sent from the Struts - User mailing list archive at Nabble.com.


 -
 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: S2 tags - dynamic attributes

2008-09-03 Thread Martin Gainty

as dave mentioned status returns a IteratorStatus objectBR
http://struts.apache.org/2.x/docs/iteration-tags.htmlBR

you would then need to determine which attribute of IteratorStatus to accessBR
 s:iterator status=status value='%{0, 1}'BR
  Index: s:property value=%{#status.index} / br /BR
  Count: s:property value=%{#status.count} / br / BR
   /s:iteratorBR
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/views/jsp/IteratorStatus.html
BR
Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 


 Date: Wed, 3 Sep 2008 12:49:12 -0300
 From: [EMAIL PROTECTED]
 To: user@struts.apache.org
 Subject: Re: S2 tags - dynamic attributes
 
 1) It can't see why not. BTW, id=#{...} doesn't work because the
 expresions start with %, like in id='%{itStatus}'
 
 2) Extrange enough, I tested this with S2.1.2: It works with
 s:select but it doesn't work for s:radio.
 
 2008/9/3, Jonny Cavell [EMAIL PROTECTED]:
 
  What I need to do is very simple, but I'm beginning to wonder whether 
  Struts2
  actually lets me do it.
 
  Firstly, I want the id attribute of any HTML tag to take a dynamic value, so
  that I can code it at runtime.
  Secondly I want the tag to take e.g. dojoType as an attribute:
 
  s:iterator value=#xxx status=itStatus var = yyy
 s:radio dojoType = zzz id = #{itStatus} list=#{'0':'', '1':'',
  '2':'', '3':'', '4':'', '5':''}
 /s:radio
  s:iterator
 
  Neither of these work.
  If I can't do this (or use a simple workaround), I cannot use Struts tags.
  Is it possible?
 
  Jonny
  --
  View this message in context: 
  http://www.nabble.com/S2-tags---dynamic-attributes-tp19291646p19291646.html
  Sent from the Struts - User mailing list archive at Nabble.com.
 
 
  -
  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]
 

_
Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

RE: S2 tags - dynamic attributes

2008-09-03 Thread Wes Wannemacher
Also, as far as dynamic attributes is concerned, some tags accept them,
some don't. This was added at some point. I looked at s:radio and I
don't think it does. If you find an instance where you think support for
dynamic attributes should be added, file a JIRA. It's not particularly
difficult to put them in, but at the same time, it's not trivial. So,
file a JIRA (preferably with a patch) and it will make its way in.

-Wes

On Wed, 2008-09-03 at 12:01 -0400, Martin Gainty wrote:
 as dave mentioned status returns a IteratorStatus objectBR
 http://struts.apache.org/2.x/docs/iteration-tags.htmlBR
 
 you would then need to determine which attribute of IteratorStatus to 
 accessBR
  s:iterator status=status value='%{0, 1}'BR
   Index: s:property value=%{#status.index} / br /BR
   Count: s:property value=%{#status.count} / br / BR
/s:iteratorBR
 http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/views/jsp/IteratorStatus.html
 BR
 Martin 
 __ 
 Disclaimer and confidentiality note 
 Everything in this e-mail and any attachments relates to the official 
 business of Sender. This transmission is of a confidential nature and Sender 
 does not endorse distribution to any party other than intended recipient. 
 Sender does not necessarily endorse content contained within this 
 transmission. 
 
 
  Date: Wed, 3 Sep 2008 12:49:12 -0300
  From: [EMAIL PROTECTED]
  To: user@struts.apache.org
  Subject: Re: S2 tags - dynamic attributes
  
  1) It can't see why not. BTW, id=#{...} doesn't work because the
  expresions start with %, like in id='%{itStatus}'
  
  2) Extrange enough, I tested this with S2.1.2: It works with
  s:select but it doesn't work for s:radio.
  
  2008/9/3, Jonny Cavell [EMAIL PROTECTED]:
  
   What I need to do is very simple, but I'm beginning to wonder whether 
   Struts2
   actually lets me do it.
  
   Firstly, I want the id attribute of any HTML tag to take a dynamic value, 
   so
   that I can code it at runtime.
   Secondly I want the tag to take e.g. dojoType as an attribute:
  
   s:iterator value=#xxx status=itStatus var = yyy
  s:radio dojoType = zzz id = #{itStatus} list=#{'0':'', 
   '1':'',
   '2':'', '3':'', '4':'', '5':''}
  /s:radio
   s:iterator
  
   Neither of these work.
   If I can't do this (or use a simple workaround), I cannot use Struts tags.
   Is it possible?
  
   Jonny
   --
   View this message in context: 
   http://www.nabble.com/S2-tags---dynamic-attributes-tp19291646p19291646.html
   Sent from the Struts - User mailing list archive at Nabble.com.
  
  
   -
   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]
  
 
 _
 Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie.
 http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008


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



RE: S2 tags - dynamic attributes

2008-09-03 Thread Dave Newton
--- On Wed, 9/3/08, Wes Wannemacher wrote:
 Also, as far as dynamic attributes is concerned, 
 some tags accept them, some don't.

Oh, my bad--is that a TLD thing or an S2 thing?

Dave


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



RE: S2 tags - dynamic attributes

2008-09-03 Thread Dave Newton
--- On Wed, 9/3/08, Wes Wannemacher wrote:
 If the TLD file declares dynamic-attributestrue/dynamic-attributes
 for a tag, the tag's class must implement the DynamicAttributes 
 interface as well. 

Ah... hrm. Tell 'em, then tell 'em again. I love Java.

Thanks,
Dave


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



Re: S2 tags - dynamic attributes

2008-09-03 Thread Gabriel Belingueres
...and adding this line to the radiomap.ftl file:

#include /${parameters.templateDir}/simple/dynamic-attributes.ftl /

should suffice I think.

However, I would like to know what kind of visual effect or
functionality the dojo library adds to the radio button (I can't find
the dojo 0.4.3 documentation right now.)

2008/9/3 Wes Wannemacher [EMAIL PROTECTED]:
 It's a mix of both... There is a @StrutsTag attribute
 (allowDynamicAttributes=true) that will tell the TLD generator to add
 the appropriate parameter to the tag's entry in the TLD file. However,
 it is essentially useless unless you are going to do something with
 them. As mentioned in the OOOP, the s:select tag will take extra
 attributes, but s:radio doesn't. If the TLD file declares
 dynamic-attributestrue/dynamic-attributes for a tag, the tag's class
 must implement the DynamicAttributes interface as well.

 -Wes


 On Wed, 2008-09-03 at 17:30 -0700, Dave Newton wrote:
 --- On Wed, 9/3/08, Wes Wannemacher wrote:
  Also, as far as dynamic attributes is concerned,
  some tags accept them, some don't.

 Oh, my bad--is that a TLD thing or an S2 thing?

 Dave


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



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



Re: S2 tags - dynamic attributes

2008-09-03 Thread Wes Wannemacher
On Wed, 2008-09-03 at 22:52 -0300, Gabriel Belingueres wrote:
 ...and adding this line to the radiomap.ftl file:
 
 #include /${parameters.templateDir}/simple/dynamic-attributes.ftl /
 
 should suffice I think.
 
 However, I would like to know what kind of visual effect or
 functionality the dojo library adds to the radio button (I can't find
 the dojo 0.4.3 documentation right now.)
 

I'm thinking there is none. I was on a bit off on a tangent...

If the original poster makes a good case for adding dynattribs to
s:radio though (in a JIRA) I wouldn't see why it couldn't be done.

-Wes



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