I have been trying to find a way to have a button clear a grid or section.
What I am hoping to do is have a button in the gird that will remove all values that have been entered. I have a few sections with 40 plus controls that I would need to clear. Example: I want to clear 2 radio buttons and a textarea when a button is pressed. I have tried using the lines below. <xxforms:variable name="Username-name" select="'******'" as="xstring"/> <xforms:setvalue ref="instance('fr-form-instance')/*/*[name() = $*****-name]" value=""/> Or how would I use the line below to uncheck a radio button. ORBEON.xforms.Document.setValue("foo", Number(fooValue) + 1); If anyone has any ideas or can point me to a post that is similar that would be great. Thanks for your time! - Kevin |
Hi Kevin,
This should possible by setting the <xforms:action> for the buttion / trigger, and it should not be necessary to use the JavaScript hook (and indeed i think there may be some side effects with that.
<xforms:trigger> <xforms:label>Clear</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:setvalue ref="??????" value="''"/>
</xforms:action> </xforms:trigger> I hope that helps. The XForms engine should redraw the controls. HTH, Hank
On Wed, Feb 15, 2012 at 12:24 PM, krowe <[hidden email]> wrote: I have been trying to find a way to have a button clear a grid or section. Hank Ratzesberger XMLWerks.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 |
Krowe,
As Erik mentioned in the other thread you could use xxf:iterate. https://gist.github.com/1837412 Replace the input from the example with a trigger <xf:input ref="readonly"> <xf:setvalue ev:event="xforms-value-changed" xxf:iterate="../section/*" ref="."/>
</xf:input> to <xforms:trigger> <xforms:label>Clear</xforms:label> <xforms:action ev:event="DOMActivate">
<xf:setvalue ev:event="xforms-value-changed" xxf:iterate="../section/*" ref="."/>
</xforms:action> </xforms:trigger>
On Thu, Feb 16, 2012 at 2:33 PM, Hank Ratzesberger <[hidden email]> wrote: Hi Kevin, -- 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 |