Hi,
In oxf v1.5 we used to use xxforms:error in instance for showing serverside error. Following is the code we had in the xforms pages:
<xhtml:global-errors>
<xforms:repeat nodeset="errors/error">
<xforms:output ref=".">
<xforms:alert/>
</xforms:output>
</xforms:repeat>
</xhtml:global-errors>
And in theme.xsl we used to pop up a new window for
showing the error message. Following is the code in
theme:
<xsl:template match="xhtml:global-errors">
<xsl:variable name="display-as-popup" select="true()"/>
<xsl:apply-templates select="xhtml:input"/>
<xsl:variable name="error-table">
<table border="0" cellspacing="0" cellpadding="0"
style="margin-bottom: 1em">
<tr>
<td width="10"></td>
<td>
<b>Following error(s)
occured:</b><br/><br/>
</td>
</tr>
<xsl:for-each select="xforms:alert">
<tr>
<td></td>
<td style="padding-left: .2em; color: red" width="100%">
<span class="gen"><xsl:value-of select="concat('Error',position(),' : ',@xxforms:error)"/></span>
</td>
</tr>
</xsl:for-each>
<tr>
<td width="10"></td>
<td align="center">
<br/><input type="submit" value="Close" >
</td>
</tr>
</table>
</xsl:variable>
<!-- Open popup with errors -->
<xsl:if test="xforms:alert">
<script language="_javascript_">
<xsl:variable name="error-string" select="java:org.orbeon.oxf.xml.XMLUtils.domToString(exslt:node-set($error-table)/*)"/>
<xsl:variable name="error-one-line" select="java:org.apache.commons.lang.StringUtils.replace(java:org.apache.commons.lang.StringUtils.replace($error-string, '
', ''),'
', '')"/>
window.open('', '_blank', 'height=200,width=400,status=no,toolbar=no,menubar=no,location=no').document.write('<xsl:value-of select="$error-one-line"/>');
</script>
</xsl:if>
</xsl:template>
After installing v2.6 this functionality has stopped working. Even if the error message is there in the instance the xforms pages does not seem to read it.
Thanks,
Anindita |
|
----------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.
----------------------------------------------------------------------------------------