Need help doing setfocus to an element within a xforms:repeat

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

Need help doing setfocus to an element within a xforms:repeat

mfpaschal
Hi Folks,

I am trying to set the focus to an element within a repeat. Our repeat looks something like:

<xforms:repeat nodeset="..." id="form-repeat">
.
.
.
<xforms:input ref="..." id="input-id"/>
.
.
.
</xforms:repeat>

Inside an event handler I have this code:

<xforms:setfocus control="input-id"/>

In the Orbeon log I get: "xforms:setfocus - control does not refer to an existing control element, ignoring action"

I tried setting focus to "form-repeat" and I do not get the error but the focus is not set.

The repeat loops thru an instance and based on what is found puts up the appropriate control (input, select1, ...). Upon load, I want to set the focus to the first control on the page.

Any ideas?

Thanks,
Mike.


--
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: Need help doing setfocus to an element within a xforms:repeat

Erik Bruchez
Administrator
Mike,

It should work!

What version of Orbeon Forms are you using?

You should even be able to set focus to a grouping control, i.e. if you have:

<xf:group id="top">
  <xf:repeat>
    …

<xf:setfocus control="top"/>

Focus should then reach the first leaf control that is focusable.

-Erik

On Tue, Apr 26, 2011 at 9:12 AM,  <[hidden email]> wrote:

> Hi Folks,
>
> I am trying to set the focus to an element within a repeat. Our repeat looks
> something like:
> <xforms:repeat nodeset="..." id="form-repeat">
> .
> .
> .
> <xforms:input ref="..." id="input-id"/>
> .
> .
> .
> </xforms:repeat>
> Inside an event handler I have this code:
> <xforms:setfocus control="input-id"/>
> In the Orbeon log I get: "xforms:setfocus - control does not refer to an
> existing control element, ignoring action"
> I tried setting focus to "form-repeat" and I do not get the error but the
> focus is not set.
> The repeat loops thru an instance and based on what is found puts up the
> appropriate control (input, select1, ...). Upon load, I want to set the
> focus to the first control on the page.
> Any ideas?
> Thanks,
> Mike.
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Need help doing setfocus to an element within a xforms:repeat

mfpaschal

We are using 3.8.


-----Original Message-----
From: Erik Bruchez <[hidden email]>
To: ops-users <[hidden email]>
Sent: Thu, Apr 28, 2011 5:13 pm
Subject: [ops-users] Re: Need help doing setfocus to an element within a xforms:repeat

Mike,

It should work!

What version of Orbeon Forms are you using?

You should even be able to set focus to a grouping control, i.e. if you have:

<xf:group id="top">
  <xf:repeat>
    …

<xf:setfocus control="top"/>

Focus should then reach the first leaf control that is focusable.

-Erik

On Tue, Apr 26, 2011 at 9:12 AM,  <[hidden email]> wrote:
> Hi Folks,
>
> I am trying to set the focus to an element within a repeat. Our repeat looks
> something like:
> <xforms:repeat nodeset="..." id="form-repeat">
> .
> .
> .
> <xforms:input ref="..." id="input-id"/>
> .
> .
> .
> </xforms:repeat>
> Inside an event handler I have this code:
> <xforms:setfocus control="input-id"/>
> In the Orbeon log I get: "xforms:setfocus - control does not refer to an
> existing control element, ignoring action"
> I tried setting focus to "form-repeat" and I do not get the error but the
> focus is not set.
> The repeat loops thru an instance and based on what is found puts up the
> appropriate control (input, select1, ...). Upon load, I want to set the
> focus to the first control on the page.
> Any ideas?
> Thanks,
> Mike.
>
> --
> You receive this message as a subscriber of the [hidden email] mailing
> list.
> To unsubscribe: [hidden email]
> For general help: [hidden email]
> 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: [hidden email]
For general help: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Need help doing setfocus to an element within a xforms:repeat

mfpaschal
In doing a bit more digging, in the log, I get "control does not refer to an existing control, action ignored" as a message.

My code looks something like this:

<xforms:group ref=".[ ... ]" id="group-id">
<xhtml:table>
<xforms:repeat nodeset="instance('form-questions')/form[control-type != '']" id="repeat-id">
<xhtml:tr>
<xhtml:td>
<xforms:input ref="the-value" id="test-id"/>
</xhtml:td>
</xhtml:tr>
</xforms:repeat>
</xhtml:table>
</xforms:group>

where the form-questions instance includes the control-type and the-value elements.

I try:
<xforms:setfocus control="group-id"/>
<xforms:setfocus control="repeat-id"/>
<xforms:setfocus control="test-id"/>

All 3 calls to setfocus return the "control does not refer to an existing control element, ignoring action " message.

Mike.


-----Original Message-----
From: mfpaschal <[hidden email]>
To: ops-users <[hidden email]>
Sent: Mon, May 2, 2011 7:37 am
Subject: [ops-users] Re: Re: Need help doing setfocus to an element within a xforms:repeat


We are using 3.8.


-----Original Message-----
From: Erik Bruchez <[hidden email]>
To: ops-users <[hidden email]>
Sent: Thu, Apr 28, 2011 5:13 pm
Subject: [ops-users] Re: Need help doing setfocus to an element within a xforms:repeat

Mike,

It should work!

What version of Orbeon Forms are you using?

You should even be able to set focus to a grouping control, i.e. if you have:

<xf:group id="top">
  <xf:repeat>
    …

<xf:setfocus control="top"/>

Focus should then reach the first leaf control that is focusable.

-Erik

On Tue, Apr 26, 2011 at 9:12 AM,  <[hidden email]> wrote:
> Hi Folks,
>
> I am trying to set the focus to an element within a repeat. Our repeat looks
> something like:
> <xforms:repeat nodeset="..." id="form-repeat">
> .
> .
> .
> <xforms:input ref="..." id="input-id"/>
> .
> .
> .
> </xforms:repeat>
> Inside an event handler I have this code:
> <xforms:setfocus control="input-id"/>
> In the Orbeon log I get: "xforms:setfocus - control does not refer to an
> existing control element, ignoring action"
> I tried setting focus to "form-repeat" and I do not get the error but the
> focus is not set.
> The repeat loops thru an instance and based on what is found puts up the
> appropriate control (input, select1, ...). Upon load, I want to set the
> focus to the first control on the page.
> Any ideas?
> Thanks,
> Mike.
>
> --
> You receive this message as a subscriber of the [hidden email] mailing
> list.
> To unsubscribe: [hidden email]
> For general help: [hidden email]
> 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: [hidden email]
For general help: [hidden email]
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: [hidden email]
For general help: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Need help doing setfocus to an element within a xforms:repeat

Erik Bruchez
Administrator
Not sure why: I just checked and the  focus algorithm is in since
around January 2010, so before 3.8.

It could be that somehow the controls have become non-relevant at the
time of the setfocus, or are not yet relevant.

If you have a simple repro case, that could help.

-Erik

On Mon, May 2, 2011 at 3:54 PM,  <[hidden email]> wrote:

> In doing a bit more digging, in the log, I get "control does not refer to an
> existing control, action ignored" as a message.
> My code looks something like this:
> <xforms:group ref=".[ ... ]" id="group-id">
> <xhtml:table>
> <xforms:repeat nodeset="instance('form-questions')/form[control-type != '']"
> id="repeat-id">
> <xhtml:tr>
> <xhtml:td>
> <xforms:input ref="the-value" id="test-id"/>
> </xhtml:td>
> </xhtml:tr>
> </xforms:repeat>
> </xhtml:table>
> </xforms:group>
>
> where the form-questions instance includes the control-type and the-value
> elements.
> I try:
> <xforms:setfocus control="group-id"/>
> <xforms:setfocus control="repeat-id"/>
> <xforms:setfocus control="test-id"/>
> All 3 calls to setfocus return the "control does not refer to an existing
> control element, ignoring action " message.
> Mike.
>
>
> -----Original Message-----
> From: mfpaschal <[hidden email]>
> To: ops-users <[hidden email]>
> Sent: Mon, May 2, 2011 7:37 am
> Subject: [ops-users] Re: Re: Need help doing setfocus to an element within a
> xforms:repeat
>
>
> We are using 3.8.
>
>
> -----Original Message-----
> From: Erik Bruchez <[hidden email]>
> To: ops-users <[hidden email]>
> Sent: Thu, Apr 28, 2011 5:13 pm
> Subject: [ops-users] Re: Need help doing setfocus to an element within a
> xforms:repeat
>
> Mike,
>
> It should work!
>
> What version of Orbeon Forms are you using?
>
> You should even be able to set focus to a grouping control, i.e. if you
> have:
>
> <xf:group id="top">
>   <xf:repeat>
>     …
>
> <xf:setfocus control="top"/>
>
> Focus should then reach the first leaf control that is focusable.
>
> -Erik
>
> On Tue, Apr 26, 2011 at 9:12 AM,  <[hidden email]> wrote:
>> Hi Folks,
>>
>> I am trying to set the focus to an element within a repeat. Our repeat
>> looks
>> something like:
>> <xforms:repeat nodeset="..." id="form-repeat">
>> .
>> .
>> .
>> <xforms:input ref="..." id="input-id"/>
>> .
>> .
>> .
>> </xforms:repeat>
>> Inside an event handler I have this code:
>> <xforms:setfocus control="input-id"/>
>> In the Orbeon log I get: "xforms:setfocus - control does not refer to an
>> existing control element, ignoring action"
>> I tried setting focus to "form-repeat" and I do not get the error but the
>> focus is not set.
>> The repeat loops thru an instance and based on what is found puts up the
>> appropriate control (input, select1, ...). Upon load, I want to set the
>> focus to the first control on the page.
>> Any ideas?
>> Thanks,
>> Mike.
>>
>> --
>> 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
>
> --
> 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
>
>


--
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: Need help doing setfocus to an element within a xforms:repeat

mfpaschal
I noticed that the setfocus was giving me the error as I was doing the call from xforms-model-construct-done. When I changed to xforms-ready the error went away.

It is very hard to come up with a simple reproducible case given the nature of the code. However, I did an an output statement to the code and it stopped working. In other words, the code looks something like:

<xforms:group ref=".[ ... ]" id="group-id">
<xhtml:table>
<xforms:repeat nodeset="instance('form-questions')/form[control-type != '']" id="repeat-id">
<xhtml:tr>
<xhtml:td>
<xforms:output ref="..."/>
</xhtml:td>
</xhtml:tr>
<xhtml:tr>
<xhtml:td>
<xforms:input ref="the-value" id="test-id"/>
</xhtml:td>
</xhtml:tr>
</xforms:repeat>
</xhtml:table>
</xforms:group>

Mike.

-----Original Message-----
From: Erik Bruchez <[hidden email]>
To: ops-users <[hidden email]>
Sent: Mon, May 2, 2011 6:15 pm
Subject: [ops-users] Re: Re: Re: Re: Need help doing setfocus to an element within a xforms:repeat

Not sure why: I just checked and the  focus algorithm is in since
around January 2010, so before 3.8.

It could be that somehow the controls have become non-relevant at the
time of the setfocus, or are not yet relevant.

If you have a simple repro case, that could help.

-Erik

On Mon, May 2, 2011 at 3:54 PM,  <[hidden email]> wrote:
> In doing a bit more digging, in the log, I get "control does not refer to an
> existing control, action ignored" as a message.
> My code looks something like this:
> <xforms:group ref=".[ ... ]" id="group-id">
> <xhtml:table>
> <xforms:repeat nodeset="instance('form-questions')/form[control-type != '']"
> id="repeat-id">
> <xhtml:tr>
> <xhtml:td>
> <xforms:input ref="the-value" id="test-id"/>
> </xhtml:td>
> </xhtml:tr>
> </xforms:repeat>
> </xhtml:table>
> </xforms:group>
>
> where the form-questions instance includes the control-type and the-value
> elements.
> I try:
> <xforms:setfocus control="group-id"/>
> <xforms:setfocus control="repeat-id"/>
> <xforms:setfocus control="test-id"/>
> All 3 calls to setfocus return the "control does not refer to an existing
> control element, ignoring action " message.
> Mike.
>
>
> -----Original Message-----
> From: mfpaschal <[hidden email]>
> To: ops-users <[hidden email]>
> Sent: Mon, May 2, 2011 7:37 am
> Subject: [ops-users] Re: Re: Need help doing setfocus to an element within a
> xforms:repeat
>
>
> We are using 3.8.
>
>
> -----Original Message-----
> From: Erik Bruchez <[hidden email]>
> To: ops-users <[hidden email]>
> Sent: Thu, Apr 28, 2011 5:13 pm
> Subject: [ops-users] Re: Need help doing setfocus to an element within a
> xforms:repeat
>
> Mike,
>
> It should work!
>
> What version of Orbeon Forms are you using?
>
> You should even be able to set focus to a grouping control, i.e. if you
> have:
>
> <xf:group id="top">
>   <xf:repeat>
>     …
>
> <xf:setfocus control="top"/>
>
> Focus should then reach the first leaf control that is focusable.
>
> -Erik
>
> On Tue, Apr 26, 2011 at 9:12 AM,  <[hidden email]> wrote:
>> Hi Folks,
>>
>> I am trying to set the focus to an element within a repeat. Our repeat
>> looks
>> something like:
>> <xforms:repeat nodeset="..." id="form-repeat">
>> .
>> .
>> .
>> <xforms:input ref="..." id="input-id"/>
>> .
>> .
>> .
>> </xforms:repeat>
>> Inside an event handler I have this code:
>> <xforms:setfocus control="input-id"/>
>> In the Orbeon log I get: "xforms:setfocus - control does not refer to an
>> existing control element, ignoring action"
>> I tried setting focus to "form-repeat" and I do not get the error but the
>> focus is not set.
>> The repeat loops thru an instance and based on what is found puts up the
>> appropriate control (input, select1, ...). Upon load, I want to set the
>> focus to the first control on the page.
>> Any ideas?
>> Thanks,
>> Mike.
>>
>> --
>> You receive this message as a subscriber of the [hidden email] mailing
>> list.
>> To unsubscribe: [hidden email]
>> For general help: [hidden email]
>> 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: [hidden email]
> For general help: [hidden email]
> 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: [hidden email]
> For general help: [hidden email]
> 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: [hidden email]
> For general help: [hidden email]
> 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: [hidden email]
For general help: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: Need help doing setfocus to an element within a xforms:repeat

Erik Bruchez
Administrator
Mike,

In that case that makes sense: when xforms-model-construct-done runs,
the tree of control is not yet available.

-Erik

On Tue, May 3, 2011 at 12:29 PM,  <[hidden email]> wrote:

> I noticed that the setfocus was giving me the error as I was doing the call
> from xforms-model-construct-done. When I changed to xforms-ready the error
> went away.
> It is very hard to come up with a simple reproducible case given the nature
> of the code. However, I did an an output statement to the code and it
> stopped working. In other words, the code looks something like:
> <xforms:group ref=".[ ... ]" id="group-id">
> <xhtml:table>
> <xforms:repeat nodeset="instance('form-questions')/form[control-type != '']"
> id="repeat-id">
> <xhtml:tr>
> <xhtml:td>
> <xforms:output ref="..."/>
> </xhtml:td>
> </xhtml:tr>
> <xhtml:tr>
> <xhtml:td>
> <xforms:input ref="the-value" id="test-id"/>
> </xhtml:td>
> </xhtml:tr>
> </xforms:repeat>
> </xhtml:table>
> </xforms:group>
> Mike.
>
> -----Original Message-----
> From: Erik Bruchez <[hidden email]>
> To: ops-users <[hidden email]>
> Sent: Mon, May 2, 2011 6:15 pm
> Subject: [ops-users] Re: Re: Re: Re: Need help doing setfocus to an element
> within a xforms:repeat
>
> Not sure why: I just checked and the  focus algorithm is in since
> around January 2010, so before 3.8.
>
> It could be that somehow the controls have become non-relevant at the
> time of the setfocus, or are not yet relevant.
>
> If you have a simple repro case, that could help.
>
> -Erik
>
> On Mon, May 2, 2011 at 3:54 PM,  <[hidden email]> wrote:
>> In doing a bit more digging, in the log, I get "control does not refer to
>> an
>> existing control, action ignored" as a message.
>> My code looks something like this:
>> <xforms:group ref=".[ ... ]" id="group-id">
>> <xhtml:table>
>> <xforms:repeat nodeset="instance('form-questions')/form[control-type !=
>> '']"
>> id="repeat-id">
>> <xhtml:tr>
>> <xhtml:td>
>> <xforms:input ref="the-value" id="test-id"/>
>> </xhtml:td>
>> </xhtml:tr>
>> </xforms:repeat>
>> </xhtml:table>
>> </xforms:group>
>>
>> where the form-questions instance includes the control-type and the-value
>> elements.
>> I try:
>> <xforms:setfocus control="group-id"/>
>> <xforms:setfocus control="repeat-id"/>
>> <xforms:setfocus control="test-id"/>
>> All 3 calls to setfocus return the "control does not refer to an existing
>> control element, ignoring action " message.
>> Mike.
>>
>>
>> -----Original Message-----
>> From: mfpaschal <[hidden email]>
>> To: ops-users <[hidden email]>
>> Sent: Mon, May 2, 2011 7:37 am
>> Subject: [ops-users] Re: Re: Need help doing setfocus to an element within
>> a
>> xforms:repeat
>>
>>
>> We are using 3.8.
>>
>>
>> -----Original Message-----
>> From: Erik Bruchez <[hidden email]>
>> To: ops-users <[hidden email]>
>> Sent: Thu, Apr 28, 2011 5:13 pm
>> Subject: [ops-users] Re: Need help doing setfocus to an element within a
>> xforms:repeat
>>
>> Mike,
>>
>> It should work!
>>
>> What version of Orbeon Forms are you using?
>>
>> You should even be able to set focus to a grouping control, i.e. if you
>> have:
>>
>> <xf:group id="top">
>>   <xf:repeat>
>>     …
>>
>> <xf:setfocus control="top"/>
>>
>> Focus should then reach the first leaf control that is focusable.
>>
>> -Erik
>>
>> On Tue, Apr 26, 2011 at 9:12 AM,  <[hidden email]> wrote:
>>> Hi Folks,
>>>
>>> I am trying to set the focus to an element within a repeat. Our repeat
>>> looks
>>> something like:
>>> <xforms:repeat nodeset="..." id="form-repeat">
>>> .
>>> .
>>> .
>>> <xforms:input ref="..." id="input-id"/>
>>> .
>>> .
>>> .
>>> </xforms:repeat>
>>> Inside an event handler I have this code:
>>> <xforms:setfocus control="input-id"/>
>>> In the Orbeon log I get: "xforms:setfocus - control does not refer to an
>>> existing control element, ignoring action"
>>> I tried setting focus to "form-repeat" and I do not get the error but the
>>> focus is not set.
>>> The repeat loops thru an instance and based on what is found puts up the
>>> appropriate control (input, select1, ...). Upon load, I want to set the
>>> focus to the first control on the page.
>>> Any ideas?
>>> Thanks,
>>> Mike.
>>>
>>> --
>>> 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
>>
>> --
>> 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
>>
>>
>
> --
> 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
>
>


--
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: Re: Re: Need help doing setfocus to an element within a xforms:repeat

mfpaschal
Right. So as I stated below, I changed it to xforms-ready. The call to set focus then returned without an error. And the code worked. Until I added the xforms:output inside the xforms:repeat. At this point the call to setfocus does not return an error. But it also does not set the focus.

Is there some reason that having the xforms:output within the xforms:repeat makes setfocus not work?

Mike.



-----Original Message-----
From: Erik Bruchez <[hidden email]>
To: ops-users <[hidden email]>
Sent: Tue, May 3, 2011 6:45 pm
Subject: [ops-users] Re: Re: Re: Re: Re: Re: Need help doing setfocus to an element within a xforms:repeat

Mike,

In that case that makes sense: when xforms-model-construct-done runs,
the tree of control is not yet available.

-Erik

On Tue, May 3, 2011 at 12:29 PM,  <[hidden email]> wrote:
> I noticed that the setfocus was giving me the error as I was doing the call
> from xforms-model-construct-done. When I changed to xforms-ready the error
> went away.
> It is very hard to come up with a simple reproducible case given the nature
> of the code. However, I did an an output statement to the code and it
> stopped working. In other words, the code looks something like:
> <xforms:group ref=".[ ... ]" id="group-id">
> <xhtml:table>
> <xforms:repeat nodeset="instance('form-questions')/form[control-type != '']"
> id="repeat-id">
> <xhtml:tr>
> <xhtml:td>
> <xforms:output ref="..."/>
> </xhtml:td>
> </xhtml:tr>
> <xhtml:tr>
> <xhtml:td>
> <xforms:input ref="the-value" id="test-id"/>
> </xhtml:td>
> </xhtml:tr>
> </xforms:repeat>
> </xhtml:table>
> </xforms:group>
> Mike.
>
> -----Original Message-----
> From: Erik Bruchez <[hidden email]>
> To: ops-users <[hidden email]>
> Sent: Mon, May 2, 2011 6:15 pm
> Subject: [ops-users] Re: Re: Re: Re: Need help doing setfocus to an element
> within a xforms:repeat
>
> Not sure why: I just checked and the  focus algorithm is in since
> around January 2010, so before 3.8.
>
> It could be that somehow the controls have become non-relevant at the
> time of the setfocus, or are not yet relevant.
>
> If you have a simple repro case, that could help.
>
> -Erik
>
> On Mon, May 2, 2011 at 3:54 PM,  <[hidden email]> wrote:
>> In doing a bit more digging, in the log, I get "control does not refer to
>> an
>> existing control, action ignored" as a message.
>> My code looks something like this:
>> <xforms:group ref=".[ ... ]" id="group-id">
>> <xhtml:table>
>> <xforms:repeat nodeset="instance('form-questions')/form[control-type !=
>> '']"
>> id="repeat-id">
>> <xhtml:tr>
>> <xhtml:td>
>> <xforms:input ref="the-value" id="test-id"/>
>> </xhtml:td>
>> </xhtml:tr>
>> </xforms:repeat>
>> </xhtml:table>
>> </xforms:group>
>>
>> where the form-questions instance includes the control-type and the-value
>> elements.
>> I try:
>> <xforms:setfocus control="group-id"/>
>> <xforms:setfocus control="repeat-id"/>
>> <xforms:setfocus control="test-id"/>
>> All 3 calls to setfocus return the "control does not refer to an existing
>> control element, ignoring action " message.
>> Mike.
>>
>>
>> -----Original Message-----
>> From: mfpaschal <[hidden email]>
>> To: ops-users <[hidden email]>
>> Sent: Mon, May 2, 2011 7:37 am
>> Subject: [ops-users] Re: Re: Need help doing setfocus to an element within
>> a
>> xforms:repeat
>>
>>
>> We are using 3.8.
>>
>>
>> -----Original Message-----
>> From: Erik Bruchez <[hidden email]>
>> To: ops-users <[hidden email]>
>> Sent: Thu, Apr 28, 2011 5:13 pm
>> Subject: [ops-users] Re: Need help doing setfocus to an element within a
>> xforms:repeat
>>
>> Mike,
>>
>> It should work!
>>
>> What version of Orbeon Forms are you using?
>>
>> You should even be able to set focus to a grouping control, i.e. if you
>> have:
>>
>> <xf:group id="top">
>>   <xf:repeat>
>>     …
>>
>> <xf:setfocus control="top"/>
>>
>> Focus should then reach the first leaf control that is focusable.
>>
>> -Erik
>>
>> On Tue, Apr 26, 2011 at 9:12 AM,  <[hidden email]> wrote:
>>> Hi Folks,
>>>
>>> I am trying to set the focus to an element within a repeat. Our repeat
>>> looks
>>> something like:
>>> <xforms:repeat nodeset="..." id="form-repeat">
>>> .
>>> .
>>> .
>>> <xforms:input ref="..." id="input-id"/>
>>> .
>>> .
>>> .
>>> </xforms:repeat>
>>> Inside an event handler I have this code:
>>> <xforms:setfocus control="input-id"/>
>>> In the Orbeon log I get: "xforms:setfocus - control does not refer to an
>>> existing control element, ignoring action"
>>> I tried setting focus to "form-repeat" and I do not get the error but the
>>> focus is not set.
>>> The repeat loops thru an instance and based on what is found puts up the
>>> appropriate control (input, select1, ...). Upon load, I want to set the
>>> focus to the first control on the page.
>>> Any ideas?
>>> Thanks,
>>> Mike.
>>>
>>> --
>>> You receive this message as a subscriber of the [hidden email] mailing
>>> list.
>>> To unsubscribe: [hidden email]
>>> For general help: [hidden email]
>>> 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: [hidden email]
>> For general help: [hidden email]
>> 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: [hidden email]
>> For general help: [hidden email]
>> 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: [hidden email]
>> For general help: [hidden email]
>> 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: [hidden email]
> For general help: [hidden email]
> 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: [hidden email]
> For general help: [hidden email]
> 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: [hidden email]
For general help: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: Re: Re: Need help doing setfocus to an element within a xforms:repeat

