Hi,
We're evaluating SmartGWT, and so far, so good, except for one (odd but critical) issue so far.
We're trying to avoid using Spring for two reasons: 1) the SmartGWT FAQ recommends that we not use it and that it's generally unecessary and a waste and 2) we agree strongly with the idea of minimalist code to achieve required functionality.
Also, we're tring to use Hibernate beans.
So, if we have our ds.xml defined as follows, everything works fine (except for the fact that the code does not appear to be using the getters/setters in the bean definition, as it's not getthing there when we put breakpoints in the getters/setters nor is it executing our custom getter/setter business logic):
<DataSource ID="workflow" serverType="hibernate" tableName="workflow">
<fields>
<field name="wk_id" type="integer" primaryKey="true"/>
<field name="wk_name" type="text" length="255"/>
</fields>
</DataSource>
So, to get the code to use our getters/setters in our bean, we added a refernece to the bean information as follows:
<DataSource ID="workflow" serverType="hibernate" tableName="workflow">
<fields>
<field name="wk_id" type="integer" primaryKey="true"/>
<field name="wk_name" type="text" length="255"/>
<beanClassName>beanClassName=com.smartgwt.sample.shared.Workflow</beanClassName>
</fields>
</DataSource>
We also tried this different syntax:
<DataSource ID="workflow2" serverType="hibernate" tableName="workflow" beanClassName="com.smartgwt.sample.shared.Workflow">
<fields>
<field name="wk_id" type="integer" primaryKey="true"/>
<field name="wk_name" type="text" length="255"/>
</fields>
</DataSource>
We came up with these ideas by trying to follow the example described here: http://www.smartclient.com/smartgwtee/showcase/#master_detail_batch
(This examples closely matches what we eventually intend to do, as we have a 1 to many relationship we need to model.)
However, when we make reference to the bean and we run the code via GWT Debug Mode or GWT "Run as GWT Appication" , we get "Uncaught Exception" and it would appear that the code does NOT any longer bind to the datasource "Workflow". (In fact, it specially says that the datasource points to NULL.)
It seems like the reference to the bean throws it off. We're 100% sure that the beanname is correct (including case sensitivity).
Also, in case it helps, we essentially just modified the sample code "Built-In-DS". Further, although I don't think this is important, we're not using HSQLDB but instead using MySQL and that part seems to work just fine. Finally, in an effort to minimize code, we do not have any custom DMIs etc.
So again, everything works if we omit the "bean" reference in the ds.xml file, except for the fact that it doesn't actually use our bean's getters/settters. If we put in the bean reference, then we get errors and it refuses to "see" (or maybe it's not parsing properly) the ds.xml file.
This should be simple, and our goal is to follow the SmartGWT model of minimum code to achieve required funcitonality. So, we do NOT want to use Spring Framework etc (otherwise, we would have used some of the other samples that come with SmartGWT). From what we understand, this code above is the "right" way to do things....
Final details:
OS: Windows XP Pro (uptodate)
IDE: MyEclipse 9.0 with Google Plugin for Eclipse (2.3.1) (These are all the latest software as of today).
SmartGWT EE 2.4
Broswer: Mozilla Firefox (4.0.1)
GWT SDK: 2.2 (since GWT SDK 2.3 has issues with SmartGWT EE 2.4)
Sun JDK 1.6.0_13
Regards,
Gautam
We're evaluating SmartGWT, and so far, so good, except for one (odd but critical) issue so far.
We're trying to avoid using Spring for two reasons: 1) the SmartGWT FAQ recommends that we not use it and that it's generally unecessary and a waste and 2) we agree strongly with the idea of minimalist code to achieve required functionality.
Also, we're tring to use Hibernate beans.
So, if we have our ds.xml defined as follows, everything works fine (except for the fact that the code does not appear to be using the getters/setters in the bean definition, as it's not getthing there when we put breakpoints in the getters/setters nor is it executing our custom getter/setter business logic):
<DataSource ID="workflow" serverType="hibernate" tableName="workflow">
<fields>
<field name="wk_id" type="integer" primaryKey="true"/>
<field name="wk_name" type="text" length="255"/>
</fields>
</DataSource>
So, to get the code to use our getters/setters in our bean, we added a refernece to the bean information as follows:
<DataSource ID="workflow" serverType="hibernate" tableName="workflow">
<fields>
<field name="wk_id" type="integer" primaryKey="true"/>
<field name="wk_name" type="text" length="255"/>
<beanClassName>beanClassName=com.smartgwt.sample.shared.Workflow</beanClassName>
</fields>
</DataSource>
We also tried this different syntax:
<DataSource ID="workflow2" serverType="hibernate" tableName="workflow" beanClassName="com.smartgwt.sample.shared.Workflow">
<fields>
<field name="wk_id" type="integer" primaryKey="true"/>
<field name="wk_name" type="text" length="255"/>
</fields>
</DataSource>
We came up with these ideas by trying to follow the example described here: http://www.smartclient.com/smartgwtee/showcase/#master_detail_batch
(This examples closely matches what we eventually intend to do, as we have a 1 to many relationship we need to model.)
However, when we make reference to the bean and we run the code via GWT Debug Mode or GWT "Run as GWT Appication" , we get "Uncaught Exception" and it would appear that the code does NOT any longer bind to the datasource "Workflow". (In fact, it specially says that the datasource points to NULL.)
It seems like the reference to the bean throws it off. We're 100% sure that the beanname is correct (including case sensitivity).
Also, in case it helps, we essentially just modified the sample code "Built-In-DS". Further, although I don't think this is important, we're not using HSQLDB but instead using MySQL and that part seems to work just fine. Finally, in an effort to minimize code, we do not have any custom DMIs etc.
So again, everything works if we omit the "bean" reference in the ds.xml file, except for the fact that it doesn't actually use our bean's getters/settters. If we put in the bean reference, then we get errors and it refuses to "see" (or maybe it's not parsing properly) the ds.xml file.
This should be simple, and our goal is to follow the SmartGWT model of minimum code to achieve required funcitonality. So, we do NOT want to use Spring Framework etc (otherwise, we would have used some of the other samples that come with SmartGWT). From what we understand, this code above is the "right" way to do things....
Final details:
OS: Windows XP Pro (uptodate)
IDE: MyEclipse 9.0 with Google Plugin for Eclipse (2.3.1) (These are all the latest software as of today).
SmartGWT EE 2.4
Broswer: Mozilla Firefox (4.0.1)
GWT SDK: 2.2 (since GWT SDK 2.3 has issues with SmartGWT EE 2.4)
Sun JDK 1.6.0_13
Regards,
Gautam
Comment