Re: Image from resource in SafeHtmlTemplate

2011-08-13 Thread Micah Caldwell
Yeah, I understand that part and after reading over my original post it 
seems that I over-simplified my example.  The template is much larger than 
just " and the image tag is in the middle of it all.  I was 
trying to avoid splitting my template up into multiple parts, one before the 
image tag and one after the image tag because I expect I will add additional 
images to the template and each one require I branch off another template if 
I were to just manually add the image tag using appendHtmlConstant.

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



Re: Image from resource in SafeHtmlTemplate

2011-08-13 Thread Micah Caldwell
I figured it out.  A bit more unwieldy than I would like but it gets the job 
done.  In short, I create a DOM element out of the resource, add an id to 
it, then assure my SafeHtmlTemplates that it is already SafeHtml so it 
doesn't try to parse it.

final ImagePrototypeElement imageElement = 
AbstractImagePrototype.create(Resources.sSingleton.getMyImage()).createElement();
imageElement.setId("delete_button");
final String imageUnsafeHtml = imageElement.getString();
final SafeHtml imageSafeHtml = new 
OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(imageUnsafeHtml);
GWT.create(MyTemplates.class).generateCellHtml(imageSafeHtml);

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



Re: Image from resource in SafeHtmlTemplate

2011-08-13 Thread Micah Caldwell
This gets me close (and I love the class name): 

String myImageHtml = 
AbstractImagePrototype.create(Resources.sSingleton.fDelete()).getHTML();
SafeHtml mySafeImageHtml = new 
OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(myImageHtml);
GWT.create(MyTemplates.class).generateCellHtml(mySafeImageHtml);

 When used in combination with this:

public interface MyTemplates extends SafeHtmlTemplates {
@Template("{1}")
SafeHtml generateCellHtml(SafeHtml imageUrl);
}

However, the template I want to use is more complex than this test case, 
with other HTML surrounding the image tag, and most importantly, the image 
tag having an id attribute (so I can get a browser event when it is 
clicked).  The tag generated by AbstractImagePrototype does not appear to 
have an id field.

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



Re: Image from resource in SafeHtmlTemplate

2011-08-13 Thread Micah Caldwell
SafeHtmlTemplates doesn't like that one either. The output of that ends up 
escaped when I run it through the template:



Re: Image from resource in SafeHtmlTemplate

2011-08-12 Thread Micah Caldwell
For the curious, this is what is returned by Image.getUrl():

data:image/png;base64,iVBORw0KGgoNSUhEUgAAADAwCAYAAABXAvmHAAAOc0lEQVR42s2ZB1hUVxqG766RJghoJDYQVIp0RECqdGmKNFlrLBEVMSKJEWNoRmPUWGKLJRI1lqxGicbVRDZBY9kYYyzrKhs3aixIncb09u1/71wUDIhGye48z/vMdbjOvP85//nOvTMM84Ie8tcz7BRvpGYp56ZtVuSm/siizE2pVOSm/Kick3JckTtqs3LOqBz560l2zP/LY5+5eY/rcX7rG6bGP1CWTIOmbBt0F89Af+8X6KvvQi9ugP7mdeh+vgLtqaPQfL4FyqLXoJg1olKenZSPrGjL/4n4J0xn7wpH+8M1E2N0ml2rob/xT0Ahg14u48R1V89D+49yaMoPQHNoOzRH93LH2orD0P5wArpzFVDtXAVZTrJYMT2xUPBHFbKDMe2z9yXTA9eih0C1Ig/6ykvQKxXcSOsunILmwFao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+1F+EuA0/EF34gemwhdx89Ls9p3hPvt2s+UVs1tHyjxfQ43cI2/DtZs2PuAUv3lqEdlgCNS1gUz762Jl4mS/IhqcH/1p3/u9WzYTNm0kb8+/

Image from resource in SafeHtmlTemplate

2011-08-12 Thread Micah Caldwell
I have an image from a ClientBundle resource:
final String myImageUrl = new 
Image(Resources.sSingleton.GetMyImage()).getUrl();

I also have a SafeHtmlTemplates interface:
public interface MyTemplates extends SafeHtmlTemplates {
@Template("")
SafeHtml GenerateCellHtml(String imageUrl);
}

When I call MyTemplates.GenerateCellHtml an exception is thrown because the 
URL output by Image.getUrl(), when the image comes from a resource, does not 
have one of the supported protocols (http, https, ftp, etc.).

