rk.XML.logic: Create XML logic section for RKWard plugins

View source: R/rk.XML.logic.R

rk.XML.logicR Documentation

Create XML logic section for RKWard plugins

Description

This function will create a logic section with "convert", "connect", "include", "insert", "external" and "set" nodes. You can also include JavaScript code to use the locig scripting features of RKWard, if you place it in a comment with rk.comment: Its contents will automatically be placed inside a <script><![CDATA[ ]]></script> node.

Usage

rk.XML.logic(...)

Arguments

...

Objects of class XiMpLe.node.

Value

An object of class XiMpLe.node.

See Also

rk.XML.convert, rk.XML.connect, rk.XML.external, rk.XML.set, rk.XML.switch, and the Introduction to Writing Plugins for RKWard

Examples

# define an input field and two checkboxes
test.input <- rk.XML.input("Type some text")
test.cbox1 <- rk.XML.cbox(label="Want to type?", value="true")
test.cbox2 <- rk.XML.cbox(label="Are you shure?", value="true")
# now create some logic so that the input field is only enabled when both boxes are checked
test.convert <- rk.XML.convert(c(state=test.cbox1,state=test.cbox2), mode=c(and=""))
test.connect <- rk.XML.connect(governor=test.convert, client=test.input, set="enabled")
test.logic <- rk.XML.logic(test.convert, test.connect)
cat(pasteXML(test.logic))

# with only one checkbox, you can directly query if it's checked
test.connect2 <- rk.XML.connect(governor=test.cbox1, client=test.input, set="enabled")
test.logic2 <- rk.XML.logic(test.connect2)
cat(pasteXML(test.logic2))

rkward-community/rkwarddev documentation built on May 9, 2022, 3:02 p.m.