Hi,

After looking at your code, I noticed that you still haven't added a
state callback that would handle the changes to the state.

After applying cmdskp's suggestion above to your rollTheDice()
function, I'd suggest you copy the init() and function from the
tutorial sample at 
http://code.google.com/apis/wave/extensions/gadgets/guide.html#structure.
Then after that, create a stateUpdated() function which would check
the state if there's already a dice value in the state e.g.

    function stateUpdated() {
      if(!wave.getState().get('dice')) {
        document.getElementById('results_td').innerHTML = "";
        document.getElementById('numdice').disabled = false;
        document.getElementById('numside').disabled = false;
        document.getElementById('butRollDice').disabled = false;
      }
      else {
        document.getElementById('results_td').innerHTML = "You rolled:
" + wave.getState().get('dice');
        document.getElementById('numdice').disabled = true;
        document.getElementById('numside').disabled = true;
        document.getElementById('butRollDice').disabled = true;
      }
    }

On Nov 6, 5:41 am, Steven Melendez <melendez.stev...@gmail.com> wrote:
> Hi,
>
> I have a gadget as a dice roller (http://www.stevenkmelendez.net/
> wavediceroller.xml). It works fine to roll dice. However, if I leave
> the wave and reenter it, all the dice rolling gadgets go to their
> original form (with no dice roll information retained). How do I keep
> that information available AND if possible disable the gadget
> functions so it can't be 'rerolled'.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Wave API" group.
To post to this group, send email to google-wave-api@googlegroups.com
To unsubscribe from this group, send email to 
google-wave-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-wave-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to