Re: RequestFactory with ValueType for interfaces / abstract classes

2011-08-09 Thread Nachiket
Update:

I found that @ExtraTypes is supported in GWT 2.4 for polymorphic
support in RequestFactory.
But unable to understand how to use it, as there are no sample code
available which does that.

Although got this test class which does check polymorphism in request
factory.
http://www.google.com/codesearch#A1edwVHBClQ/user/test/com/google/web/bindery/requestfactory/gwt/client/RequestFactoryPolymorphicTest.java

But there are no sign,how to use Abstract classes..

Looking for pointers/guidance.

Thanks,

On Aug 6, 6:38 pm, Nachiket patel.nachike...@gmail.com wrote:
 Hi,
 Following is my Model
 ---
 class Person {
      String getName();
      Vehicle getVehicle();

 }

 interface Vehicle {
    String getCompanyName();
    String getRegNo();
    Point getParkingSpaceRequired();

 }

 abstract class AbstractVehicle {

 }

 class Motorcycle extends AbstractVehicle {

 }

 class Car extends AbstractVehicle {

 }

 --
 so creating PersonProxy as EntityProxy was straight forward, and
 working fine for person.getName()
 I have created VehicleProxy as ValueProxy and called fire()
 with .with('vehicle')

 But I am getting
 The domain type comAbstractVehicle$$EnhancerByCGLIB$$e86549b9
 cannot be sent to the client.

 On PersonProxy I got
 @ProxyFor(value=Person.class,locator=PersonLocator.class)

 on VehicleProxy I got
 @ProxyFor(value=Vehicle.class)

 so, How to handle such inheritance in RequestFactory?
 Should I change Vehicle to EntityProxy from ValueProxy? Then How to
 implement methods of VehicleLocator?

 Thank you,

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



RequestFactory with ValueType for interfaces / abstract classes

2011-08-06 Thread Nachiket
Hi,
Following is my Model
---
class Person {
 String getName();
 Vehicle getVehicle();
}

interface Vehicle {
   String getCompanyName();
   String getRegNo();
   Point getParkingSpaceRequired();
}

abstract class AbstractVehicle {
}

class Motorcycle extends AbstractVehicle {
}

class Car extends AbstractVehicle {
}

--
so creating PersonProxy as EntityProxy was straight forward, and
working fine for person.getName()
I have created VehicleProxy as ValueProxy and called fire()
with .with('vehicle')

But I am getting
The domain type comAbstractVehicle$$EnhancerByCGLIB$$e86549b9
cannot be sent to the client.

On PersonProxy I got
@ProxyFor(value=Person.class,locator=PersonLocator.class)

on VehicleProxy I got
@ProxyFor(value=Vehicle.class)

so, How to handle such inheritance in RequestFactory?
Should I change Vehicle to EntityProxy from ValueProxy? Then How to
implement methods of VehicleLocator?

Thank you,


-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Broken editor type conversions in GWT trunk r10227

2011-07-19 Thread Nachiket
No response on this??
i am also facing similar problem

