How to retrieve a form's initial data?

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

How to retrieve a form's initial data?

Doug Whitehead
What value will access "the initial data"? 

Info below is from the wiki developer-guide under configuration-properties-form-runner

Submit Dialog - "Go" URI

When the "go" button is pressed, users will be taken to the URI specified by the following property. The value of the property is an XPath expression evaluated in the context of the form instance. This allows you both to have a "dynamic" URI (which depends on the initial data or data entered by users) or a "static" URI in the form of a URI between single quote in the XPath expression.

<property as="xs:string"  name="oxf.fr.detail.submit.go.uri-xpath.*.*" value="/book/details/link"/>


--
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 retrieve a form's initial data?

Alessandro  Vernet
Administrator
Doug,

On Wed, Nov 11, 2009 at 9:40 PM, Doug Whitehead
<[hidden email]> wrote:
> What value will access "the initial data"?
>
> Info below is from the wiki developer-guide under
> configuration-properties-form-runner
>
> Submit Dialog - "Go" URI

Sorry, but I don't understand your question. Maybe you could tell us
more about what you are trying to do, how you are doing it, and what
fails.

Alex
--
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: How to retrieve a form's initial data?

Doug Whitehead
Alex,

I was trying to put a comment in the initial data for a form so that I could dynamically pass info to the form runner. 
This comment contained the URI to be used by the go action. 
This avoided polluting the XML instance structure with UI hints that have little to do with the form.

So I could use something like  
<property as="xs:string"  name="oxf.fr.detail.submit.go.uri-xpath.*.*" value="//comment[last()]"/>

This worked on a nightly builds within the last month or so. 
But now the instance that the go action is executed against seems to be the one constructed by the form.
I can see how one might want to use the data entered by the user to dynamically construct the go URI.
But this is not my usecase. The form's constructed XML instance clearly wouldn't have the comment, so my URI hint is lost.

So my question is, how do I select against the form initial XML data?



On Thu, Nov 12, 2009 at 11:11 PM, Alessandro Vernet <[hidden email]> wrote:
Doug,

On Wed, Nov 11, 2009 at 9:40 PM, Doug Whitehead
<[hidden email]> wrote:
> What value will access "the initial data"?
>
> Info below is from the wiki developer-guide under
> configuration-properties-form-runner
>
> Submit Dialog - "Go" URI

Sorry, but I don't understand your question. Maybe you could tell us
more about what you are trying to do, how you are doing it, and what
fails.

Alex
--
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: Re: How to retrieve a form's initial data?

Alessandro  Vernet
Administrator
Doug,

On Fri, Nov 13, 2009 at 2:20 PM, Doug Whitehead
<[hidden email]> wrote:
> But this is not my usecase. The form's constructed XML instance clearly
> wouldn't have the comment, so my URI hint is lost.
> So my question is, how do I select against the form initial XML data?

And this instance that contains the <comment> is another instance? How
did you add this other instance? By editing the source? I guess you
can then write instance('my-instance')//comment[last()], assuming
"my-instance" is the id of that instance. Does this make sense, or did
I misunderstand you?

Alex
--
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: Re: Re: How to retrieve a form's initial data?

Doug Whitehead
Alex,

I have implemented the persistence API. As such, my code at the proper URL is invoked to return XML to initialize the form instance data.
And I slipped in an XML comment into the return string. For example, my code might return the following

<form>
  <section-1>
    <name>Doug</name>
  </section-1>
</form>

This XML is well formed, does not break validation, and can initialize the form properly (assuming I had the proper trivial form with a name field in section-1).
The output of the form's XML would not have the comment. So I need to XQuery against the initialization instance, not the form output instance. And apparently the initialization instance is not kept around... thus my problem.

This did work at one time, apparently the submit.go.uri-xpath variable was matched against the initialization instance, but does not now. In using the debugging instance inspector/widget, I don't see the initialization instance floating around.

I could retrieve the XML data from the initialization URL again (perhaps a bit inefficient, but it should work).

I have since worked around this by crafting the URL in the submit.go.uri-xpath variable directly. 
Its one of those ungodly multi-line monstrosities defined in terms of available XML in various instances that I could find.

Doug


On Mon, Nov 16, 2009 at 11:26 PM, Alessandro Vernet <[hidden email]> wrote:
Doug,

On Fri, Nov 13, 2009 at 2:20 PM, Doug Whitehead
<[hidden email]> wrote:
> But this is not my usecase. The form's constructed XML instance clearly
> wouldn't have the comment, so my URI hint is lost.
> So my question is, how do I select against the form initial XML data?

And this instance that contains the <comment> is another instance? How
did you add this other instance? By editing the source? I guess you
can then write instance('my-instance')//comment[last()], assuming
"my-instance" is the id of that instance. Does this make sense, or did
I misunderstand you?

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