[rkward-cvs] SF.net SVN: rkward-code:[4547] trunk/rkward/packages/rkwarddev
m-eik at users.sf.net
m-eik at users.sf.net
Thu Feb 21 11:03:29 UTC 2013
Revision: 4547
http://sourceforge.net/p/rkward/code/4547
Author: m-eik
Date: 2013-02-21 11:03:28 +0000 (Thu, 21 Feb 2013)
Log Message:
-----------
rkwarddev: made guess.getter smarter for <checkbox>es. it now uses getBollean() if value/value_unchecked are "true" or "false", and getString() otherwise. if guess.getter is FALSE, the default remains getValue().
Modified Paths:
--------------
trunk/rkward/packages/rkwarddev/R/rk-internal.R
trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
Modified: trunk/rkward/packages/rkwarddev/R/rk-internal.R
===================================================================
--- trunk/rkward/packages/rkwarddev/R/rk-internal.R 2013-02-21 00:10:41 UTC (rev 4546)
+++ trunk/rkward/packages/rkwarddev/R/rk-internal.R 2013-02-21 11:03:28 UTC (rev 4547)
@@ -298,10 +298,19 @@
tag.name <- XMLName(XML.var)
} else if(is.null(tag.name)){
# hm, not a XiMpLe object and no known tag name :-/
- tag.name <- XMLName(XMLChildren(parseXMLTree(XML.var, object=TRUE))[[1]])
+ XML.var <- XMLChildren(parseXMLTree(XML.var, object=TRUE))[[1]]
+ tag.name <- XMLName(XML.var)
} else {}
if(tag.name %in% names(JS.getters.default)){
- getter <- JS.getters.default[[tag.name]]
+ # special case: is a <checkbox> has a value other than
+ # "true" or "false", it's probably supposed to be fetched
+ # as string, not boolean
+ if(is.XiMpLe.node(XML.var) && identical(tag.name, "checkbox") &&
+ any(!c(XMLAttrs(XML.var)[["value"]], XMLAttrs(XML.var)[["value_unchecked"]]) %in% c("true","false"))){
+ getter <- "getString"
+ } else {
+ getter <- JS.getters.default[[tag.name]]
+ }
} else {}
} else {}
XML.var <- check.ID(XML.var)
Modified: trunk/rkward/packages/rkwarddev/inst/doc/rkwarddev_vignette.pdf
===================================================================
(Binary files differ)
More information about the rkward-tracker
mailing list