On May 26, 6:42 pm, Miroslav Genov mge...@gmail.com wrote:
 Hello,
 I'm trying to use trunk version of GWT but I'm encountering some conversion
 issues with the Editor framework.

 Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to
 java.lang.String
 at
 com.google.gwt.text.shared.testing.PassthroughRenderer.render(PassthroughRe 
 nderer.java:1)
 at
 com.google.gwt.user.client.ui.ValueBoxBase.setValue(ValueBoxBase.java:394)
 at
 com.google.gwt.user.client.ui.ValueBoxBase.setValue(ValueBoxBase.java:389)
 at
 com.google.gwt.editor.ui.client.adapters.ValueBoxEditor.setValue(ValueBoxEd 
 itor.java:106)
 at com.google.gwt.editor.client.impl.Refresher.visit(Refresher.java:45)
 at com.google.gwt.editor.client.impl.Initializer.visit(Initializer.java:49)
 at
 com.google.gwt.editor.client.impl.AbstractEditorContext.traverse(AbstractEd 
 itorContext.java:128)
 at
 com.clouway.requestfactory.app.client.CustomerEditor_RequestFactoryEditorDe 
 legate.accept(CustomerEditor_RequestFactoryEditorDelegate.java:54)
 at
 com.google.gwt.editor.client.impl.AbstractEditorContext.traverse(AbstractEd 
 itorContext.java:129)
 at
 com.clouway.requestfactory.app.client.CustomerEditorWorkflow_DriverImpl.acc 
 ept(CustomerEditorWorkflow_DriverImpl.java:6)
 at
 com.google.gwt.editor.client.impl.BaseEditorDriver.doEdit(BaseEditorDriver. 
 java:92)
 at
 com.google.web.bindery.requestfactory.gwt.client.impl.AbstractRequestFactor 
 yEditorDriver.edit(AbstractRequestFactoryEditorDriver.java:178)

 The AbstractEditorDriverGenerator is generating different
 AbstractEditorContext for each property of the entity, so the following
 declaration:
   @UiField
   ValueBoxEditorDecoratorInteger age;

   Age:
       e:ValueBoxEditorDecorator ui:field=age
         e:valuebox
           g:TextBox/
         /e:valuebox
       /e:ValueBoxEditorDecorator

 generates AbstractEditorContext for age field as
     @Override public Class getEditedType() { return java.lang.Integer.class;}

   @Override public java.lang.Integer getFromModel() {
     return (parent != null  true) ? parent.getAge() : null;
   }

 And here is the problem, the   TextBoxBase class is using the default
 PassthroghtParser (of type String)

 protected TextBoxBase(Element elem) {
   super(elem, PassthroughRenderer.instance(), PassthroughParser.instance());}

 which is causing the provided exception. Any idea how I can make it working
 ?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



RequestFactory and JSNI

2011-06-30 Thread Nachiket
Hi,
I have ran few tests and wrote Hello World style RequestFactory code
for understanding.
I am wondering, how we can pass EntityProxy to native Javascript
(using JSNI) and setting changed values from native javascript to
EntityProxy?

Thanks,

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Javascript error in IE 7, If deployed on Apache. Works fine in IE7 if its Tomcat.

2010-06-07 Thread Nachiket
Hi guys,
My first post here, and a strange problem.

Application runs properly on all the browsers (IE7, Chrome 4+, Firefox
3.5+) if it is deployed in Tomcat.
Now when I deploy on remote apache server, It runs fine in all the
browser, but in IE7 I get this..
--
Line: 2056
Char: 12
Error: Exception thrown and not caught
Code: 0
URL: 
---

I have deployed generated files in OBF and DETAILED mode. Same error.
And I am unable to figure out anything from this.. :-(

Generated Code
-
2050: function
com_google_gwt_core_client_impl_Impl_entry0__Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2Ljava_lang_Object_2(jsFunction,
thisObj, arguments){
2051:   var initialEntry;
2052:   initialEntry = com_google_gwt_core_client_impl_Impl_entryDepth+
+ == 0;
2053:   try {
2054: return jsFunction.apply(thisObj, arguments);
2055:   }
2056:finally {
2057: initialEntry 
com_google_gwt_core_client_impl_SchedulerImpl_
$flushFinallyCommands__Lcom_google_gwt_core_client_impl_SchedulerImpl_2V((com_google_gwt_core_client_impl_SchedulerImpl_
$clinit__V()  ,
com_google_gwt_core_client_impl_SchedulerImpl_INSTANCE));
2058: --com_google_gwt_core_client_impl_Impl_entryDepth;
2059:   }
2060: }
-

Any ideas??
BTW, I am inheriting  GWT-DnD (drag n drop) and XML for XML parsing
and communication.

Cheers

-- 
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-tool...@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.