Deferred Binding hosted mode property

25 views
Skip to first unread message

daniel.z

unread,
Apr 24, 2008, 4:17:49 AM4/24/08
to Google Web Toolkit
Hi!

I was wondering if there is a property usable in a gwt module for
deferred binding like "user.agent" provided by
com.google.gwt.user.User (or com.google.gwt.user.UserAgent to be
exact). Any ideas out there?

Adam T

unread,
Apr 24, 2008, 6:50:50 AM4/24/08
to Google Web Toolkit
Create your own property and then use that. For example:

<define-property name="mode" values="hosted,production"/>

then set your property in the HTML file (or even create your own
<property-provider /> if you can detect automatically - check out
GWT's source code for an example on how the i18n tries to do that from
the URL)

Then your deferred binding just simply uses that property in the
standard way, e.g.

<replace-with class="org.gwtinaction.client.SomeClass">
<when-type-is class="org.gwtinaction.client.SomeClassHosted"/>
<when-property-is name="mode" value="hosted"/>
</replace-with>

Out of interest, why change classes between Hosted and Web mode?

//Adam

On Apr 24, 10:17 am, "daniel.z" <daniel.zieg...@objective-partner.de>
wrote:

daniel.z

unread,
Apr 24, 2008, 7:26:15 AM4/24/08
to Google Web Toolkit
Yes, I hae seen this possibility, too. But my problem was how to
detect if the application is running in hosted mode in the property
provider without having two different host pages für hosted mode and
web mode. Something like GWT.isScript() but beeing available for
property provider implementation.

The use case driving me to these questions is that I try to write an
GWT AppletContainer and want to get around the applet problem in the
hosted mode browser this way, rather than implement an GWT.isScript()
switch in the code itself.

~dz
Reply all
Reply to author
Forward
0 new messages