Hello,
I have the following code: <xforms:submission id="importar-documento" ref="instance('file-instance')" method="post" replace="instance" instance="documento-instance" validate="false"> <xsl:attribute name="action"> /ImportData?nombreFormulario=tcu_info_adicional&tipo=<xsl:value-of select="doc('input:instance')/parametros/tipo"/>&modo=<xsl:value-of select="doc('input:instance')/parametros/modo"/>&idCuenta=<xsl:value-of select="doc('input:instance')/parametros/idCuenta"/>&ejercicio=<xsl:value-of select="doc('input:instance')/parametros/ejercicio"/>&cif=<xsl:value-of select="doc('input:instance')/parametros/cif"/>&ticket=<xsl:value-of select="doc('input:instance')/parametros/ticket"/>&app=<xsl:value-of select="doc('input:instance')/parametros/app"/> </xsl:attribute> <xforms:message ev:event="xforms-submit-error" level="modal">Se ha producido un error al intentar importar el formulario</xforms:message> </xforms:submission> And now, when the import doesn't work i want show an error. response.sendError(HttpServletResponse.SC_NOT_ACCEPTABLE, "Error en la validación del fichero"); With this code, it only shows the number of error, not the text. Do you know how can i do it? Thanks in advance! Jesús Consigue el nuevo Windows Live Messenger Pruébalo -- 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 |
Administrator
|
Jesús,
On 10/1/07, aa aa <[hidden email]> wrote: > /ImportData?nombreFormulario=tcu_info_adicional&tipo=<xsl:value-of > select="doc('input:instance')/parametros/tipo"/>&modo=<xsl:value-of > select="doc('input:instance')/parametros/modo"/>&idCuenta=<xsl:value-of > select="doc('input:instance')/parametros/idCuenta"/>&ejercicio=<xsl:value-of > select="doc('input:instance')/parametros/ejercicio"/>&cif=<xsl:value-of > select="doc('input:instance')/parametros/cif"/>&ticket=<xsl:value-of > select="doc('input:instance')/parametros/ticket"/>&app=<xsl:value-of > select="doc('input:instance')/parametros/app"/> > </xsl:attribute> I am not sure that the way you mixing XSLT and XForms gives you the result you expect. XSLT runs before XForms. So picture this: XSLT runs, some XHTML+XForms code is generated, and this is what the XForms engine sees. If you want the XForms engine to dynamically pull out the value of doc('input:instance')/parametros/modo, then instead of using XSLT you can use an AVT in your XForms code: action="... {doc('input:instance')/parametros/modo} ..." Of course, if using XSLT works for you, then everything is good :). I am not sure what is that call to response.sendError(). Do you want to call some JavaScript when there is an error? Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise http://www.orbeon.com/ -- 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 |
No, i don't want that.
I only want to show the error message instead of the error number. In my servlet (runs when somebody import a file) i have this: response.sendError(HttpServletResponse.SC_NOT_ACCEPTABLE, "Error en la validación del fichero"); With this, the page shows the number of the error (in this case, the SC_NOT_ACCEPTABLE number) but i want it shows "Error en la validación del fichero". > Date: Mon, 1 Oct 2007 18:18:18 -0700 > From: [hidden email] > To: [hidden email] > Subject: Re: [ops-users] Show error > > Jesús, > > On 10/1/07, aa aa <[hidden email]> wrote: > > /ImportData?nombreFormulario=tcu_info_adicional&tipo=<xsl:value-of > > select="doc('input:instance')/parametros/tipo"/>&modo=<xsl:value-of > > select="doc('input:instance')/parametros/modo"/>&idCuenta=<xsl:value-of > > select="doc('input:instance')/parametros/idCuenta"/>&ejercicio=<xsl:value-of > > select="doc('input:instance')/parametros/ejercicio"/>&cif=<xsl:value-of > > select="doc('input:instance')/parametros/cif"/>&ticket=<xsl:value-of > > select="doc('input:instance')/parametros/ticket"/>&app=<xsl:value-of > > select="doc('input:instance')/parametros/app"/> > > </xsl:attribute> > > I am not sure that the way you mixing XSLT and XForms gives you the > result you expect. XSLT runs before XForms. So picture this: XSLT > runs, some XHTML+XForms code is generated, and this is what the XForms > engine sees. If you want the XForms engine to dynamically pull out the > value of doc('input:instance')/parametros/modo, then instead of using > XSLT you can use an AVT in your XForms code: > > action="... {doc('input:instance')/parametros/modo} ..." > > Of course, if using XSLT works for you, then everything is good :). I > am not sure what is that call to response.sendError(). Do you want to > call some JavaScript when there is an error? > > Alex > -- > Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise > http://www.orbeon.com/ Consigue el nuevo Windows Live Messenger Pruébalo -- 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 |
Administrator
|
On 10/2/07, aa aa <[hidden email]> wrote:
> > No, i don't want that. > I only want to show the error message instead of the error number. In my > servlet (runs when somebody import a file) i have this: > > response.sendError(HttpServletResponse.SC_NOT_ACCEPTABLE, > "Error en la validación del fichero"); > > With this, the page shows the number of the error (in this case, the > SC_NOT_ACCEPTABLE number) but i want it shows "Error en la validación del > fichero". JavaScript or code you have on the server? How this comes into the XForms picture? Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise http://www.orbeon.com/ -- 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 |
Administrator
|
On 10/3/07, aa aa <[hidden email]> wrote:
> It's servlet code, in the server. OK, I see. Then I assume the message appears on the error page returned by the server. You can access it in XForms in the event handler for xforms-submit-error with event('body'), used in XPath. This returns the body of the error page as a string, so you then might have to parse it to get the text of the error. Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise http://www.orbeon.com/ -- 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 |
Free forum by Nabble | Edit this page |