Skip to content

Instantly share code, notes, and snippets.

@nikhilv
Last active December 16, 2015 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhilv/5463956 to your computer and use it in GitHub Desktop.
Save nikhilv/5463956 to your computer and use it in GitHub Desktop.
@Override public Widget doInit()
{
final VerticalPanel verticalPanel = new VerticalPanel();
ExpandStringRequest expandStringRequest = this.getRequestFactory().createExpandStringRequest();
expandStringRequest.setValue("$[/javascript var list = myUser.projectList; (!(typeof(list)===\"undefined\")) ? list : getProperty(\"/projects/PluginGlobals/projectList\");]");
expandStringRequest.setCallback(new CommanderObjectCallback() {
@Override
public void handleResponse(CommanderObject commanderObject) {
verticalPanel.add(new Label(commanderObject.get("value")));
}
@Override
public void handleError(CommanderError commanderError) {
}
});
this.getRequestManager().doRequest(expandStringRequest);
// We're done setting up the UI. Return the panel.
return verticalPanel;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment