Dynamic form and source field

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

Dynamic form and source field

Alexandru Ionita


Hello guys,

here I am again with two questions:

1. How can I identify the XPATH that is backing a input text which was detected through JS as a source element of a keyPress event. The event is dispatched as follows:
ORBEON.xforms.Document.dispatchEvent("main-model", "F4-keypress")

2nd, I need to build a dynamic form in a pop-up window based on a known XML model. Is this possible?


thank you,
Alexandru


--
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: Dynamic form and source field

Alessandro  Vernet
Administrator
Alexandru,

I understand you are dispatching an event from the JavaScript to the
server with ORBEON.xforms.Document.dispatchEvent("main-model",
"F4-keypress"). I imagine you dispatch it when users press F4. Is the
case that you would like to know what was the current field the user
was in when this happened?

Regarding your second point, I am not sure to understand what you want
to do. Could you describe this in more details, and maybe give us an
example?

Alex

On Fri, Jan 29, 2010 at 1:23 AM, Alexandru Ionita
<[hidden email]> wrote:

>
>
> Hello guys,
> here I am again with two questions:
> 1. How can I identify the XPATH that is backing a input text which was
> detected through JS as a source element of a keyPress event. The event is
> dispatched as follows:
> ORBEON.xforms.Document.dispatchEvent("main-model", "F4-keypress")
> 2nd, I need to build a dynamic form in a pop-up window based on a known XML
> model. Is this possible?
>
> thank you,
> Alexandru
>
> --
> 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
Orbeon's Blog: http://www.orbeon.com/blog/
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
|

Re: Re: Dynamic form and source field

Alexandru Ionita


Hello Alessandro,

yes, I want to identify the field (its full xpath expression in the xml model) the user was focussed on while the F4 key was pressed, and based on this field, I need to build a dynamic form based on a XML model returned by the action triggered by ORBEON.xforms.Document.dispatchEvent("main-model","F4-keypress")

regarding the dynamic form, I found somethig here:


thank you and regards,
Alexandru

On Sat, Jan 30, 2010 at 05:42, Alessandro Vernet <[hidden email]> wrote:
Alexandru,

I understand you are dispatching an event from the JavaScript to the
server with ORBEON.xforms.Document.dispatchEvent("main-model",
"F4-keypress"). I imagine you dispatch it when users press F4. Is the
case that you would like to know what was the current field the user
was in when this happened?

Regarding your second point, I am not sure to understand what you want
to do. Could you describe this in more details, and maybe give us an
example?

Alex

On Fri, Jan 29, 2010 at 1:23 AM, Alexandru Ionita
<[hidden email]> wrote:
>
>
> Hello guys,
> here I am again with two questions:
> 1. How can I identify the XPATH that is backing a input text which was
> detected through JS as a source element of a keyPress event. The event is
> dispatched as follows:
> ORBEON.xforms.Document.dispatchEvent("main-model", "F4-keypress")
> 2nd, I need to build a dynamic form in a pop-up window based on a known XML
> model. Is this possible?
>
> thank you,
> Alexandru
>
> --
> 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
Orbeon's Blog: http://www.orbeon.com/blog/
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




--
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: Dynamic form and source field

Alexandru Ionita


Hello again,

I came up with some updates regarding my needs for identifying the source element. I gave up approaching this solution (F4 keypress), since the F1-F12 buttons are handled different in the major browsers. An easier way to get thinks done is the following:

attach an onFocus event to all input fields, and when this event is triggered for a specific field, a small help icon will appear right next to the field. If the user clicks it, I can dispatch an event with  ORBEON.xforms.Document.dispatchEvent("main-model","help-request"). What I don't know at this step is how to make the orbeon action aware about the source input field.

I was thinking that priori calling the dispatch-event, to call ORBEON.xforms.Document.setValue("temp-var",inputfied.id), to store in a temp instance the id of the source field. The problem now is that the id of the field has nothing to do with the ref attribute (which I need it). 

So, to resume, I need somehow to identify the ref attribute of the input field that was detected as a DOM element. 

Thank you and kind regards,
Alexandru

On Sat, Jan 30, 2010 at 12:13, Alexandru Ionita <[hidden email]> wrote:


Hello Alessandro,

