Bug?: can't intercept DOMFocusIn event in a fr:datatable

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

Bug?: can't intercept DOMFocusIn event in a fr:datatable

Fabien GUENEGO
All is in the tittle :-)
Is it a bug?
(My Orbeon version is: Orbeon Forms 3.8.0.rc1.201005020325 CE)

This is a test file:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
     xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
     xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<title>Datatable and DOMFocusIn</title>

<xf:model id="menuModel">


<xf:instance id="tableInstance" xmlns="">
<table>
<line>
<rep>A</rep>
<rep>B</rep>
<rep>C</rep>
</line>
<line>
<rep>D</rep>
<rep>E</rep>
<rep>F</rep>
</line>
</table>
</xf:instance>
</xf:model>
</head>
<body>
<!-- Message for a good interception of a DOMFocusIn -->
<fr:alert-dialog id="overwrite-file-dialog">
<fr:label>Test</fr:label>
<fr:message>Hello World</fr:message>
<fr:negative-choice />
<fr:positive-choice />
</fr:alert-dialog>

<fr:datatable scrollable="both">

<thead>
<tr>
<xf:repeat nodeset="xxforms:instance('tableInstance')/line[1]/rep">
<th>
<xf:output href="." />
</th>
</xf:repeat>
</tr>
</thead>
<tbody>
<xf:repeat nodeset="xxforms:instance('tableInstance')/line">
<tr>
<xf:repeat nodeset="rep">
<th>
<xf:input ref="." id="case">
<xf:action ev.event="DOMFocusIn">
<xf:dispatch target="overwrite-file-dialog" name="fr-show" />
</xf:action>
</xf:input>
</th>
</xf:repeat>
</tr>
</xf:repeat>
</tbody>
</fr:datatable>

</body>
</html>

An idea?
Thanks
Fabien


--
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: Bug?: can't intercept DOMFocusIn event in a fr:datatable

Alessandro  Vernet
Administrator
Fabien,

Most likely this is because you only get DOMFocusIn events when users
set the focus on what is rendered as an HTML form field in the HTML
sent to the browser. This must be why you're not getting DOMFocusIn
for the datatable itself.

Alex

On Thu, Aug 12, 2010 at 3:27 PM, Fabien GUENEGO <[hidden email]> wrote:

> All is in the tittle :-)
> Is it a bug?
> (My Orbeon version is: Orbeon Forms 3.8.0.rc1.201005020325 CE)
>
> This is a test file:
>
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:ev="http://www.w3.org/2001/xml-events"
>    xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>    xmlns:xf="http://www.w3.org/2002/xforms">
> <head>
> <title>Datatable and DOMFocusIn</title>
>
> <xf:model id="menuModel">
>
>
> <xf:instance id="tableInstance" xmlns="">
> <table>
> <line>
> <rep>A</rep>
> <rep>B</rep>
> <rep>C</rep>
> </line>
> <line>
> <rep>D</rep>
> <rep>E</rep>
> <rep>F</rep>
> </line>
> </table>
> </xf:instance>
> </xf:model>
> </head>
> <body>
> <!-- Message for a good interception of a DOMFocusIn -->
> <fr:alert-dialog id="overwrite-file-dialog">
> <fr:label>Test</fr:label>
> <fr:message>Hello World</fr:message>
> <fr:negative-choice />
> <fr:positive-choice />
> </fr:alert-dialog>
>
> <fr:datatable scrollable="both">
>
> <thead>
> <tr>
> <xf:repeat nodeset="xxforms:instance('tableInstance')/line[1]/rep">
> <th>
> <xf:output href="." />
> </th>
> </xf:repeat>
> </tr>
> </thead>
> <tbody>
> <xf:repeat nodeset="xxforms:instance('tableInstance')/line">
> <tr>
> <xf:repeat nodeset="rep">
> <th>
> <xf:input ref="." id="case">
> <xf:action ev.event="DOMFocusIn">
> <xf:dispatch target="overwrite-file-dialog" name="fr-show" />
> </xf:action>
> </xf:input>
> </th>
> </xf:repeat>
> </tr>
> </xf:repeat>
> </tbody>
> </fr:datatable>
>
> </body>
> </html>
>
> An idea?
> Thanks
> Fabien
>
>
> --
> 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, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

arrow-key-event in a datatable with double-repeat

