0

Is it possible to set the datatype of a UserPref programmatically? I am trying to create a UserPref to show advanced gadget config options as follows:

<UserPref
    name="opt1"
    display_name="Option 1"
    default_value="100"/>
<UserPref
    name="opt2"
    display_name="Option 2"
    default_value="Default String"/>
<UserPref
    name="adv"
    display_name="Show Advanced Options?"
    datatype="bool"
    default_value="false"/>
<UserPref
    name="advOpt1"
    display_name="Advanced Option 1"
    default_value=""
    datatype="hidden"/>

With code in my gadget that, using Prefs.set, could set the datatype to the relevant type for the advanced options if adv==true. Is that possible or is there a way of doing this?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
rich_27
  • 1
  • 1

1 Answers1

0

In other words if adv=true you want to change advOpt1 type from hidden to something else, Am I right?

Kate
  • 751
  • 1
  • 12
  • 26