How to change appearance of a selected radio button? (r we in a dead-end street? :-(

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

How to change appearance of a selected radio button? (r we in a dead-end street? :-(

richhl
well, it's a frustrating thing we were stopped with problems in all our ways to reach this:

"We want to highlight in a strong way the value selected in a select1. We deal with medical cuestionaries and they want to see with a big font or color values selected by the patient in order to get a rapid visual feedback."

First way we try: -use an output html label that renders the select1 item with one aspect or another if it is selected or not (don't work http://forge.objectweb.org/tracker/index.php?func=detail&aid=308289&group_id=168&atid=350207).

Second way: -try to use button like (toggle) in a select1 (not implemented, we have call for it with a feature request http://forge.objectweb.org/tracker/index.php?func=detail&aid=308280&group_id=168&atid=350210).

Third way: -try to emulate 'second way" by using xforms triggers in order to use html labels that are implemented by orbeon but then we can't then catch keystrokes to select one value or another the same way that we were doing when using select1!

Pleaseeeeeeeeee, do you see another way to get the value highlihted in a strong way and catch keystrokes to make faster selections? we see no solution now!

P.D: Erich, Alex,...don't take this as a critic, we like your product and your kindness in answering our questions but I think we are having back luck or trying to do very strange things, don¡t know what's the case!


--
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 change appearance of a selected radio button? (r we in a dead-end street? :-(

Alessandro Vernet
Administrator
Richard,

On Jan 21, 2008 3:03 AM, Richard C. Hidalgo Lorite <[hidden email]> wrote:
> Third way: -try to emulate 'second way" by using xforms triggers in order to use html labels that are implemented by orbeon but then we can't then catch keystrokes to select one value or another the same way that we were doing when using select1!

Using a trigger should work for this. I quickly prototyped this in the
example you will find attached. See the one/two/three triggers at the
bottom of the page. As you press on a trigger, it becomes bold. Note
that using the keyboard works as well: you can tab between triggers
and press enter to select them (work both on IE and Firefox).

> P.D: Erich, Alex,...don't take this as a critic, we like your product and your kindness in answering our questions but I think we are having back luck or trying to do very strange things, don¡t know what's the case!

No problem! It is good for us know what features the community values
the most. And keep in mind that this is an open source project. The
software gets better because you contribute to it, for instance with
code or by sponsoring new features.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
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

action-setfocus.xhtml (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to change appearance of a selected radio button? (r we in a dead-end street? :-(

richhl
> Using a trigger should work for this. I quickly prototyped this in the
> example you will find attached. See the one/two/three triggers at the
> bottom of the page. As you press on a trigger, it becomes bold. Note
> that using the keyboard works as well: you can tab between triggers
> and press enter to select them (work both on IE and Firefox).

good, but I haven't explain myself well. I was talking about catch keystrokes not being Enter (DOMACtivate). If you use select1 (incremental=true) you got xforms-value-changed events when every keystroke takes place, then you can catch that with a javascript function and do the trick, but that's not possible with a repeat of triggers:

        <xhtml:script type="text/javascript">
            var pregunta='';
            function keyReleased (myEvent) {
                if (!myEvent)
                    myEvent = window.event;
                if (myEvent.which) {
                    myKeyCode = myEvent.which;
                    //window.event.which=9;
                } else if (myEvent.keyCode) {
                    myKeyCode = myEvent.keyCode;
                    //window.event.keyCode=9;
                }
                pregunta=myEvent.target.name; //This works because the select1 we have the focus on, has thrown the event.
                if ((myKeyCode &gt; 47) &amp; (myKeyCode &lt;= 57)){
                    ORBEON.xforms.Document.setValue(pregunta, myKeyCode -
48);
                }
            }
            document.onkeyup = keyReleased;
        </xhtml:script>

This code works well for handling select1 keystrokes but not for a repeat of triggers.

Anyway, we have find another way, being that triggers are not sending xforms-value-changed events for the javascript we can dispatch the event (keystroke) from the javascript to xforms model in order to set the value the key refers to (we need to set a temporal instance with the value desired because the event cannot transport that value - i guess, don't know really if there is a way, is there?).


        <xhtml:script type="text/javascript">
            var pregunta='';
            function keyReleased (myEvent) {
                if (!myEvent)
                    myEvent = window.event;
                if (myEvent.which) {
                    myKeyCode = myEvent.which;
                    //window.event.which=9;
                } else if (myEvent.keyCode) {
                    myKeyCode = myEvent.keyCode;
                    //window.event.keyCode=9;
                }
                if ((myKeyCode &gt; 47) &amp; (myKeyCode &lt;= 57)){
                    ORBEON.xforms.Document.setValue('temporal', myKeyCode - 38);
                    ORBEON.xforms.Document.dispatchEvent("modelo_principal", "pulsacion_relevante");
                }
            }
            document.onkeyup = keyReleased;
        </xhtml:script>

in the model:
       <xforms:model id="modelo_principal" xxforms:external-events="pulsacion_relevante">

            <!--CUANDO HAY UNA PULSACIÓN DE TECLA RELEVANTE+++++++++++-->
            <xforms:action ev:event="pulsacion_relevante">
                <xforms:setvalue ref="instance('inst_cuestionario_actual')/respuesta[index('bucleDePreguntas')]" value="instance('temporal')"/>
            </xforms:action>

            <!--CUANDO HAY UNA PULSACIÓN DE TECLA RELEVANTE+++++++++++-->
            <xforms:action ev:event="pulsacion_relevante">
                <xforms:setvalue ref="instance('inst_cuestionario_actual')/respuesta[index('bucleDePreguntas')]" value="instance('temporal')"/>
                <!--TODO esto no va, <xforms:setfocus  control="{concat('valor_seleccionado·',index('bucleDePreguntas'),'-',instance('temporal'))}"/>-->
            </xforms:action>
            ............
            ...........
            <xforms:instance id="temporal">
                 <temporal/>
            </xforms:instance>

        </xforms:model>

But we cannot manage to set the focus properly (see TODO) !!!!!! do you have make test to avt in control attribute for set focus? (see TODO)

thx

P.D: We wish to contribute a select1-with-triggers example for the sandbox..... :-)


--
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 change appearance of a selected radio button? (r we in a dead-end street? :-(

Erik Bruchez
Administrator
> P.D: We wish to contribute a select1-with-triggers example for the  
> sandbox..... :-)

Sounds good, just send it to the list.

-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