Chris Picton wrote:
On Tue, 2003-12-30 at 23:05, Ulrich Nicolas Lissé wrote:
Chris Picton wrote:
Hi Joern
1. Can you attach a 'xforms:bind' to a group for the entire group and
elements within it to be hidden when the 'relevant' is false? My tests
are not working for this.
it should work in principle but there are still issues in the
stylesheet that prevent correct operation here. with a sample form it
shouldn't be too hard to fix. so, if you have an example send it over;
i'll try to get it running.
hi chris,
i guess you hit the point about relevance. your example form is fine,
except one thing: you have to use a 'nodeset' instead of a 'ref'
attribute on element 'bind'. it only works because there is a default
evaluation context (/*[1]), which accidentally selects the right node
(/your-favorite-color).
Thanks - didn't pick that up. The form still doesn't work with that
change, though.
Regarding my second question:
2. I would want the instance data associated with the hidden
elements to
be submitted even if the 'relevant' section is false. Can this be
done?
I think I have found a way (in theory) for this to work. However,
possibly chiba is not up to the task :)
I have attached my example form.
Basically, I have two instance models. The first one is the default
data, and the second one is a helper instance:
My instance and bind become:
<xforms:instance id="C-2" xmlns="">
<your-favorite-color/>
</xforms:instance>
<xforms:bind id="bind-color" nodeset="/your-favorite-color"
xforms:relevant="/your-favorite-color='blue' or
instance('submitting'/submit)=1" />
<xforms:instance id="submitting" xmlns="">
<submit>0</submit>
</xforms:instance>
My submission becomes:
<xforms:submission ..... xforms:method="post">
<xforms:setvalue ref="instance('submitting')/submit">1</xforms:setvalue>
</xforms:submission>
try <xforms:setvalue ref="..." value="1" />
Joern
So when submitting, the node is always relevant, but during the xform
edit cycle, relevance is tied to the required test.
However, chiba gives me a null pointer exception when loading the form:
java.lang.NullPointerException
at
org.apache.commons.jxpath.ClassFunctions.getFunction(ClassFunctions.java:134)
at
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getFunction(JXPathContextReferenceImpl.java:605)
at
org.apache.commons.jxpath.ri.axes.RootContext.getFunction(RootContext.java:153)
at
org.apache.commons.jxpath.ri.compiler.ExtensionFunction.computeValue(ExtensionFunction.java:129)
at
org.apache.commons.jxpath.ri.compiler.ExtensionFunction.compute(ExtensionFunction.java:117)
at
org.apache.commons.jxpath.ri.compiler.ExpressionPath.expressionPath(ExpressionPath.java:185)
at
org.apache.commons.jxpath.ri.compiler.ExpressionPath.compute(ExpressionPath.java:171)
at
org.apache.commons.jxpath.ri.compiler.CoreOperationCompare.equal(CoreOperationCompare.java:87)
at
org.apache.commons.jxpath.ri.compiler.CoreOperationEqual.computeValue(CoreOperationEqual.java:71)
at
org.apache.commons.jxpath.ri.compiler.CoreOperationOr.computeValue(CoreOperationOr.java:73)
at
org.apache.commons.jxpath.ri.compiler.CoreFunction.functionBoolean(CoreFunction.java:617)
at
org.apache.commons.jxpath.ri.compiler.CoreFunction.computeValue(CoreFunction.java:295)
at
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:293)
at
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:332)
at
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathContextReferenceImpl.java:328)
at
org.chiba.xml.xforms.constraints.RelevantVertex.compute(RelevantVertex.java:137)
at
org.chiba.xml.xforms.constraints.DependencyGraph.recalculate(DependencyGraph.java:325)
at org.chiba.xml.xforms.Model.recalculate(Model.java:368)
at org.chiba.xml.xforms.Model.performDefault(Model.java:472)
at
org.chiba.xml.xforms.XFormsDocument.performDefault(XFormsDocument.java:149)
at
org.chiba.xml.xforms.XFormsDocument.dispatchEvent(XFormsDocument.java:137)
at org.apache.xerces.dom.NodeImpl.dispatchEvent(Unknown Source)
at org.chiba.xml.xforms.Container.dispatch(Container.java:474)
at org.chiba.xml.xforms.Model.modelConstruct(Model.java:550)
at org.chiba.xml.xforms.Model.performDefault(Model.java:439)
at
org.chiba.xml.xforms.XFormsDocument.performDefault(XFormsDocument.java:149)
at
org.chiba.xml.xforms.XFormsDocument.dispatchEvent(XFormsDocument.java:137)
at org.apache.xerces.dom.NodeImpl.dispatchEvent(Unknown Source)
at org.chiba.xml.xforms.Container.dispatch(Container.java:474)
at org.chiba.xml.xforms.Container.initModels(Container.java:624)
at org.chiba.xml.xforms.Container.init(Container.java:345)
at org.chiba.xml.xforms.ChibaBean.init(ChibaBean.java:469)
at org.chiba.adapter.web.ServletAdapter.init(ServletAdapter.java:199)
at org.chiba.adapter.web.ChibaServlet.doGet(ChibaServlet.java:253)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
at java.lang.Thread.run(Thread.java:534)
------------------------------------------------------------------------
1 0
Choose your favorite Colour
This is a demonstration of the XForms 'switch' UI construct which
allows conditional User Interfaces. Additionally, XML Events are
used to address the 'switch' with a 'select1' control.
Choose by Button blue red yellow Choose by Radio Color Blue blue Red red
Yellow yellow The specified value is invalid Select Reset debug
Hello Blue Lover
Hello Red Lover
Hello Yellow Lover
Hello Second Blue
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|