yes, I want to identify the field (its full xpath expression in the xml model) the user was focussed on while the F4 key was pressed, and based on this field, I need to build a dynamic form based on a XML model returned by the action triggered by ORBEON.xforms.Document.dispatchEvent("main-model","F4-keypress")

regarding the dynamic form, I found somethig here:


thank you and regards,
Alexandru

On Sat, Jan 30, 2010 at 05:42, Alessandro Vernet <[hidden email]> wrote:
Alexandru,

I understand you are dispatching an event from the JavaScript to the
server with ORBEON.xforms.Document.dispatchEvent("main-model",
"F4-keypress"). I imagine you dispatch it when users press F4. Is the
case that you would like to know what was the current field the user
was in when this happened?

Regarding your second point, I am not sure to understand what you want
to do. Could you describe this in more details, and maybe give us an
example?

Alex

On Fri, Jan 29, 2010 at 1:23 AM, Alexandru Ionita
<[hidden email]> wrote:
>
>
> Hello guys,
> here I am again with two questions:
> 1. How can I identify the XPATH that is backing a input text which was
> detected through JS as a source element of a keyPress event. The event is
> dispatched as follows:
> ORBEON.xforms.Document.dispatchEvent("main-model", "F4-keypress")
> 2nd, I need to build a dynamic form in a pop-up window based on a known XML
> model. Is this possible?
>
> thank you,
> Alexandru
>
> --
> 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
Orbeon's Blog: http://www.orbeon.com/blog/
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





--
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: Dynamic form and source field

Alexandru Ionita


Hello guys,

this issue seems to be much harder that I was expected: to convert the id of the element on the client side, to the variable name on the server side. I found something, but this works only if we switch to offline mode and persist the xform model on the client side: 

ORBEON.xforms.Offline.controlIDToVariableName[inputNode.id]

but this is not acceptable in our solution. Most probably, this mapping should be done on the server side, but I don't know how.

Can anybody there give me some clues please?

Thank you and regards,
Alexandru

On Mon, Feb 1, 2010 at 00:10, Alexandru Ionita <[hidden email]> wrote:


Hello again,

I came up with some updates regarding my needs for identifying the source element. I gave up approaching this solution (F4 keypress), since the F1-F12 buttons are handled different in the major browsers. An easier way to get thinks done is the following:

attach an onFocus event to all input fields, and when this event is triggered for a specific field, a small help icon will appear right next to the field. If the user clicks it, I can dispatch an event with  ORBEON.xforms.Document.dispatchEvent("main-model","help-request"). What I don't know at this step is how to make the orbeon action aware about the source input field.

I was thinking that priori calling the dispatch-event, to call ORBEON.xforms.Document.setValue("temp-var",inputfied.id), to store in a temp instance the id of the source field. The problem now is that the id of the field has nothing to do with the ref attribute (which I need it). 

So, to resume, I need somehow to identify the ref attribute of the input field that was detected as a DOM element. 

Thank you and kind regards,
Alexandru


On Sat, Jan 30, 2010 at 12:13, Alexandru Ionita <[hidden email]> wrote:


Hello Alessandro,

yes, I want to identify the field (its full xpath expression in the xml model) the user was focussed on while the F4 key was pressed, and based on this field, I need to build a dynamic form based on a XML model returned by the action triggered by ORBEON.xforms.Document.dispatchEvent("main-model","F4-keypress")

regarding the dynamic form, I found somethig here:


thank you and regards,
Alexandru

On Sat, Jan 30, 2010 at 05:42, Alessandro Vernet <[hidden email]> wrote:
Alexandru,

I understand you are dispatching an event from the JavaScript to the
server with ORBEON.xforms.Document.dispatchEvent("main-model",
"F4-keypress"). I imagine you dispatch it when users press F4. Is the
case that you would like to know what was the current field the user
was in when this happened?

Regarding your second point, I am not sure to understand what you want
to do. Could you describe this in more details, and maybe give us an
example?

Alex

On Fri, Jan 29, 2010 at 1:23 AM, Alexandru Ionita
<[hidden email]> wrote:
>
>
> Hello guys,
> here I am again with two questions:
> 1. How can I identify the XPATH that is backing a input text which was
> detected through JS as a source element of a keyPress event. The event is
> dispatched as follows:
> ORBEON.xforms.Document.dispatchEvent("main-model", "F4-keypress")
> 2nd, I need to build a dynamic form in a pop-up window based on a known XML
> model. Is this possible?
>
> thank you,
> Alexandru
>
> --
> 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
Orbeon's Blog: http://www.orbeon.com/blog/
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