Is it possible to use SafeHtmlTemplates with an Image sourced from a 
ClientBundle?  Am I stuck manually building the HTML string in the middle of 
my Java code using SafeHTMLBuilder?

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



Re: JDO, RequestFactory, String and PrimaryKey

2011-08-10 Thread Micah Caldwell
MyEntity is a JDO enabled object with a proxy called MyEntityProxy:

@ProxyFor(value = MyEntity.class, locator = MyEntity.Locator.class)
public interface MyEntityProxy extends EntityProxy
{
public String getKey();
public void setKey(String pKey);
}

As I understand it, that query should return a List which is a 
transportable type (
http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html#transportable
). 

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



Re: JDO, RequestFactory, String and PrimaryKey

2011-08-10 Thread Micah Caldwell
The RequestFactory code I have is all working great.  I am able to transfer 
objects back and forth between the server and the client without trouble. 
 It's only when I try to return the results of a JDO query that I run into 
trouble.

The JDO side of things is working great.  I can query the datastore from the 
server with JDO and "do stuff" with those results on the server, except 
sending those results to the client.

The RequestFactory + JDO interaction is working great with the exception of 
query results.  I can successfully save JDO objects created on both the 
server and the client (via RequestFactory).  I can also successfully return 
aggregate JDO query results to the client (such as count).

Again, my only problem lies with sending entity query results to the client. 
 Everything else done with RequestFactory and JDO works great.

In case anyone wants to see my test app (Eclipse project):
https://docs.google.com/leaf?id=0B-VN2UqJX3l4YTViN2E2OTItNTBkZS00NzQ4LThlNmUtNzYyZDhmZWM0YTNj&sort=name&layout=list&num=50

Do you send JDO query results (javax.jdo.Query) to the client in your 
application where the query returns a JDO & RequestFactory enabled object?

This is how I am executing the query.  This is in a RequestFactory method 
called by the client through a RequestContext meaning that the list returned 
by this method will be packed up by the RequestFactory and shipped off to 
the client for unpacking (it's the packing step that throws the exception).

Query lQuery = MyPersistenceManagerFactory.fGet().newQuery(MyEntity.class);
try
{
List lMyEntities = (List) lQuery.execute();
return lMyEntities;
}
finally
{
lQuery.closeAll();
}


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



Re: JDO, RequestFactory, String and PrimaryKey

2011-08-10 Thread Micah Caldwell
The project you linked to uses Objectify rather than JDO for persistence. 
 Unfortunately, all examples of RequestFactory that I have been able to find 
use something other than JDO for persistence.  I assumed that JDO would work 
with request factory since it is mentioned in the RequestFactory 
documentation but am I incorrect in this assumption that the two are 
compatible?  Is my best course of action to just change persistence engines 
to something that I can find working samples of (such as Objectify)?

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



Re: JDO, RequestFactory, String and PrimaryKey

2011-08-10 Thread Micah Caldwell
The app I have been working on to test this is as small of an app that I can 
figure out how to write that utilizes RequestFactory and JDO at the same 
time (since it's the interplay between them that is the problem).  Currently 
it only does 4 things to test this functionality:

   - generate an entity on the client and send it to the server for saving 
   in the datastore
   - generate a new entity on the server, save it in the datastore and send 
   the new entity back to the client
   - count the number of entities in the datastore and send the count to the 
   client
   - *send a list of all entities in the datastore to the client*

All but the last work fine.  It's only when I try to get an entity out of 
the datastore and send it to the client that the problem presents itself. 
 In fact, I have commented out the code for the first 3 tests just to make 
sure there wasn't a problem with with the interaction of the different 
tests.

Can you extrapolate on what you mean by using a DTO in this situation?  Are 
you suggesting that I do not use the same object for client-server transfer 
as I do for server-datastore transfer?  This method seems to be contrary to 
the method outlined at 
http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html where 
the JDO and RequestFactory objects are one and the same.

[RequestFactory] is designed to be used with an ORM layer like JDO or JPA on 
the server, although this is not required.

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



Re: JDO, RequestFactory, String and PrimaryKey

2011-08-10 Thread Micah Caldwell
Error in meta-data for 
com.zoltu.jdo_requestfactory_test.server.MyEntity.mKey: A field with the 
"gae.encoded-pk" extension can only be applied to a String primary key.

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



Re: JDO, RequestFactory, String and PrimaryKey

2011-08-10 Thread Micah Caldwell
Making the change you have suggested results in:

Server Error: Invalid primary key for 
com.zoltu.jdo_requestfactory_test.server.MyEntity.  The primary key field is 
an encoded String but an unencoded value has been provided. If you want to 
set an unencoded value on this field you can either change its type to be an 
unencoded String (remove the "gae.encoded-pk" extension), change its type to 
be a com.google.appengine.api.datastore.Key and then set the Key's name 
field, or create a separate String field for the name component of your 
primary key and add the "gae.pk-name" extension.

 I should specify that I do want to be able to set the primary key manually. 
 I have a unique string identifier I would like to use as the primary key 
for MyEntity.  Also, attempting to use a Long results in the same problem.  
http://www.datanucleus.org/products/accessplatform/jdo/primary_key.html shows 
that most of the basic types have special Identity classes, none of which 
can be sent to the client (client can only receive basic types according to 
http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html#transportable
).

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



Re: JDO, RequestFactory, String and PrimaryKey

2011-08-09 Thread Micah Caldwell
I guess the question I have is really more a JDO/GAE question than a GWT 
question as I need to know how to convert the StreamingQueryResult into a 
regular collection.  However, if there is a way to work around marshaling 
the StringIdentity to the client that would work too.

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



JDO, RequestFactory, String and PrimaryKey

2011-08-09 Thread Micah Caldwell
@PersistenceCapable
public class MyEntity extends EntityBase
{
@PrimaryKey
@Persistent
private String mPrimaryKey;
}

com.google.web.bindery.requestfactory.server.UnexpectedException: The domain 
type javax.jdo.identity.StringIdentity cannot be sent to the client

Is there a known workaround for this?

The problem is that JDO stores the identifier as a StringIdentity rather 
than a String and when it comes time to transmit the object to the client 
via GWT RequestFactory it's the JDO version of the object that is being 
transmitted (so it appears) rather than the MyEntity that I defined.

This only occurs when I fetch the object from the datastore.  If I 
instantiate it on the server (new MyEntity() ...) it can be sent to the 
client and if I instantiate it on the client it can be sent to the server.

When I look at the results in a debugger immediately after:
List lMyEntities = (List) lQuery.execute();

I get the following for: 
StreamingQueryResult.lazyResult.entityTransformer.val$acmd.managedMembers
[
  
]

Which is all fine but when I look at: 
StreamingQueryResult.lazyResult.entityTransformer.val$acmd.objectidClass
javax.jdo.identity.StringIdentity

Apparently when I return from the the server request and the collection of 
objects is marshaled back to the client, that objectidClass gets marshaled 
along with it and the exception is thrown.

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



Re: GWT Designer isDesignTime Not Working?

2011-08-08 Thread Micah Caldwell
I agree with Davekor that this should be added to the documentation.  Unlike 
him, I don't seem to learn as quickly and spent a day and a half on this bug 
before I finally managed to dig this post up.  To make matters worse, this 
problem appears to exist in the included examples.  I grabbed the *gaerequest 
*code from the *expenses *example and the included *LoginWidget *references 
a member variable (requests) and throws a NullPointerException with this 
error:
org.mvel2.PropertyAccessException: RootLayoutPanel.get().add(widget): null

Adding if (requests == null) return; fixes it, though I am not particularly 
happy with this since it will cause me much grief if at some point requests 
ends up being null at runtime.

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



Example of RequestFactory + JDO?

2011-08-08 Thread Micah Caldwell
Does anyone know of any examples that use RequestFactory & JDO?  On 
http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html it 
says, "[RequestFactory] is designed to be used with an ORM layer like JDO or 
JPA on the server, although this is not required."

I have been unable to locate any examples of such a case anywhere on the 
web.  Perhaps I am searching for the wrong terms but it seems like everyone 
(except me) is already intimately familiar with JDO from previous experience 
whereas this project is the first time I have worked with either JDO or 
RequestFactory and trying to put them together properly through separate 
sets of isolated examples is proving difficult.

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



DockLayoutPanel resize south to fit children using UIBinder?

2011-08-08 Thread Micah Caldwell
I am using a DockLayoutPanel to setup a tab bar in the north, a CellList in 
the west, content in the center and a simple "form" in the bottom (text 
field and button).  The south area is where I am having problems because I 
want the height of that area to automatically fit whatever is in there (the 
input field).  I am able to set it to a fixed size but I would like 
something that won't break when I change the size of the button or text 
field that are inside the south area.  Right now they are in a Horizontal 
Panel, but I can change that if someone has a better idea.

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