rk.XML.option: Create XML node "option" for RKWard plugins

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

rk.XML.optionR Documentation

Create XML node "option" for RKWard plugins

Description

Create XML node "option" for RKWard plugins

Usage

rk.XML.option(label, val = NULL, chk = FALSE, id.name = NULL, i18n = NULL)

Arguments

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 TRUE in the one option which is checked by default.

id.name

Character string, a unique ID for this plugin element. If "auto" and a label was provided, an ID will be generated automatically from the label.

i18n

Either a character string or a named list with the optional elements context or comment, to give some i18n_context information for this node. If set to FALSE, the attribute label will be renamed into noi18n_label.

Value

An object of class XiMpLe.node.

Note

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.

See Also

Introduction to Writing Plugins for RKWard

Examples

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))

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