Fabien GUENEGO
Well, for the orbeon's users, the fruit of my lot of try on this subject
(sorry, I'm a newbie). It's ok now but only for a datatable with a
double-repeat.
We can change the javascript for an other data support. No error appear
when we are not in the datatable and we use the arrow-key.

Fabien.

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
       xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
       xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<title>XForms, Javascript and key</title>

<script type="text/javascript">
<![CDATA[
             function myKeydown(event) {
                 var key = event.charCode ? event.charCode :
event.keyCode ? event.keyCode : 0;
                 var target = event.target ? event.target :
event.srcElement ? event.srcElement : 0;
                 var idSource = target.id;
                 var idCoupe = idSource.split("·") ? idSource.split("·")
: 0;
                 var coordTable = idCoupe[1] ? idCoupe[1].split("-") : 0;
                 switch (key) {
                     case 37:
                         var newId =
String.concat(idCoupe[0],'·',coordTable[0],'-',Number(coordTable[1])-1);
                         document.getElementById(newId) ?
document.getElementById(newId).focus() : 0;
                          break;
                     case 38:
                         var newId =
String.concat(idCoupe[0],'·',Number(coordTable[0])-1,'-',coordTable[1]);
                         document.getElementById(newId) ?
document.getElementById(newId).focus() : 0;
                          break;
                     case 39:
                         var newId =
String.concat(idCoupe[0],'·',coordTable[0],'-',Number(coordTable[1])+1);
                         document.getElementById(newId) ?
document.getElementById(newId).focus() : 0;
                         break;
                     case 40:
                         var newId =
String.concat(idCoupe[0],'·',Number(coordTable[0])+1,'-',coordTable[1]);
                         document.getElementById(newId) ?
document.getElementById(newId).focus() : 0;
                          break;
                 }
                 YAHOO.util.Event.preventDefault(event);
             }
             YAHOO.util.Event.addListener(document, "keydown", myKeydown);
             ]]>
</script>

<xf:model id="menuModel" xxforms:external-events="toucheBasPress
toucheHautPress">

<xf:instance id="tableInstance" xmlns="">
<table>
<line>
<rep>bien</rep>
<rep>insuffisant</rep>
<rep>excellent</rep>
</line>
<line>
<rep>danger</rep>
<rep>excuse</rep>
<rep>retenue</rep>
</line>
<line>
<rep>vide</rep>
<rep>moyen</rep>
<rep>moyen</rep>
</line>
</table>
</xf:instance>

<xf:action ev:event="toucheBasPress">
<xf:dispatch target="overwrite-file-dialog" name="fr-show"/>
</xf:action>
</xf:model>
</head>
<body>
<fr:alert-dialog id="overwrite-file-dialog">
<fr:label>Test</fr:label>
<fr:message>Hello World</fr:message>
<fr:negative-choice/>
<fr:positive-choice/>
</fr:alert-dialog>
<xf:group id="datatableGroup">
<xf:input id="exempleControl" ref="instance('sessionInstance')/etab/nom">
<xf:action ev:event="toucheBasPress">
<xf:dispatch target="overwrite-file-dialog" name="fr-show"/>
</xf:action>
</xf:input>
<br/>

<xf:input ref="instance('tableInstance')/line[1]/rep[1]">
<xf:action ev:event="keypress" xxforms:text="b">
<xf:dispatch target="overwrite-file-dialog" name="fr-show"/>
</xf:action>
</xf:input>
<br/>
<xf:input ref="instance('tableInstance')/line[1]/rep[1]">
<xf:action ev:event="toucheBasPress">
<xf:dispatch target="overwrite-file-dialog" name="fr-show"/>
</xf:action>
</xf:input>

<div>
<fr:datatable scrollable="both">
<thead>
<tr>
<xf:repeat nodeset="xxforms:instance('tableInstance')/line[1]/rep">
<th>
<xf:output value="."/>
</th>
</xf:repeat>
</tr>
</thead>
<tbody>
<xf:repeat nodeset="xxforms:instance('tableInstance')/line">
<tr>
<xf:repeat nodeset="rep">
<th>
<xf:input ref="."/>
</th>
</xf:repeat>
</tr>
</xf:repeat>
</tbody>
</fr:datatable>
</div>
</xf:group>
</body>
</html>



Le 13/08/2010 03:19, Alessandro Vernet a écrit :

> Fabien,
>
> Most likely this is because you only get DOMFocusIn events when users
> set the focus on what is rendered as an HTML form field in the HTML
> sent to the browser. This must be why you're not getting DOMFocusIn
> for the datatable itself.
>
> Alex
>
> On Thu, Aug 12, 2010 at 3:27 PM, Fabien GUENEGO<[hidden email]>  wrote:
>    
>> All is in the tittle :-)
>> Is it a bug?
>> (My Orbeon version is: Orbeon Forms 3.8.0.rc1.201005020325 CE)
>>
>> This is a test file:
>>
>> <html xmlns="http://www.w3.org/1999/xhtml"
>> xmlns:ev="http://www.w3.org/2001/xml-events"
>>     xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
>> xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>>     xmlns:xf="http://www.w3.org/2002/xforms">
>> <head>
>> <title>Datatable and DOMFocusIn</title>
>>
>> <xf:model id="menuModel">
>>
>>
>> <xf:instance id="tableInstance" xmlns="">
>> <table>
>> <line>
>> <rep>A</rep>
>> <rep>B</rep>
>> <rep>C</rep>
>> </line>
>> <line>
>> <rep>D</rep>
>> <rep>E</rep>
>> <rep>F</rep>
>> </line>
>> </table>
>> </xf:instance>
>> </xf:model>
>> </head>
>> <body>
>> <!-- Message for a good interception of a DOMFocusIn -->
>> <fr:alert-dialog id="overwrite-file-dialog">
>> <fr:label>Test</fr:label>
>> <fr:message>Hello World</fr:message>
>> <fr:negative-choice />
>> <fr:positive-choice />
>> </fr:alert-dialog>
>>
>> <fr:datatable scrollable="both">
>>
>> <thead>
>> <tr>
>> <xf:repeat nodeset="xxforms:instance('tableInstance')/line[1]/rep">
>> <th>
>> <xf:output href="." />
>> </th>
>> </xf:repeat>
>> </tr>
>> </thead>
>> <tbody>
>> <xf:repeat nodeset="xxforms:instance('tableInstance')/line">
>> <tr>
>> <xf:repeat nodeset="rep">
>> <th>
>> <xf:input ref="." id="case">
>> <xf:action ev.event="DOMFocusIn">
>> <xf:dispatch target="overwrite-file-dialog" name="fr-show" />
>> </xf:action>
>> </xf:input>
>> </th>
>> </xf:repeat>
>> </tr>
>> </xf:repeat>
>> </tbody>
>> </fr:datatable>
>>
>> </body>
>> </html>
>>
>> An idea?
>> Thanks
>> Fabien
>>
>>
>> --
>> 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
>>
>>
>>      
>
>
>    


--
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