Erik Bruchez
Administrator
Mike,

xforms:output does not really support focus in a meaningful way at
this time. Are you saying that when it's outside of a repeat you can
focus to an output? In which case, what does it do?

-Erik

On Wed, May 4, 2011 at 5:00 AM,  <[hidden email]> wrote:

> Right. So as I stated below, I changed it to xforms-ready. The call to set
> focus then returned without an error. And the code worked. Until I added the
> xforms:output inside the xforms:repeat. At this point the call to setfocus
> does not return an error. But it also does not set the focus.
> Is there some reason that having the xforms:output within the xforms:repeat
> makes setfocus not work?
> Mike.
>
>
>
> -----Original Message-----
> From: Erik Bruchez <[hidden email]>
> To: ops-users <[hidden email]>
> Sent: Tue, May 3, 2011 6:45 pm
> Subject: [ops-users] Re: Re: Re: Re: Re: Re: Need help doing setfocus to an
> element within a xforms:repeat
>
> Mike,
>
> In that case that makes sense: when xforms-model-construct-done runs,
> the tree of control is not yet available.
>
> -Erik
>
> On Tue, May 3, 2011 at 12:29 PM,  <[hidden email]> wrote:
>> I noticed that the setfocus was giving me the error as I was doing the
>> call
>> from xforms-model-construct-done. When I changed to xforms-ready the error
>> went away.
>> It is very hard to come up with a simple reproducible case given the
>> nature
>> of the code. However, I did an an output statement to the code and it
>> stopped working. In other words, the code looks something like:
>> <xforms:group ref=".[ ... ]" id="group-id">
>> <xhtml:table>
>> <xforms:repeat nodeset="instance('form-questions')/form[control-type !=
>> '']"
>> id="repeat-id">
>> <xhtml:tr>
>> <xhtml:td>
>> <xforms:output ref="..."/>
>> </xhtml:td>
>> </xhtml:tr>
>> <xhtml:tr>
>> <xhtml:td>
>> <xforms:input ref="the-value" id="test-id"/>
>> </xhtml:td>
>> </xhtml:tr>
>> </xforms:repeat>
>> </xhtml:table>
>> </xforms:group>
>> Mike.
>>
>> -----Original Message-----
>> From: Erik Bruchez <[hidden email]>
>> To: ops-users <[hidden email]>
>> Sent: Mon, May 2, 2011 6:15 pm
>> Subject: [ops-users] Re: Re: Re: Re: Need help doing setfocus to an
>> element
>> within a xforms:repeat
>>
>> Not sure why: I just checked and the  focus algorithm is in since
>> around January 2010, so before 3.8.
>>
>> It could be that somehow the controls have become non-relevant at the
>> time of the setfocus, or are not yet relevant.
>>
>> If you have a simple repro case, that could help.
>>
>> -Erik
>>
>> On Mon, May 2, 2011 at 3:54 PM,  <[hidden email]> wrote:
>>> In doing a bit more digging, in the log, I get "control does not refer to
>>> an
>>> existing control, action ignored" as a message.
>>> My code looks something like this:
>>> <xforms:group ref=".[ ... ]" id="group-id">
>>> <xhtml:table>
>>> <xforms:repeat nodeset="instance('form-questions')/form[control-type !=
>>> '']"
>>> id="repeat-id">
>>> <xhtml:tr>
>>> <xhtml:td>
>>> <xforms:input ref="the-value" id="test-id"/>
>>> </xhtml:td>
>>> </xhtml:tr>
>>> </xforms:repeat>
>>> </xhtml:table>
>>> </xforms:group>
>>>
>>> where the form-questions instance includes the control-type and the-value
>>> elements.
>>> I try:
>>> <xforms:setfocus control="group-id"/>
>>> <xforms:setfocus control="repeat-id"/>
>>> <xforms:setfocus control="test-id"/>
>>> All 3 calls to setfocus return the "control does not refer to an existing
>>> control element, ignoring action " message.
>>> Mike.
>>>
>>>
>>> -----Original Message-----
>>> From: mfpaschal <[hidden email]>
>>> To: ops-users <[hidden email]>
>>> Sent: Mon, May 2, 2011 7:37 am
>>> Subject: [ops-users] Re: Re: Need help doing setfocus to an element
>>> within
>>> a
>>> xforms:repeat
>>>
>>>
>>> We are using 3.8.
>>>
>>>
>>> -----Original Message-----
>>> From: Erik Bruchez <[hidden email]>
>>> To: ops-users <[hidden email]>
>>> Sent: Thu, Apr 28, 2011 5:13 pm
>>> Subject: [ops-users] Re: Need help doing setfocus to an element within a
>>> xforms:repeat
>>>
>>> Mike,
>>>
>>> It should work!
>>>
>>> What version of Orbeon Forms are you using?
>>>
>>> You should even be able to set focus to a grouping control, i.e. if you
>>> have:
>>>
>>> <xf:group id="top">
>>>   <xf:repeat>
>>>     …
>>>
>>> <xf:setfocus control="top"/>
>>>
>>> Focus should then reach the first leaf control that is focusable.
>>>
>>> -Erik
>>>
>>> On Tue, Apr 26, 2011 at 9:12 AM,  <[hidden email]> wrote:
>>>> Hi Folks,
>>>>
>>>> I am trying to set the focus to an element within a repeat. Our repeat
>>>> looks
>>>> something like:
>>>> <xforms:repeat nodeset="..." id="form-repeat">
>>>> .
>>>> .
>>>> .
>>>> <xforms:input ref="..." id="input-id"/>
>>>> .
>>>> .
>>>> .
>>>> </xforms:repeat>
>>>> Inside an event handler I have this code:
>>>> <xforms:setfocus control="input-id"/>
>>>> In the Orbeon log I get: "xforms:setfocus - control does not refer to an
>>>> existing control element, ignoring action"
>>>> I tried setting focus to "form-repeat" and I do not get the error but
>>>> the
>>>> focus is not set.
>>>> The repeat loops thru an instance and based on what is found puts up the
>>>> appropriate control (input, select1, ...). Upon load, I want to set the
>>>> focus to the first control on the page.
>>>> Any ideas?
>>>> Thanks,
>>>> Mike.
>>>>
>>>> --
>>>> 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
>>>
>>> --
>>> 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
>>>
>>>
>>
>> --
>> 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
>>
>>
>
> --
> 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
>
>


