2 messages in com.googlegroups.google-gadgets-apiDisabling UserPrefs| From | Sent On | Attachments |
|---|---|---|
| sneakypete | 24 Aug 2006 16:21 | |
| Dann (Google Employee) | 07 Sep 2006 10:36 |
| Subject: | Disabling UserPrefs![]() |
|---|---|
| From: | sneakypete (theb...@gmail.com) |
| Date: | 08/24/2006 04:21:17 PM |
| List: | com.googlegroups.google-gadgets-api |
I am trying to have an event-driven model where changing the value in a UserPref dropdown will disable/enable the users ability to access other UserPrefs.
i.e. Given the following xml:
<UserPref name="type" display_name="Type:" datatype="enum"> <EnumValue value="1" display_value="Value1"/> <EnumValue value="2" display_value="Value2"/> </UserPref> <UserPref name="check1" display_name="Check Me 1" datatype="bool"/> <UserPref name="check2" display_name="Check Me 2" datatype="bool"/>
I would like to have the event that changing the "type" enum trigger the enabling or diabling of the other two UserPrefs. This is obviously very easily done in standard JS, but I can't seem to get it right using the Google API.
I tried something like this:
_gelstn("type").onChange=disableValues();
function disableValues() { if (__UP_type__ == 2) { alert("disabling values"); _gelstn("check1").disabled=true; _gelstn("check2").disabled=true; } }
Oddly, the event gets triggered once the enumerated list selection is made and the "Save" button is pressed, but by then it is too late. This very well may be a limitation in the API, but thought maybe someone had encountered the same problem and found a workable solution.
TIA!




