W3C home > Mailing lists > Public > www-forms@w3.org > December 2006

RE: Styling based on instance data

From: Klotz, Leigh <Leigh.Klotz@xerox.com>
Date: Mon, 4 Dec 2006 10:48:30 -0800
Message-ID: <E254B0A7E0268949ABFE5EA97B7D0CF40285745C@usa7061ms01.na.xerox.net>
To: "Steve K Speicher" <sspeiche@us.ibm.com>, "www-forms" <www-forms@w3.org>

In my hypothetical syntax (a magical CSS selector xpath function) your
use case would be satisfied with
 xforms|*::value[xpath(.="blue")] { background-color: blue; }
The advantage of the xpath function is that you get the full power of
XPath.

Your syntax (the addition of a content pseudo-attribute) has the
advantage that it appears trivial to implement.
It still has the feature that you can test the content, so it would also
satisfy Roland's positive/negative number case.

But I don't see a way to navigate to other nodes, so the styling would
be dependent only on the data value, and can't be used to satisfy my use
case (the "webmail" checkbox selected boolean per item).

Leigh.

-----Original Message-----
From: www-forms-request@w3.org [mailto:www-forms-request@w3.org] On
Behalf Of Steve K Speicher
Sent: Monday, December 04, 2006 10:39 AM
To: www-forms
Subject: Re: Styling based on instance data


Perhaps my case is slightly different, styling based on a control's
bound 
node's value.

On thing along these lines that I've wanted to do is:

<style type="text/css">
...
xforms|*::value[content="blue"] { background-color: blue; }

Where the implicit attribute "content" would enable things like having 
select's item be blue as well as the select's value being blue (when 
choice of "blue" of course).

- Steve Speicher


"Klotz, Leigh" <Leigh.Klotz@xerox.com> wrote on 11/30/2006 06:37:00 PM:

> 
> Itwouldbeniceif you could use CSS to style the background of repeat
> items yellow if they are "selected" in the data using some magical CSS
> XPath selector:
> 
> <style type="text/css">
> 
>
repeat.lines::repeat-item[xpath(boolean-from-string(instance()/lines/lin
> e/@selected))] { background-color: yellow; }
>   ...
> </style>
> 
> <repeat class="lines" nodeset="lines/line">
>   <input ref="@selected">
>     <label class="columnHeader">X</label>
>   </input>
>   <output ref="date">
>     <label class="columnHeader">Date</label>
>   </output>
>   <output ref="name">
>     <label class="columnHeader">Name</label>
>   </output>
> </repeat>
> 
> 
Received on Monday, 4 December 2006 18:49:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:08 GMT