Asynchronous submission

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

Asynchronous submission

Lingesh_Palanivelu

Hi Team,

 

I need to perform an Ajax functionality on click of an accordion. Now for just checking the xforms:submission asynchronous mode I’m using a trigger to check the functionality.

 

I’m able to hit the xpl and while checking in the log I’m getting the response. However I’m not able to set the response to a particular instance. Below is the code, please validate it and help me out in solving this issue. And also how to trigger this asynchronous submission during the click event  on a particular accordion case?

 

Initial Instance used:

<xforms:instance id="email-instance">

<form>

                                <emails>

                                <email1/>

                                <email2/>

                                </emails>

                </form>                                                              

</xforms:instance>

 

Asynchronous submission:

 

<xforms:submission id="ajax-call" mode="asynchronous" method="get" resource="/EmailInstellingen/ajaxload"  serialization="none" replace="instance('email-instance')"  targetref="instance('email-instance')"/>

 

Input element that refers to the particular instance

<xforms:input ref="instance('email-instance')//emails/email1" id="email1" xxforms:maxlength="16">

                <xforms:label class="labelwrapper">Email</xforms:label>

</xforms:input>

 

 

 

 

XPL used:

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"

        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

        xmlns:saxon="http://saxon.sf.net/"

        xmlns:oxf="http://www.orbeon.com/oxf/processors"

        xmlns:xs="http://www.w3.org/2001/XMLSchema"

        xmlns:xdb="http://orbeon.org/oxf/xml/xmldb"

        xmlns:f="http://www.orbeon.com/oxf/function">

 

    <p:param name="data" type="output"/>

 

    <p:processor name="oxf:xslt">

        <p:input name="data" href="zip-flat.xml"/>

        <p:input name="config">

            <form xsl:version="2.0" xmlns="">

                                                                <emails>

                                                                                <email1>[hidden email]</email1>

                                                                                <email2>[hidden email]</email2>

                                                                </emails>

                                                </form>                                                              

        </p:input>

        <p:output name="data" ref="data" id="outputdata"/>

    </p:processor>

               

               

                <p:processor name="oxf:xml-serializer">

        <p:input name="data" href="#outputdata" />

        <p:input name="config">

            <config/>

        </p:input>                 

    </p:processor>

 

</p:config>

 

 

 

Response in the log:

2011-06-30 11:25:35,602 INFO  ProcessorService  - /EmailInstellingen/ajaxload - Timing: 438 - Cache hits for cache.main: 225, fault: 0, adds: 0, expirations: 0, success rate: 100%

