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

Re: Styling based on instance data

From: Jason <jeacott@hardlight.com.au>
Date: Fri, 01 Dec 2006 10:50:24 +1030
Message-ID: <456F7548.8010307@hardlight.com.au>
To: "Klotz, Leigh" <Leigh.Klotz@xerox.com>
CC: www-forms <www-forms@w3.org>

I think Chiba lets you do this by preprocessing and exposing this detail 
in a css hookable way.

eg:
<xf:repeat xf:appearance="full"...>
becomes:
<table class="compact-repeat valid | invalid readonly |
readwrite optional | required">
<tr class="repeat-item"> (has additional 'repeat-index' here
when selected)

sorry this doesnt help you with pure a xform, but then I guess with a 
pure xforms there is no guarantee that the platform that supports xforms 
also supports css, or anything else you might be using.

Jason.

Klotz, Leigh wrote:
> 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 Friday, 1 December 2006 00:20:58 GMT

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