--
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: Dynamic form and source field

Alexandru Ionita


Hello all,

finally, I was able to provide a mechanism to achieve my goal in identifying the source element of a triggered event.
The solution is not very elegant, but this is all I could do:

1. Rename the ID of the element to be a representation of the field.
2. Create an auxiliary field pointing to a data model instance (helper)
3. When the event is triggered in the source element, I get it's ID using javascript and set it as a value of the auxiliary field (SEARCH_HELP_VALUES). 
        ORBEON.xforms.Document.setValue("SEARCH_HELP_VALUES", fieldId);
4. Dispatch the server action that will check this field
        ORBEON.xforms.Document.dispatchEvent("webflow-invoice-model", "showF4contextualMenu");

If somebody needs more details, I can provide more.


regards,
Alexandru

On Mon, Feb 1, 2010 at 16:23, Alexandru Ionita <[hidden email]> wrote:


Hello guys,

this issue seems to be much harder that I was expected: to convert the id of the element on the client side, to the variable name on the server side. I found something, but this works only if we switch to offline mode and persist the xform model on the client side: 

ORBEON.xforms.Offline.controlIDToVariableName[inputNode.id]

but this is not acceptable in our solution. Most probably, this mapping should be done on the server side, but I don't know how.

Can anybody there give me some clues please?

Thank you and regards,
Alexandru


On Mon, Feb 1, 2010 at 00:10, Alexandru Ionita <[hidden email]> wrote:


Hello again,

I came up with some updates regarding my needs for identifying the source element. I gave up approaching this solution (F4 keypress), since the F1-F12 buttons are handled different in the major browsers. An easier way to get thinks done is the following:

attach an onFocus event to all input fields, and when this event is triggered for a specific field, a small help icon will appear right next to the field. If the user clicks it, I can dispatch an event with  ORBEON.xforms.Document.dispatchEvent("main-model","help-request"). What I don't know at this step is how to make the orbeon action aware about the source input field.

I was thinking that priori calling the dispatch-event, to call ORBEON.xforms.Document.setValue("temp-var",inputfied.id), to store in a temp instance the id of the source field. The problem now is that the id of the field has nothing to do with the ref attribute (which I need it). 

So, to resume, I need somehow to identify the ref attribute of the input field that was detected as a DOM element. 

Thank you and kind regards,
Alexandru


On Sat, Jan 30, 2010 at 12:13, Alexandru Ionita <[hidden email]> wrote:


Hello Alessandro,

yes, I want to identify the field (its full xpath expression in the xml model) the user was focussed on while the F4 key was pressed, and based on this field, I need to build a dynamic form based on a XML model returned by the action triggered by ORBEON.xforms.Document.dispatchEvent("main-model","F4-keypress")

regarding the dynamic form, I found somethig here:


thank you and regards,
Alexandru

On Sat, Jan 30, 2010 at 05:42, Alessandro Vernet <[hidden email]> wrote:
Alexandru,

I understand you are dispatching an event from the JavaScript to the
server with ORBEON.xforms.Document.dispatchEvent("main-model",
"F4-keypress"). I imagine you dispatch it when users press F4. Is the
case that you would like to know what was the current field the user
was in when this happened?

Regarding your second point, I am not sure to understand what you want
to do. Could you describe this in more details, and maybe give us an
example?

Alex

On Fri, Jan 29, 2010 at 1:23 AM, Alexandru Ionita
<[hidden email]> wrote:
>
>
> Hello guys,
> here I am again with two questions:
> 1. How can I identify the XPATH that is backing a input text which was
> detected through JS as a source element of a keyPress event. The event is
> dispatched as follows:
> ORBEON.xforms.Document.dispatchEvent("main-model", "F4-keypress")
> 2nd, I need to build a dynamic form in a pop-up window based on a known XML
> model. Is this possible?
>
> thank you,
> Alexandru
>
> --
> 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
Orbeon's Blog: http://www.orbeon.com/blog/
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







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