attaching the class attribute to xforms controls

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

attaching the class attribute to xforms controls

Chris Bailey-2
Hi Guys,

I was wondering if it would be possible to attach user-specified class
attributes directly on the input controls?

For example, currently if I do
<xforms:input ref="/model/element" class="myclass"/>

The output I get is something along the lines of
<span class="myclass">
...
<input/>
...
</span>

Which is fine if I were using the class attributes solely for css styling
but I'm also using javascript on my pages to obtain controls and test for
specific class properties.

It's not a big issue for me now but I wondered if there was a good reason
the class is placed on the span rather then the control itself.

Chris.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: attaching the class attribute to xforms controls

Alessandro Vernet
Administrator
Hi Chris,

On 5/30/07, Chris Bailey <[hidden email]> wrote:
> It's not a big issue for me now but I wondered if there was a good reason
> the class is placed on the span rather then the control itself.

Some XForms controls are rendered with multiple HTML elements. So in
those cases we put a span around the elements, and the XForms control
ID and class goes on the span. It goes on the span because putting it
on every child element would be a waste in the case of "class" and
impossible in the case of "id".

The issue is that we don't always generate a span. So if you write CSS
or JavaScript against the generated HTML, you need to check for each
type of XForms control if a span is generated or not. We would would
like to make this more consistent in the future by always generating a
span, and also having the label, help, and hint inside the span.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws