View source: R/rk.XML.option.R
rk.XML.option | R Documentation |
Create XML node "option" for RKWard plugins
rk.XML.option(label, val = NULL, chk = FALSE, id.name = NULL, i18n = NULL)
label |
Character string, a text label for this plugin element. |
val |
Character string, defines the value to submit if the option is checked. |
chk |
Logical,
should be set |
id.name |
Character string, a unique ID for this plugin element.
If |
i18n |
Either a character string or a named list with the optional elements |
An object of class XiMpLe.node
.
You will rarely need this function, as options can be defined directly as a list
in applicable functions like rk.XML.radio
. The main
purpose for having this function is to set an ID for a particular option, e.g. to be able
to hide it by logic rules.
To address such an option in your logic section, the id
you need is a combination of <parent id>.<option id>
. That is,
you must always prefix it with the parent's id
. If you use the object
an object generated by this function inside a parent node, both IDs will
automatically be stored internally, so that the correct prefix will be added
if needed whenever you apply logic rules to the option object.
Introduction to Writing Plugins for RKWard
test.radio <- rk.XML.radio("Chose one", options=list( "First Option"=c(val="val1", chk=TRUE), test.radio.opt2 <- rk.XML.option("Second Option", val="val2", id.name="auto"), "third Option"=c(val="val3")) ) cat(pasteXML(test.radio))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.