Thread: [Xsltforms-support] [PATCH] @ev:phase attribute on xf:actions
Brought to you by:
alain-couthures
From: Kostis A. <ank...@gm...> - 2010-04-13 14:18:09
Attachments:
evPhaseAttr.diff
|
Hi, I've added the capability to define @ev:phase attributes on xf:actions. This patch also include a check of miss-typed phase tokens. Against rev385 (maintained tabs and indentation on sources) (unfortunately i could not build it, since make my apache's rewritting rules might to work) Regards, Kostis PS: 1) Is this mailling-list the right place to submit patches? 2) Should my patches also include the changes on the final xsltforms.{js,xsl} files? file: evPhaseAttr.diff ------------------------------- Index: src/js/xmlevtmngt/Listener.js.xml =================================================================== --- src/js/xmlevtmngt/Listener.js.xml (revision 383) +++ src/js/xmlevtmngt/Listener.js.xml (working copy) @@ -31,6 +31,12 @@ <![CDATA[ function Listener(observer, name, phase, handler) { phase = phase || "default"; + if (phase != "default" && phase != "capture") { + xforms.error(xforms.defaultModel, "xforms-compute-exception", + "Unknown event-phase(" + phase +") for event(" + + name + ")"+(observer? " on element(" + observer.id + ")":"") + "!"); + return; + } this.observer = observer; this.name = name; this.evtName = document.addEventListener? name : "errorupdate"; Index: src/xslt/script/named-templates/listeners.xsl.xml =================================================================== --- src/xslt/script/named-templates/listeners.xsl.xml (revision 383) +++ src/xslt/script/named-templates/listeners.xsl.xml (working copy) @@ -47,7 +47,12 @@ </xsl:choose> <xsl:text>"),</xsl:text> <xsl:call-template name="toScriptParam"><xsl:with-param name="p" select="@ev:event"/></xsl:call-template> - <xsl:text>,null,function(evt) {run(xf_</xsl:text> + <xsl:text>,</xsl:text> + <xsl:choose> + <xsl:when test="@ev:phase">'<xsl:value-of select="@ev:phase"/>'</xsl:when> + <xsl:otherwise>null</xsl:otherwise> + </xsl:choose> + <xsl:text>,function(evt) {run(xf_</xsl:text> <xsl:variable name="lname2" select="local-name()"/> <xsl:variable name="nsuri" select="namespace-uri()"/> <xsl:value-of select="$lname2"/> |
From: COUTHURES A. <ala...@ag...> - 2010-04-14 20:25:38
|
Hi, > I've added the capability to define @ev:phase attributes on xf:actions. > Yes! You have reactivated this since it seems that AJAXForms already supported this. I have not tested it but it sounds without consequences when not used so it's good to commit it. > This patch also include a check of miss-typed phase tokens. > This can be useful. Maybe this kind of check should be added in every situation. AJAXForms didn't have any in its Javascript part but in its Java part. Error handling with XSLT is not very easy: a Javascript instruction should be generated to display an error message. It means that there should be a check template for each element (with a specific @mode...). Whether full check would alter performance or not, I don't know... Thank you very much! -Alain |
From: Grégoire C. <gco...@gm...> - 2012-01-16 07:31:06
|
Hi, I just updated from 521 to 522 and I now get the following error on initialization : xforms-compute-exception I don't really understand what this means. It seems to come from these lines: <xf:model id="modele-configuration"> <xf:instance id="instance-configuration" src="/configuration"/> <xf:load ev:event="xforms-model-construct-done" resource="javascript:$('body').scrollTop(0);$(window).scrollTop(0);$('body').scrollLeft(0);$(window).scrollLeft(0);"/> </xf:model> Any help would be greatly appreciated! Grégoire Le 13/04/2010 16:17, Kostis Anagnostopoulos a écrit : > Hi, > > I've added the capability to define @ev:phase attributes on xf:actions. > > This patch also include a check of miss-typed phase tokens. > Against rev385 (maintained tabs and indentation on sources) > > (unfortunately i could not build it, since make my apache's rewritting > rules might to work) > > Regards, > Kostis > > PS: > 1) Is this mailling-list the right place to submit patches? > 2) Should my patches also include the changes on the final > xsltforms.{js,xsl} files? > > > file: evPhaseAttr.diff > ------------------------------- > > Index: src/js/xmlevtmngt/Listener.js.xml > =================================================================== > --- src/js/xmlevtmngt/Listener.js.xml (revision 383) > +++ src/js/xmlevtmngt/Listener.js.xml (working copy) > @@ -31,6 +31,12 @@ > <![CDATA[ > function Listener(observer, name, phase, handler) { > phase = phase || "default"; > + if (phase != "default" && phase != "capture") { > + xforms.error(xforms.defaultModel, "xforms-compute-exception", > + "Unknown event-phase(" + phase +") for event(" > + + name + ")"+(observer? " on element(" + observer.id > + ")":"") + "!"); > + return; > + } > this.observer = observer; > this.name = name; > this.evtName = document.addEventListener? name : "errorupdate"; > Index: src/xslt/script/named-templates/listeners.xsl.xml > =================================================================== > --- src/xslt/script/named-templates/listeners.xsl.xml (revision 383) > +++ src/xslt/script/named-templates/listeners.xsl.xml (working copy) > @@ -47,7 +47,12 @@ > </xsl:choose> > <xsl:text>"),</xsl:text> > <xsl:call-template name="toScriptParam"><xsl:with-param name="p" > select="@ev:event"/></xsl:call-template> > - <xsl:text>,null,function(evt) {run(xf_</xsl:text> > + <xsl:text>,</xsl:text> > + <xsl:choose> > + <xsl:when test="@ev:phase">'<xsl:value-of select="@ev:phase"/>'</xsl:when> > + <xsl:otherwise>null</xsl:otherwise> > + </xsl:choose> > + <xsl:text>,function(evt) {run(xf_</xsl:text> > <xsl:variable name="lname2" select="local-name()"/> > <xsl:variable name="nsuri" select="namespace-uri()"/> > <xsl:value-of select="$lname2"/> > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > > > > _______________________________________________ > Xsltforms-support mailing list > Xsl...@li... > https://lists.sourceforge.net/lists/listinfo/xsltforms-support |