Re: Does Xforms bind foce ajax

Posted by Alessandro Vernet on
URL: https://discuss.orbeon.com/DMV-Forms-Example-tp27273p27287.html

Hi Richard,

Since there is not a one to one mapping between XForms controls and
HTML elements, XForms control are often rendered by putting together a
number of HTML elements. This is the case for <xforms:input>, which
appearance can change as runtime from an input field to a date picker,
and vice versa. For instance, an <xforms:input> input is rendered as a
span that contains an input form element, a span that contains the
date selected with the date picker, and a span that contains an image
you can click on to show the date picker. If in the XForms code we
find a class or style attribute, on which one of those HTML elements
should this attribute be copied? The answer is always going to be
arbitrary because we don't know what you are trying to style. Should
it be on the input form element, the image? We chose to consistently
copy the style and class attributes on the container, in this case the
span element.

What about using a class on the input? E.g. <xforms:input
class="large-input">. Then in CSS you do:

.large-input input { my CSS that applies to the HTML input form element }

Alex

On 2/9/06, Richard Braman <[hidden email]> wrote:

> What if the height,width,and font-size of each input tag are different.
> I don't understand why the attributes of the <input> are being moved to
> the <span> by OPS.  I don't understand the assumption that it is OK to
> move someones attributes from one tag to another.  I also really don't
> understand what is accomplished by moving them. How can I fix this in
> theme.xsl?  I rellay don't want to move them back because I never wanted
> them to move to begin with.
>
>
> -----Original Message-----
> From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez
> Sent: Thursday, February 09, 2006 6:57 PM
> To: [hidden email]
> Subject: Re: [ops-users] Does Xforms bind foce ajax
>
>
> According to the HTML DTD:
>
> <!ELEMENT (SUB|SUP) - - (%inline;)*    -- subscript, superscript -->
>
> <!ENTITY % inline "#PCDATA | %fontstyle; | %phrase; | %special; |
> %formctrl;">
>
> <!ENTITY % formctrl "INPUT | SELECT | TEXTAREA | LABEL | BUTTON">
>
> So it is perfectly legal to have an <input> inside a <span>. Of course
> styling the <span> is not equivalent to styling the <input>.
>
> Now back to your problem. Two things:
>
> 1. If most of your controls share styling attributes, you can use
> "class" as discussed earlier.
>
> 2. If you are looking to do absolute positioning, then positioning the
> <span> should work as well as positioning the <input>.
>
> 3. If really you want to move back the style to the <input>, you can do
> this with XSLT in theme.xsl.
>
> -Erik
>
> Richard Braman wrote:
> > Span tags are meant to format text, not inputs.
> > please review the following code in IE and tell me what works:
> >
> > <html>
> > <body>
> > <form>
> > <span style="font-size:11px;font-weight:bold">
> > <input type="text" name="doesnotwork">
> > </span>
> > <input type="text" name="styley"
> > style="font-size:11px;font-weight:bold">
> > </form>
> > </body>
> > </html>
> >
> > Putting this code in the native java is a buzkill.
> >
> > -----Original Message-----
> > From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik
> > Bruchez
> > Sent: Thursday, February 09, 2006 3:59 PM
> > To: [hidden email]
> > Subject: Re: [ops-users] Does Xforms bind foce ajax
> >
> >
> > Richard Braman wrote:
> >  > It seems when I switched to using x forms:bid, it sent tverything
> > into  > ajax.
> >
> > Not sure what you mean here.
> >
> >  > I see at least one issue with ajax.  The code below seems to puts a
> >> span tag around the xforms input, which doesn't work on IE.
> >
> > Note that xforms-to-ajax-xhtml.xsl is no longer used: we should take
> > it out of the code base (just did that in the CVS). The translation to
>
> > HTML is now done natively in Java.
> >
> > This said, we do put <span> around <input>. But all the OPS examples
> > do work with IE, and they too have <span> around <input>. What is the
> > specific problem you are seeing?
> >
> >  > What if I don't want to use AJAX?
> >
> > The only way for now is to use XForms Classic, but then you don't get
> > any of the XForms improvements in OPS 3.0. In other words, you get
> > fairly limited XForms support with Classic.
> >
> > -Erik
> >
> >
> >
> >
> >
> > ----------------------------------------------------------------------
> > --
> >
> >
> > --
> > 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
>
>
>
>
>
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet