how to avoid repeat row highligting when entering a page?

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

how to avoid repeat row highligting when entering a page?

richhl
I want to be able to highlight the current row (i achieve
this without problem with xforms-repeat-selected style) but
the side effect is that I got the first row higlighted when
entering the page. I've tried this to solve the problem but
no luck.

           <xforms:action ev:event="xforms-ready">
                <xforms:setindex repeat="bucleDePreguntas"
index="-1"/>
                <!--<xforms:setindex
repeat="bucleDePreguntas" index="0"/>-->
            </xforms:action>


Please advice! thx.


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: how to avoid repeat row highligting when entering a page?

fl.schmitt(ops-users)
[hidden email] schrieb:

> I want to be able to highlight the current row (i achieve
> this without problem with xforms-repeat-selected style) but
> the side effect is that I got the first row higlighted when
> entering the page. I've tried this to solve the problem but
> no luck.

i think there's no easy way to do this. Changing the index of the repeat
woulnd't help because if it contains an invalid value, the index is set
to 1 (AFAIK). One could try and a another empty repeat row, let the
repeat show only the rows except the last one and set the index to the
last row. Maybe, then none of the visible rows are highlighted. But i
don't know wether this will work. And it's a quite ugly workaround that
affects the instance structure for merely design reasons.

hth
florian


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: how to avoid repeat row highligting when entering a page?

Erik Bruchez
Administrator
In reply to this post by richhl
If a repeat has more than one iteration, you can't set its index to 0.  
The index of a repeat is 0 only when there is no iteration in a  
particular repeat.

What about this algorithm: "Don't show the highlighted row when the  
page is loaded, but show it if the index changes." Is that what you  
are looking for?

-Erik

On Oct 10, 2008, at 12:06 AM, [hidden email] wrote:

> I want to be able to highlight the current row (i achieve
> this without problem with xforms-repeat-selected style) but
> the side effect is that I got the first row higlighted when
> entering the page. I've tried this to solve the problem but
> no luck.
>
>           <xforms:action ev:event="xforms-ready">
>                <xforms:setindex repeat="bucleDePreguntas"
> index="-1"/>
>                <!--<xforms:setindex
> repeat="bucleDePreguntas" index="0"/>-->
>            </xforms:action>
>
>
> Please advice! thx.
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

re: Re: how to avoid repeat row highligting when entering a page?

richhl
In reply to this post by richhl
>If a repeat has more than one iteration, you can't set its
>index to 0.   The index of a repeat is 0 only when there is
>no iteration in a   particular repeat.

sorry but this does not work.

doing this in my view:

<xforms:setindex repeat="bucleDePreguntas" index="0"/>

does not throw error, but I got the repeat highlighted
anyway.

>What about this algorithm: "Don't show the highlighted row
>when the   page is loaded, but show it if the index
>changes." Is that what you   are looking for?

yes, it's good...the client does not want any item in the
list highlighted by default. They want it highlighted when
focused.

how can I do that?

thx


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: re: Re: how to avoid repeat row highligting when entering a page?

Erik Bruchez
Administrator
>> If a repeat has more than one iteration, you can't set its

>> index to 0.   The index of a repeat is 0 only when there is
>> no iteration in a   particular repeat.
>
> sorry but this does not work.
>
> doing this in my view:
>
> <xforms:setindex repeat="bucleDePreguntas" index="0"/>
>
> does not throw error, but I got the repeat highlighted
> anyway.
Yes, that's what I am saying: you can't set the index to 0. It does  
not work, by design.

>> What about this algorithm: "Don't show the highlighted row
>> when the   page is loaded, but show it if the index
>> changes." Is that what you   are looking for?
>
> yes, it's good...the client does not want any item in the
> list highlighted by default. They want it highlighted when
> focused.

You probably want to use CSS to control this then. What about having  
an outer <div> around your repeat, which uses an AVT to change a class  
after the first DOMFocusIn something like this (see also full attached  
sample):

<!-- Set a different CSS class if there was focus or not -->
<xhtml:div class="{if (instance('focus') = 'true') then 'my-focused'  
else 'my-unfocused'}">
     <xforms:repeat nodeset="*">
         <xhtml:div>
             <xforms:input ref=".">
                 <xforms:label>Fruit</xforms:label>
             </xforms:input>
         </xhtml:div>
         <!-- Remember there was a focus event -->
         <xforms:setvalue ev:event="DOMFocusIn"  
ref="instance('focus')">true</xforms:setvalue>
     </xforms:repeat>
</xhtml:div>

-Erik




--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
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
OW2 mailing lists service home page: http://www.ow2.org/wws

style-iterations.xhtml (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: re: Re: how to avoid repeat row highligting when entering a page?

richhl
Thx a lot. It works. You can add in the example the DOMFocusOut line if you want no row highligted when the focus leaves the repeat:

<!-- Remember there was a focus event -->
<xforms:setvalue ev:event="DOMFocusIn" ref="instance('focus')">true</xforms:setvalue>
<xforms:setvalue ev:event="DOMFocusOut" ref="instance('focus')">false</xforms:setvalue>

greetings,

rich


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: re: Re: how to avoid repeat row highligting when entering a page?

Erik Bruchez
Administrator
Good suggestion, I added this.

It works because if you change focus within the repeat, you get  
DOMFocusOut then DOMFocusIn again.

-Erik

On Oct 14, 2008, at 3:27 AM, Richard C. Hidalgo Lorite wrote:

> Thx a lot. It works. You can add in the example the DOMFocusOut line  
> if you want no row highligted when the focus leaves the repeat:
>
> <!-- Remember there was a focus event -->
> <xforms:setvalue ev:event="DOMFocusIn" ref="instance('focus')">true</
> xforms:setvalue>
> <xforms:setvalue ev:event="DOMFocusOut"  
> ref="instance('focus')">false</xforms:setvalue>
>
> greetings,
>
> rich
--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
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
OW2 mailing lists service home page: http://www.ow2.org/wws