[rkward-devel] Dynamic wizards for rkward plugins

Birk Diedenhofen mail at birkdiedenhofen.de
Thu Apr 19 12:54:36 UTC 2012


Hi!

> simply specify an "id.name" for each page in question. Then you can connect
> the property pageid.visible to an appropriate "governor" property.

This basically works. Thanks a lot!
But there seems to be a display error.
The example code here should clarify the problem:

require(rkwarddev)
local({
  foo.input <- rk.XML.radio("Foo input",
    id.name="foo_input",
    options=list(
      "Show me foo"=c(val="show"),
      "Skip foo"=c(val="skip")
    )
  )

  foo.input.page <- rk.XML.page(foo.input)
  foo.page <- rk.XML.page(rk.XML.text("foo"))
  bar.page <- rk.XML.page(rk.XML.text("bar"))

  full.wizard <- rk.XML.wizard(label="test", foo.input.page, foo.page, bar.page)

  foo.input.convert <- rk.XML.convert(sources=list(string=foo.input),
mode=c(equals="show"), id.name="foo_input_convert")
  foo.page.connect <- rk.XML.connect(governor=foo.input.convert,
client=foo.page, set="visible")

  logic <- rk.XML.logic(foo.input.convert, foo.page.connect)

  plugin.dir <<- rk.plugin.skeleton("test",
    xml=list(wizard=full.wizard, logic=logic),
    pluginmap=list(name="test", hierarchy=list("test", "test")),
    load=TRUE,
    edit=TRUE,
    show=TRUE,
    overwrite=TRUE
  )
})

When you run the wizard, the foo.page is already shown on top of the
foo.input.page and its visibility can be toggled using the radio input.
The same effect occurs if you do the following:
  1. Select "Show me foo"
  2. Click "Next"
  3. Click "Previous"
  4. Select "Skip foo
  5. Select "Show me foo"


Regards
Birk


Thomas Friedrichsmeier <thomas.friedrichsmeier at ruhr-uni-bochum.de> hat am 18.
April 2012 um 10:38 geschrieben:
> Hi,
>
> On Tuesday 17 April 2012, Birk Diedenhofen wrote:
> > I'm currently working on a rkward plugin using the rkwarddev package.
> > Thanks to the copy function, it is very easy to offer a wizard in addition
> > to the main dialogue.
> >
> > My question is: How can I dynamically show or hide certain wizard pages
> > depending on the user input on pervious pages? The user should only be
> > confronted with input dialogues that are really required.
>
> simply specify an "id.name" for each page in question. Then you can connect
> the property pageid.visible to an appropriate "governor" property. Is that
> enough to get you going? Otherwise, please give us some more detail to look
> at.
>
> Note that the use of wizards is still pretty rare in RKWard. If you run into
> any issues, please let us know.
>
> Regards
> Thomas




More information about the Rkward-devel mailing list