I'm using GWT requestFactory to save an entity, the code is rather simple: i want to create a Blog entity with several Tags, here is my code:
client side:
BlogRequest blogRequest = factory.blogRequest();
BlogProxy instance = blogRequest.create( BlogProxy .class );
instance.setName( "blog name");
instance.setNote( "mynote2" );
instance.setTags( base.createTagProxies( blogRequest, tag ) );
blogRequest.save( instance ).fire(...);
public Set<TagProxy> createTagProxies( BlogRequest request, String... tagNames )
{
Set<TagProxy> tagproxies = new HashSet<TagProxy>();
for( String tagName : tagNames )
{
TagProxy proxy = request.create( TagProxy.class );
proxy.setName( tagName );
tagproxies.add( proxy );
}
return
tagproxies ;
}
for example i create a blog with "Tag1" and "Tag2" in a Set, however after the request send to server side, at Blog#setTags(Set<Tag> tags) method there is only one tag in the parameter set, which is "Tag1", "Tag2" is just missing.
Could anybody help with this issue? Thanks in advance.