Monday, May 31, 2010

Using JavaScript Overlay Types for Nested JavaScriptObjects

I have this in my html and I can use JavaScriptOverlay types no
problem and it works:

<script>
var properties = {"width":640, "height":480};
</script>

public class Properties extends JavaScriptObject
{
protected Properties() { }

public final native String getWidthString() /*-{ return this.width; }-
*/;
public final native String getHeightString() /*-{ return
this.height; }-*/;
}

However, when I start nesting objects like below I do not know how to
extract the "property" object from "properties".

<script>
var properties = {"property":{"canvasWidth":1920, "canvasHeight":
1200, "width":640, "height":480, "fps":15, "bgcolor":"#FFFFFF"}};
</script>


What do I need to do to get the "properties" object, and then get to
the "property" object?

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

No comments:

Post a Comment