Re: xforms:output has trailing whitespace

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

Re: xforms:output has trailing whitespace

Henrik Pettersen
All,

I've been running into problems with the extra spacing at the end of an xforms:output, and I thought I would give my 2 cents.

It seems to me that there are quite a few use cases that are difficult to implement with this extra space, particularly with string concatenation:

Hello <xforms:output ref="firstname"/>
<xforms:output ref="lastname"/>
Hello <xforms:output ref="username"/>. Would you like to <a href="/logout>logout</a>?
The value of <xforms:output ref="firstnumber"/> + <xforms:output ref="lastnumber"/> = <xforms:output ref="answer"/>
<td>I want these two cells <xforms:output ref="testdata"/></td><td>to be flush...</td>

and so forth...

I would like to make an argument for a higher priority of this bug (currently 3), if at all possible.

Also, the proposed solution (to add an outer span tag) seems fairly straight forward: could it be that all you have to do is change the piece of code that outputs the <xforms:output> tag? If so, I would be happy to assist :-)

Thanks!

Sincerely,
Henrik Pettersen
Advanced Computation Laboratory
Cancer Research UK


> Note that we now no longer generate the alert <label> when using the @value attribute on xforms:output.
> The issue is still present when you use > @ref though, and this will probably require using an outer <span> to facilitate styling.
> For reference, the tracker:
>
> http://forge.objectweb.org/tracker/index.php?func=detail&aid=305318&group_id=168&atid=350207
>
> -Erik
>
Erik Bruchez wrote:
Alex,

This is not perfect (more HTML generated) but it's probably the best solution I have seen so far.

-Erik

Alessandro Vernet wrote:
Right now, for <xforms:output> we generate:

   <span class="xforms-control xforms-output" id="output">(5 left)</span>
<label for="output" class="xforms-alert xforms-alert-inactive"/>

This makes it hard with CSS to say what the style of the label should
be. Instead, if we add a outer span, then we would generate:

   <span class="xforms-control xforms-output" id="output-1">
<span>A</span>
<label for="output-1" class="xforms-alert
xforms-alert-inactive"></label>
</span>

Then in CSS we could hide the label for all the <xforms:output> with:

   .xforms-output .xforms-alert-inactive { display: none; }

Or this could be done a lower level of granularity by adding a class
on a particular <xforms:output> and having CSS that applies to that
class.

Generating an enclosing <span> that contains the labels seems to make
more and more sense to me.

Alex

On 5/21/06, Erik Bruchez <ebruchez@xxxxxxxxxx> wrote:
I am actually not 100% satisfied with this solution either, as clearly
there are cases where you would like to use a @ref attribute and still
*not* have any trailing space afterwards. I had already entered a bug to
track this styling issue:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=305107&group_id=168&atid=350207


Any better ideas?

-Erik

Alessandro Vernet wrote:
> Ryan,
>
> The space has been added because now we also display the alert for
> outputs if they are bound to node. There is the space even when the
> alert is not active, because sometimes you don't want the layout of
> the page to change when the alert goes on/off.
>
> What you can in the short term you can hide the alert when it is
> inactive with:
>
> <xhtml:style type="text/css">
> .xforms-alert-inactive { display: none; }
> </xhtml:style>
>
> However, I think we should just not display the alert when the value
> is used instead of ref on <xforms:output>. I added a bug for this:
>
> http://forge.objectweb.org/tracker/index.php?func=detail&aid=305318&group_id=168&atid=350207


>
>
> Alex
>
> On 5/19/06, Ryan Puddephatt <rpuddephatt@xxxxxxxxxxxx> wrote:
>>
>>
>>
>>
>> Hi,
>>
>> In a recent nightly build some xforms:output have trailing
>> whitespace, shown in the attached screenshot. The code to make this as
>> follows:
>>
>>
>>
>> <xhtml:h3>Found <xforms:output ref="count/noproblems"/> <xforms:output
>> value="if(count/noproblems > 1) then ' users' else ' user'"/> deleted
>> without a problem</xhtml:h3>
>>
>>
>>
>> Any ideas why this is?
>>
>>
>>
>> Thanks
>>
>>
>>
>> Ryan Puddephatt
>>
>> Software Engineer
>>
>> TFX Group - IT UK
>>
>> 1 Michaelson Square
>>
>> Livingston
>>
>> West Lothian
>>
>> Scotand
>>
>> EH54 7DP
>>
>>
>>
>> * rpuddephatt@xxxxxxxxxxxx
>>
>> ( 01506 407 110
>>
>> 7 01506 407 108
>>
>>
>>
>>
>>
>> --
>> You receive this message as a subscriber of the ops-users@xxxxxxxxxxxxx
>> mailing list.
>> To unsubscribe: [hidden email]
>> For general help: [hidden email]
>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>
>>
>>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the ops-users@xxxxxxxxxxxxx mailing list.
> To unsubscribe: [hidden email]
> For general help: [hidden email]
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/




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







------------------------------------------------------------------------


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




--
Orbeon - XForms Everywhere:
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
Reply | Threaded
Open this post in threaded view
|

RE: xforms:output has trailing whitespace

Ryan Puddephatt
try using @value on the xforms:output rather than @ref, the whitespace is caused by the xforms:alert span
 
Ryan
 

Ryan Puddephatt
Software Engineer
 

Teleflex Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotland
EH54 7DP
 
e> [hidden email]
t> +44(0)1506 407 110
f> +44(0)1506 407 108
w> www.teleflex.com

 


From: Henrik Pettersen [mailto:[hidden email]]
Sent: 03 October 2006 18:02
To: [hidden email]
Subject: Re: [ops-users] xforms:output has trailing whitespace

All,

I've been running into problems with the extra spacing at the end of an xforms:output, and I thought I would give my 2 cents.

It seems to me that there are quite a few use cases that are difficult to implement with this extra space, particularly with string concatenation:

Hello <xforms:output ref="firstname"/>
<xforms:output ref="lastname"/>
Hello <xforms:output ref="username"/>. Would you like to <a href="/logout>logout</a>?
The value of <xforms:output ref="firstnumber"/> + <xforms:output ref="lastnumber"/> = <xforms:output ref="answer"/>
<td>I want these two cells <xforms:output ref="testdata"/></td><td>to be flush...</td>

and so forth...

I would like to make an argument for a higher priority of this bug (currently 3), if at all possible.

Also, the proposed solution (to add an outer span tag) seems fairly straight forward: could it be that all you have to do is change the piece of code that outputs the <xforms:output> tag? If so, I would be happy to assist :-)

Thanks!

Sincerely,
Henrik Pettersen
Advanced Computation Laboratory
Cancer Research UK


> Note that we now no longer generate the alert <label> when using the @value attribute on xforms:output.
> The issue is still present when you use > @ref though, and this will probably require using an outer <span> to facilitate styling.
> For reference, the tracker:
>
> http://forge.objectweb.org/tracker/index.php?func=detail&aid=305318&group_id=168&atid=350207
>
> -Erik
>
Erik Bruchez wrote:
Alex,

This is not perfect (more HTML generated) but it's probably the best solution I have seen so far.

-Erik

Alessandro Vernet wrote:
Right now, for <xforms:output> we generate:

   <span class="xforms-control xforms-output" id="output">(5 left)</span>
<label for="output" class="xforms-alert xforms-alert-inactive"/>

This makes it hard with CSS to say what the style of the label should
be. Instead, if we add a outer span, then we would generate:

   <span class="xforms-control xforms-output" id="output-1">
<span>A</span>
<label for="output-1" class="xforms-alert
xforms-alert-inactive"></label>
</span>

Then in CSS we could hide the label for all the <xforms:output> with:

   .xforms-output .xforms-alert-inactive { display: none; }

Or this could be done a lower level of granularity by adding a class
on a particular <xforms:output> and having CSS that applies to that
class.

Generating an enclosing <span> that contains the labels seems to make
more and more sense to me.

Alex

On 5/21/06, Erik Bruchez <ebruchez@xxxxxxxxxx> wrote:
I am actually not 100% satisfied with this solution either, as clearly
there are cases where you would like to use a @ref attribute and still
*not* have any trailing space afterwards. I had already entered a bug to
track this styling issue:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=305107&group_id=168&atid=350207


Any better ideas?

-Erik

Alessandro Vernet wrote:

> Ryan,
>
> The space has been added because now we also display the alert for
> outputs if they are bound to node. There is the space even when the
> alert is not active, because sometimes you don't want the layout of
> the page to change when the alert goes on/off.
>
> What you can in the short term you can hide the alert when it is
> inactive with:
>
> <xhtml:style type="text/css">
> .xforms-alert-inactive { display: none; }
> </xhtml:style>
>
> However, I think we should just not display the alert when the value
> is used instead of ref on <xforms:output>. I added a bug for this:
>
> http://forge.objectweb.org/tracker/index.php?func=detail&aid=305318&group_id=168&atid=350207

>

>
> Alex
>
> On 5/19/06, Ryan Puddephatt <rpuddephatt@xxxxxxxxxxxx> wrote:
>>
>>
>>
>>
>> Hi,
>>
>> In a recent nightly build some xforms:output have trailing
>> whitespace, shown in the attached screenshot. The code to make this as
>> follows:
>>
>>
>>
>> <xhtml:h3>Found <xforms:output ref="count/noproblems"/> <xforms:output
>> value="if(count/noproblems > 1) then ' users' else ' user'"/> deleted
>> without a problem</xhtml:h3>
>>
>>
>>
>> Any ideas why this is?
>>
>>
>>
>> Thanks
>>
>>
>>
>> Ryan Puddephatt
>>
>> Software Engineer
>>
>> TFX Group - IT UK
>>
>> 1 Michaelson Square
>>
>> Livingston
>>
>> West Lothian
>>
>> Scotand
>>
>> EH54 7DP
>>
>>
>>
>> * rpuddephatt@xxxxxxxxxxxx
>>
>> ( 01506 407 110
>>
>> 7 01506 407 108
>>
>>
>>
>>
>>
>> --
>> You receive this message as a subscriber of the ops-users@xxxxxxxxxxxxx
>> mailing list.
>> To unsubscribe: [hidden email]
>> For general help: [hidden email]
>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>
>>
>>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the ops-users@xxxxxxxxxxxxx mailing list.
> To unsubscribe: [hidden email]
> For general help: [hidden email]
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws


--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/




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







------------------------------------------------------------------------


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




--
Orbeon - XForms Everywhere:
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