2011-06-30 11:25:35,617 DEBUG wire  - << "HTTP/1.1 200 OK[\r][\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "Server: Apache-Coyote/1.1[\r][\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "Last-Modified: Thu, 30 Jun 2011 05:09:25 GMT[\r][\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "Expires: Thu, 30 Jun 2011 05:55:35 GMT[\r][\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "Cache-Control: private, max-age=0[\r][\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "Pragma: [\r][\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "Content-Type: application/xml;charset=utf-8[\r][\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "Content-Length: 439[\r][\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "Date: Thu, 30 Jun 2011 05:55:35 GMT[\r][\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "[\r][\n]"

2011-06-30 11:25:35,617 DEBUG DefaultClientConnection  - Receiving response: HTTP/1.1 200 OK

2011-06-30 11:25:35,617 DEBUG headers  - << HTTP/1.1 200 OK

2011-06-30 11:25:35,617 DEBUG headers  - << Server: Apache-Coyote/1.1

2011-06-30 11:25:35,617 DEBUG headers  - << Last-Modified: Thu, 30 Jun 2011 05:09:25 GMT

2011-06-30 11:25:35,617 DEBUG headers  - << Expires: Thu, 30 Jun 2011 05:55:35 GMT

2011-06-30 11:25:35,617 DEBUG headers  - << Cache-Control: private, max-age=0

2011-06-30 11:25:35,617 DEBUG headers  - << Pragma:

2011-06-30 11:25:35,617 DEBUG headers  - << Content-Type: application/xml;charset=utf-8

2011-06-30 11:25:35,617 DEBUG headers  - << Content-Length: 439

2011-06-30 11:25:35,617 DEBUG headers  - << Date: Thu, 30 Jun 2011 05:55:35 GMT

2011-06-30 11:25:35,617 DEBUG DefaultHttpClient  - Connection can be kept alive indefinitely

2011-06-30 11:25:35,617 DEBUG wire  - << "<?xml version="1.0" encoding="utf-8"?>[\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "<form xmlns:saxon="http://saxon.sf.net/" xmlns:xs="http://www.w3.org/2001/XMLSchema"[\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "      xmlns:f="http://www.orbeon.com/oxf/function"[\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "      xmlns:oxf="http://www.orbeon.com/oxf/processors"[\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "      xmlns:p="http://www.orbeon.com/oxf/pipeline"[\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "      xmlns:xdb="http://orbeon.org/oxf/xml/xmldb">[\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << " <emails>[\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "  <email1>[hidden email]</email1>[\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "  <email2>[hidden email]</email2>[\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << " </emails>[\n]"

2011-06-30 11:25:35,617 DEBUG wire  - << "</form>"

2011-06-30 11:25:35,617 ERROR XFormsServer  - xforms-submit-error - response {status code: "200"}

2011-06-30 11:25:35,617 ERROR XFormsServer  - xforms-submit-error - response headers {content-type: "application/xml;charset=utf-8", cache-control: "private, max-age=0", expires: "Thu, 30 Jun 2011 05:55:35 GMT", last-modified: "Thu, 30 Jun 2011 05:09:25 GMT", content-length: "439", server: "Apache-Coyote/1.1", date: "Thu, 30 Jun 2011 05:55:35 GMT", pragma: ""}

2011-06-30 11:25:35,617 DEBUG ThreadSafeClientConnManager  - Released connection is reusable.

2011-06-30 11:25:35,617 DEBUG ConnPoolByRoute  - Releasing connection [HttpRoute[{}->http://localhost:8082]][null]

2011-06-30 11:25:35,617 DEBUG ConnPoolByRoute  - Pooling connection [HttpRoute[{}->http://localhost:8082]][null]; keep alive indefinitely

2011-06-30 11:25:35,617 DEBUG ConnPoolByRoute  - Notifying no-one, there are no waiting threads

2011-06-30 11:25:35,617 ERROR XFormsServer  - xforms-submit-error - setting body document {body: "

<?xml version="1.0" encoding="utf-8"?><form xmlns:saxon="http://saxon.sf.net/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:f="http://www.orbeon.com/oxf/function" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:xdb="http://orbeon.org/oxf/xml/xmldb">

<emails>

  <email1>[hidden email]</email1>

  <email2>[hidden email]</email2>

</emails>

</form>"}

2011-06-30 11:25:35,617 DEBUG XFormsServer  -                   end running asynchronous submission {time (ms): "453", id: "ajax-call", asynchronous: "true", connected: "true", deserialized: "false"}

 

 

 

 

Thanks and Regards,

Lingesh P

 



DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.


--
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: Asynchronous submission

Erik Bruchez
Administrator
Your "replace" attribute must just contain "instance":

replace="instance"

-Erik

On Wed, Jun 29, 2011 at 10:58 PM, Lingesh_Palanivelu
<[hidden email]> wrote:

> Hi Team,
>
>
>
> I need to perform an Ajax functionality on click of an accordion. Now for
> just checking the xforms:submission asynchronous mode I’m using a trigger to
> check the functionality.
>
>
>
> I’m able to hit the xpl and while checking in the log I’m getting the
> response. However I’m not able to set the response to a particular instance.
> Below is the code, please validate it and help me out in solving this issue.
> And also how to trigger this asynchronous submission during the click event
>  on a particular accordion case?
>
>
>
> Initial Instance used:
>
> <xforms:instance id="email-instance">
>
> <form>
>
>                                 <emails>
>
>                                 <email1/>
>
>                                 <email2/>
>
>                                 </emails>
>
>
> </form>
>
> </xforms:instance>
>
>
>
> Asynchronous submission:
>
>
>
> <xforms:submission id="ajax-call" mode="asynchronous" method="get"
> resource="/EmailInstellingen/ajaxload"  serialization="none"
> replace="instance('email-instance')"
>  targetref="instance('email-instance')"/>
>
>
>
> Input element that refers to the particular instance
>
> <xforms:input ref="instance('email-instance')//emails/email1" id="email1"
> xxforms:maxlength="16">
>
>                 <xforms:label class="labelwrapper">Email</xforms:label>
>
> </xforms:input>
>
>
>
>
>
>
>
>
>
> XPL used:
>
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>
>         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
>         xmlns:saxon="http://saxon.sf.net/"
>
>         xmlns:oxf="http://www.orbeon.com/oxf/processors"
>
>         xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
>         xmlns:xdb="http://orbeon.org/oxf/xml/xmldb"
>
>         xmlns:f="http://www.orbeon.com/oxf/function">
>
>
>
>     <p:param name="data" type="output"/>
>
>
>
>     <p:processor name="oxf:xslt">
>
>         <p:input name="data" href="zip-flat.xml"/>
>
>         <p:input name="config">
>
>             <form xsl:version="2.0" xmlns="">
>
>                                                                 <emails>
>
>
> <email1>[hidden email]</email1>
>
>
> <email2>[hidden email]</email2>
>
>                                                                 </emails>
>
>
> </form>
>
>         </p:input>
>
>         <p:output name="data" ref="data" id="outputdata"/>
>
>     </p:processor>
>
>
>
>
>
>                 <p:processor name="oxf:xml-serializer">
>
>         <p:input name="data" href="#outputdata" />
>
>         <p:input name="config">
>
>             <config/>
>
>         </p:input>
>
>     </p:processor>
>
>
>
> </p:config>
>
>
>
>
>
>
>
> Response in the log:
>
> 2011-06-30 11:25:35,602 INFO  ProcessorService  -
> /EmailInstellingen/ajaxload - Timing: 438 - Cache hits for cache.main: 225,
> fault: 0, adds: 0, expirations: 0, success rate: 100%
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "HTTP/1.1 200 OK[\r][\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "Server: Apache-Coyote/1.1[\r][\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "Last-Modified: Thu, 30 Jun 2011
> 05:09:25 GMT[\r][\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "Expires: Thu, 30 Jun 2011 05:55:35
> GMT[\r][\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "Cache-Control: private,
> max-age=0[\r][\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "Pragma: [\r][\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "Content-Type:
> application/xml;charset=utf-8[\r][\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "Content-Length: 439[\r][\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "Date: Thu, 30 Jun 2011 05:55:35
> GMT[\r][\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "[\r][\n]"
>
> 2011-06-30 11:25:35,617 DEBUG DefaultClientConnection  - Receiving response:
> HTTP/1.1 200 OK
>
> 2011-06-30 11:25:35,617 DEBUG headers  - << HTTP/1.1 200 OK
>
> 2011-06-30 11:25:35,617 DEBUG headers  - << Server: Apache-Coyote/1.1
>
> 2011-06-30 11:25:35,617 DEBUG headers  - << Last-Modified: Thu, 30 Jun 2011
> 05:09:25 GMT
>
> 2011-06-30 11:25:35,617 DEBUG headers  - << Expires: Thu, 30 Jun 2011
> 05:55:35 GMT
>
> 2011-06-30 11:25:35,617 DEBUG headers  - << Cache-Control: private,
> max-age=0
>
> 2011-06-30 11:25:35,617 DEBUG headers  - << Pragma:
>
> 2011-06-30 11:25:35,617 DEBUG headers  - << Content-Type:
> application/xml;charset=utf-8
>
> 2011-06-30 11:25:35,617 DEBUG headers  - << Content-Length: 439
>
> 2011-06-30 11:25:35,617 DEBUG headers  - << Date: Thu, 30 Jun 2011 05:55:35
> GMT
>
> 2011-06-30 11:25:35,617 DEBUG DefaultHttpClient  - Connection can be kept
> alive indefinitely
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "<?xml version="1.0"
> encoding="utf-8"?>[\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "<form
> xmlns:saxon="http://saxon.sf.net/"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"[\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "
> xmlns:f="http://www.orbeon.com/oxf/function"[\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "
> xmlns:oxf="http://www.orbeon.com/oxf/processors"[\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "
> xmlns:p="http://www.orbeon.com/oxf/pipeline"[\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "
> xmlns:xdb="http://orbeon.org/oxf/xml/xmldb">[\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << " <emails>[\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "
> <email1>[hidden email]</email1>[\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "
> <email2>[hidden email]</email2>[\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << " </emails>[\n]"
>
> 2011-06-30 11:25:35,617 DEBUG wire  - << "</form>"
>
> 2011-06-30 11:25:35,617 ERROR XFormsServer  - xforms-submit-error - response
> {status code: "200"}
>
> 2011-06-30 11:25:35,617 ERROR XFormsServer  - xforms-submit-error - response
> headers {content-type: "application/xml;charset=utf-8", cache-control:
> "private, max-age=0", expires: "Thu, 30 Jun 2011 05:55:35 GMT",
> last-modified: "Thu, 30 Jun 2011 05:09:25 GMT", content-length: "439",
> server: "Apache-Coyote/1.1", date: "Thu, 30 Jun 2011 05:55:35 GMT", pragma:
> ""}
>
> 2011-06-30 11:25:35,617 DEBUG ThreadSafeClientConnManager  - Released
> connection is reusable.
>
> 2011-06-30 11:25:35,617 DEBUG ConnPoolByRoute  - Releasing connection
> [HttpRoute[{}->http://localhost:8082]][null]
>
> 2011-06-30 11:25:35,617 DEBUG ConnPoolByRoute  - Pooling connection
> [HttpRoute[{}->http://localhost:8082]][null]; keep alive indefinitely
>
> 2011-06-30 11:25:35,617 DEBUG ConnPoolByRoute  - Notifying no-one, there are
> no waiting threads
>
> 2011-06-30 11:25:35,617 ERROR XFormsServer  - xforms-submit-error - setting
> body document {body: "
>
> <?xml version="1.0" encoding="utf-8"?><form
> xmlns:saxon="http://saxon.sf.net/"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:f="http://www.orbeon.com/oxf/function"
> xmlns:oxf="http://www.orbeon.com/oxf/processors"
> xmlns:p="http://www.orbeon.com/oxf/pipeline"
> xmlns:xdb="http://orbeon.org/oxf/xml/xmldb">
>
> <emails>
>
>   <email1>[hidden email]</email1>
>
>   <email2>[hidden email]</email2>
>
> </emails>
>
> </form>"}
>
> 2011-06-30 11:25:35,617 DEBUG XFormsServer  -                   end running
> asynchronous submission {time (ms): "453", id: "ajax-call", asynchronous:
> "true", connected: "true", deserialized: "false"}
>
>
>
>
>
>
>
>
>
> Thanks and Regards,
>
> Lingesh P
>
>
>
> ________________________________
> DISCLAIMER:
> This email (including any attachments) is intended for the sole use of the
> intended recipient/s and may contain material that is CONFIDENTIAL AND
> PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
> distribution or forwarding of any or all of the contents in this message is
> STRICTLY PROHIBITED. If you are not the intended recipient, please contact
> the sender by email and delete all copies; your cooperation in this regard
> is appreciated.
>
>
> --
> 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