--
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: Re: Re: Re: Re: Need help doing setfocus to an element within a xforms:repeat

mfpaschal
No.

I am not trying to setfocus to the xforms:output statement. In the example(s) below I am always trying to do a setfocus to the id on the xforms:input statement.

When there is an xforms:output statement inside the repeat the setfocus to the id on the xforms:input does not work. When there is not an xforms:output statement inside the repeat setfocus to the id on the xforms:input does work. 

If I change it such that I attempt the setfocus to an id on the repeat or an id on a group that surrounds the repeat I get the exact same behavior as when I attempt to setfocus to the id on the xforms:input.

Mike. 



-----Original Message-----
From: Erik Bruchez <[hidden email]>
To: ops-users <[hidden email]>
Sent: Thu, May 5, 2011 5:34 pm
Subject: [ops-users] Re: Re: Re: Re: Re: Re: Re: Re: Need help doing setfocus to an element within a xforms:repeat

Mike,

xforms:output does not really support focus in a meaningful way at
this time. Are you saying that when it's outside of a repeat you can
focus to an output? In which case, what does it do?

-Erik

On Wed, May 4, 2011 at 5:00 AM,  <[hidden email]> wrote:
> Right. So as I stated below, I changed it to xforms-ready. The call to set
> focus then returned without an error. And the code worked. Until I added the
> xforms:output inside the xforms:repeat. At this point the call to setfocus
> does not return an error. But it also does not set the focus.
> Is there some reason that having the xforms:output within the xforms:repeat
> makes setfocus not work?
> Mike.
>
>
>
> -----Original Message-----
> From: Erik Bruchez <[hidden email]>
> To: ops-users <[hidden email]>
> Sent: Tue, May 3, 2011 6:45 pm
> Subject: [ops-users] Re: Re: Re: Re: Re: Re: Need help doing setfocus to an
> element within a xforms:repeat
>
> Mike,
>
> In that case that makes sense: when xforms-model-construct-done runs,
> the tree of control is not yet available.
>
> -Erik
>
> On Tue, May 3, 2011 at 12:29 PM,  <[hidden email]> wrote:
>> I noticed that the setfocus was giving me the error as I was doing the
>> call
>> from xforms-model-construct-done. When I changed to xforms-ready the error
>> went away.
>> It is very hard to come up with a simple reproducible case given the
>> nature
>> of the code. However, I did an an output statement to the code and it
>> stopped working. In other words, the code looks something like:
>> <xforms:group ref=".[ ... ]" id="group-id">
>> <xhtml:table>
>> <xforms:repeat nodeset="instance('form-questions')/form[control-type !=
>> '']"
>> id="repeat-id">
>> <xhtml:tr>
>> <xhtml:td>
>> <xforms:output ref="..."/>
>> </xhtml:td>
>> </xhtml:tr>
>> <xhtml:tr>
>> <xhtml:td>
>> <xforms:input ref="the-value" id="test-id"/>
>> </xhtml:td>
>> </xhtml:tr>
>> </xforms:repeat>
>> </xhtml:table>
>> </xforms:group>
>> Mike.
>>
>> -----Original Message-----
>> From: Erik Bruchez <[hidden email]>
>> To: ops-users <[hidden email]>
>> Sent: Mon, May 2, 2011 6:15 pm
>> Subject: [ops-users] Re: Re: Re: Re: Need help doing setfocus to an
>> element
>> within a xforms:repeat
>>
>> Not sure why: I just checked and the  focus algorithm is in since
>> around January 2010, so before 3.8.
>>
>> It could be that somehow the controls have become non-relevant at the
>> time of the setfocus, or are not yet relevant.
>>
>> If you have a simple repro case, that could help.
>>
>> -Erik
>>
>> On Mon, May 2, 2011 at 3:54 PM,  <[hidden email]> wrote:
>>> In doing a bit more digging, in the log, I get "control does not refer to
>>> an
>>> existing control, action ignored" as a message.
>>> My code looks something like this:
>>> <xforms:group ref=".[ ... ]" id="group-id">
>>> <xhtml:table>
>>> <xforms:repeat nodeset="instance('form-questions')/form[control-type !=
>>> '']"
>>> id="repeat-id">
>>> <xhtml:tr>
>>> <xhtml:td>
>>> <xforms:input ref="the-value" id="test-id"/>
>>> </xhtml:td>
>>> </xhtml:tr>
>>> </xforms:repeat>
>>> </xhtml:table>
>>> </xforms:group>
>>>
>>> where the form-questions instance includes the control-type and the-value
>>> elements.
>>> I try:
>>> <xforms:setfocus control="group-id"/>
>>> <xforms:setfocus control="repeat-id"/>
>>> <xforms:setfocus control="test-id"/>
>>> All 3 calls to setfocus return the "control does not refer to an existing
>>> control element, ignoring action " message.
>>> Mike.
>>>
>>>
>>> -----Original Message-----
>>> From: mfpaschal <[hidden email]>
>>> To: ops-users <[hidden email]>
>>> Sent: Mon, May 2, 2011 7:37 am
>>> Subject: [ops-users] Re: Re: Need help doing setfocus to an element
>>> within
>>> a
>>> xforms:repeat
>>>
>>>
>>> We are using 3.8.
>>>
>>>
>>> -----Original Message-----
>>> From: Erik Bruchez <[hidden email]>
>>> To: ops-users <[hidden email]>
>>> Sent: Thu, Apr 28, 2011 5:13 pm
>>> Subject: [ops-users] Re: Need help doing setfocus to an element within a
>>> xforms:repeat
>>>
>>> Mike,
>>>
>>> It should work!
>>>
>>> What version of Orbeon Forms are you using?
>>>
>>> You should even be able to set focus to a grouping control, i.e. if you
>>> have:
>>>
>>> <xf:group id="top">
>>>   <xf:repeat>
>>>     …
>>>
>>> <xf:setfocus control="top"/>
>>>
>>> Focus should then reach the first leaf control that is focusable.
>>>
>>> -Erik
>>>
>>> On Tue, Apr 26, 2011 at 9:12 AM,  <[hidden email]> wrote:
>>>> Hi Folks,
>>>>
>>>> I am trying to set the focus to an element within a repeat. Our repeat
>>>> looks
>>>> something like:
>>>> <xforms:repeat nodeset="..." id="form-repeat">
>>>> .
>>>> .
>>>> .
>>>> <xforms:input ref="..." id="input-id"/>
>>>> .
>>>> .
>>>> .
>>>> </xforms:repeat>
>>>> Inside an event handler I have this code:
>>>> <xforms:setfocus control="input-id"/>
>>>> In the Orbeon log I get: "xforms:setfocus - control does not refer to an
>>>> existing control element, ignoring action"
>>>> I tried setting focus to "form-repeat" and I do not get the error but
>>>> the
>>>> focus is not set.
>>>> The repeat loops thru an instance and based on what is found puts up the
>>>> appropriate control (input, select1, ...). Upon load, I want to set the
>>>> focus to the first control on the page.
>>>> Any ideas?
>>>> Thanks,
>>>> Mike.
>>>>
>>>> --
>>>> You receive this message as a subscriber of the [hidden email]
>>>> mailing
>>>> list.
>>>> To unsubscribe: [hidden email]
>>>> For general help: [hidden email]
>>>> 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: [hidden email]
>>> For general help: [hidden email]
>>> 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: [hidden email]
>>> For general help: [hidden email]
>>> 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: [hidden email]
>>> For general help: [hidden email]
>>> 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: [hidden email]
>> For general help: [hidden email]
>> 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: [hidden email]
>> For general help: [hidden email]
>> 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: [hidden email]
> For general help: [hidden email]
> 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: [hidden email]
> For general help: [hidden email]
> 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: [hidden email]
For general help: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Need help doing setfocus to an element within a xforms:repeat

