This post has been migrated from www.experimentsincode.com, we apologise if some of the images or content is missing
function init() { if (wave && wave.isInWaveContainer()) { LoadControls(); LoadLanguages(); wave.setStateCallback(stateUpdated); } } gadgets.util.registerOnLoadHandler(init);So I register the init method to be called when the gadget is loaded, but within the init method the previous state is not set. LoadControls and LoadLanguages do not load the state. However the state is loaded is in the method passed to setStateCallback, after the gadgets init method had run and the callback has been assigned the callback method is called, this then loads the code from state:
if(!wave.getState().get('code')) { } else { $textarea.val(wave.getState().get('code')); $dropdown.val(wave.getState().get('language')); Highlight(); }As I learn more I will share it, I am very excited to get into developing gadgets for wave and consuming wave on other sites. I think we are a long way from seeing the full potential of wave.
Glass is home to the #1 ORM for Sitecore. Glass.Mapper is the easiest way to map data from your Sitecore solution to your code.
Generated: 22 Apr 2018 12:44:02
2014 � All Rights Reserved.
Built using Glass.Mapper.Sc 4.3.0.280 and Sitecore 8.1.0.0. Page rendered in 58 ms.
197 Glass items created, 4 cached Glass items.