Wednesday, 11 September 2013

R gwidgets: Dynamic update of gcheckboxgroup with change in gcombobox input

R gwidgets: Dynamic update of gcheckboxgroup with change in gcombobox input

I am using gcombobox to select the input and populating checkbox
dynamically and it's working properly but when I am selecting second input
it's not clearing the first output(checkbox) and appending on first one
ending up two checkbox and so on.. Is there a way to clear the first input
or reflect only one checkbox at one time?
Below is the piece of code-
datanames<- c("mydata","yourdata")
f<-function(h,...)
{
x<-(data.frame(get(svalue(h$obj))))
xy<<-names(x)
ab<-gcheckboxgroup(xy,checked = FALSE,
handler = function(h,...)
s<<-(svalue(h$obj)),expand=TRUE, container =
gf2,use.table=TRUE)
}
w<-gwindow("action")
gp<-ggroup(horizontal=F,container=w)
gf1 = gframe(text="INPUT",cont=w,container=gp)
gf2 = gframe(text="SELECT",cont=w)
cb<-gcombobox(datanames,container=gf1,handler=f,expand=TRUE)
I don't know how to clear the gcheckboxgroup with change in gcombobox input.
Thanks! Om

No comments:

Post a Comment