Erik Bruchez
Administrator
Can you provide a small standalone example showing this behavior?

Thanks,

-Erik

On Fri, May 6, 2011 at 4:56 AM,  <[hidden email]> wrote:

> No.
> I am not trying to setfocus to the xforms:output statement. In the
> example(s) below I am always trying to do a setfocus to the id on the
> xforms:input statement.
>
> When there is an xforms:output statement inside the repeat the setfocus to
> the id on the xforms:input does not work. When there is not an xforms:output
> statement inside the repeat setfocus to the id on the xforms:input does
> work.
> If I change it such that I attempt the setfocus to an id on the repeat or an
> id on a group that surrounds the repeat I get the exact same behavior as
> when I attempt to setfocus to the id on the xforms:input.
> Mike.
>
>
>
> -----Original Message-----
> From: Erik Bruchez <[hidden email]>
> To: ops-users <[hidden email]>
> Sent: Thu, May 5, 2011 5:34 pm
> Subject: [ops-users] Re: Re: Re: Re: Re: Re: Re: Re: Need help doing
> setfocus to an element within a xforms:repeat
>
> Mike,
>
> xforms:output does not really support focus in a meaningful way at
> this time. Are you saying that when it's outside of a repeat you can
> focus to an output? In which case, what does it do?
>
> -Erik
>
> On Wed, May 4, 2011 at 5:00 AM,  <[hidden email]> wrote:
>> Right. So as I stated below, I changed it to xforms-ready. The call to set
>> focus then returned without an error. And the code worked. Until I added
>> the
>> xforms:output inside the xforms:repeat. At this point the call to setfocus
>> does not return an error. But it also does not set the focus.
>> Is there some reason that having the xforms:output within the
>> xforms:repeat
>> makes setfocus not work?
>> Mike.
>>
>>
>>
>> -----Original Message-----
>> From: Erik Bruchez <[hidden email]>
>> To: ops-users <[hidden email]>
>> Sent: Tue, May 3, 2011 6:45 pm
>> Subject: [ops-users] Re: Re: Re: Re: Re: Re: Need help doing setfocus to
>> an
>> element within a xforms:repeat
>>
>> Mike,
>>
>> In that case that makes sense: when xforms-model-construct-done runs,
>> the tree of control is not yet available.
>>
>> -Erik
>>
>> On Tue, May 3, 2011 at 12:29 PM,  <[hidden email]> wrote:
>>> I noticed that the setfocus was giving me the error as I was doing the
>>> call
>>> from xforms-model-construct-done. When I changed to xforms-ready the
>>> error
>>> went away.
>>> It is very hard to come up with a simple reproducible case given the
>>> nature
>>> of the code. However, I did an an output statement to the code and it
>>> stopped working. In other words, the code looks something like:
>>> <xforms:group ref=".[ ... ]" id="group-id">
>>> <xhtml:table>
>>> <xforms:repeat nodeset="instance('form-questions')/form[control-type !=
>>> '']"
>>> id="repeat-id">
>>> <xhtml:tr>
>>> <xhtml:td>
>>> <xforms:output ref="..."/>
>>> </xhtml:td>
>>> </xhtml:tr>
>>> <xhtml:tr>
>>> <xhtml:td>
>>> <xforms:input ref="the-value" id="test-id"/>
>>> </xhtml:td>
>>> </xhtml:tr>
>>> </xforms:repeat>
>>> </xhtml:table>
>>> </xforms:group>
>>> Mike.
>>>
>>> -----Original Message-----
>>> From: Erik Bruchez <[hidden email]>
>>> To: ops-users <[hidden email]>
>>> Sent: Mon, May 2, 2011 6:15 pm
>>> Subject: [ops-users] Re: Re: Re: Re: Need help doing setfocus to an
>>> element
>>> within a xforms:repeat
>>>
>>> Not sure why: I just checked and the  focus algorithm is in since
>>> around January 2010, so before 3.8.
>>>
>>> It could be that somehow the controls have become non-relevant at the
>>> time of the setfocus, or are not yet relevant.
>>>
>>> If you have a simple repro case, that could help.
>>>
>>> -Erik
>>>
>>> On Mon, May 2, 2011 at 3:54 PM,  <[hidden email]> wrote:
>>>> In doing a bit more digging, in the log, I get "control does not refer
>>>> to
>>>> an
>>>> existing control, action ignored" as a message.
>>>> My code looks something like this:
>>>> <xforms:group ref=".[ ... ]" id="group-id">
>>>> <xhtml:table>
>>>> <xforms:repeat nodeset="instance('form-questions')/form[control-type !=
>>>> '']"
>>>> id="repeat-id">
>>>> <xhtml:tr>
>>>> <xhtml:td>
>>>> <xforms:input ref="the-value" id="test-id"/>
>>>> </xhtml:td>
>>>> </xhtml:tr>
>>>> </xforms:repeat>
>>>> </xhtml:table>
>>>> </xforms:group>
>>>>
>>>> where the form-questions instance includes the control-type and
>>>> the-value
>>>> elements.
>>>> I try:
>>>> <xforms:setfocus control="group-id"/>
>>>> <xforms:setfocus control="repeat-id"/>
>>>> <xforms:setfocus control="test-id"/>
>>>> All 3 calls to setfocus return the "control does not refer to an
>>>> existing
>>>> control element, ignoring action " message.
>>>> Mike.
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: mfpaschal <[hidden email]>
>>>> To: ops-users <[hidden email]>
>>>> Sent: Mon, May 2, 2011 7:37 am
>>>> Subject: [ops-users] Re: Re: Need help doing setfocus to an element
>>>> within
>>>> a
>>>> xforms:repeat
>>>>
>>>>
>>>> We are using 3.8.
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Erik Bruchez <[hidden email]>
>>>> To: ops-users <[hidden email]>
>>>> Sent: Thu, Apr 28, 2011 5:13 pm
>>>> Subject: [ops-users] Re: Need help doing setfocus to an element within a
>>>> xforms:repeat
>>>>
>>>> Mike,
>>>>
>>>> It should work!
>>>>
>>>> What version of Orbeon Forms are you using?
>>>>
>>>> You should even be able to set focus to a grouping control, i.e. if you
>>>> have:
>>>>
>>>> <xf:group id="top">
>>>>   <xf:repeat>
>>>>     …
>>>>
>>>> <xf:setfocus control="top"/>
>>>>
>>>> Focus should then reach the first leaf control that is focusable.
>>>>
>>>> -Erik
>>>>
>>>> On Tue, Apr 26, 2011 at 9:12 AM,  <[hidden email]> wrote:
>>>>> Hi Folks,
>>>>>
>>>>> I am trying to set the focus to an element within a repeat. Our repeat
>>>>> looks
>>>>> something like:
>>>>> <xforms:repeat nodeset="..." id="form-repeat">
>>>>> .
>>>>> .
>>>>> .
>>>>> <xforms:input ref="..." id="input-id"/>
>>>>> .
>>>>> .
>>>>> .
>>>>> </xforms:repeat>
>>>>> Inside an event handler I have this code:
>>>>> <xforms:setfocus control="input-id"/>
>>>>> In the Orbeon log I get: "xforms:setfocus - control does not refer to
>>>>> an
>>>>> existing control element, ignoring action"
>>>>> I tried setting focus to "form-repeat" and I do not get the error but
>>>>> the
>>>>> focus is not set.
>>>>> The repeat loops thru an instance and based on what is found puts up
>>>>> the
>>>>> appropriate control (input, select1, ...). Upon load, I want to set the
>>>>> focus to the first control on the page.
>>>>> Any ideas?
>>>>> Thanks,
>>>>> Mike.
>>>>>
>>>>> --
>>>>> 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
>>>>
>>>> --
>>>> 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
>>>>
>>>>
>>>
>>> --
>>> 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
>>>
>>>
>>
>> --
>> 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
>>
>>
>
> --
> 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
>
>


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