May be it would be useful to make struts tags implements javax.servlet.jsp.tagext.DynamicAttributes interface. Then we can declare a tag handler accepts additional attributes with dynamic names.
Laurie Harper wrote: > > Igor Vlasov wrote: >> Hello >> >> I want to add a user defined HTML attribute to <s:textfield. >> >> Example of rendered HTML control: <input type="text" >> userDefinedAttribute="true"/>. >> >> How can I do this? >> >> if i write <s:textfield name="customer.cus_surname" size="20" >> userDefinedAttribute="true" /> >> >> I recieve an error. > > You can't arbitrarily add attributes to a tag if the tag doesn't know > about them... If you just need to statically include the same > attribute/value every time, you can tweak the tag's template by > customizing the theme [1]; otherwise, you would need to create a new tag > based on s:textfield that knows how to handle your custom attribute(s). > > L. > > 1 http://struts.apache.org/2.x/docs/themes-and-templates.html > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Manual-defined-attribute-in-%3Cs%3Atextfield---tf4638641.html#a13466636 Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]