I am trying a simple grid example. I have a class StockDetails.
@SuppressWarnings("serial")
public class StockDetails implements Serializable {
private String id;
private String name;
private String symbol;
}
And StockDetailsProperties
public interface StockDetailsProperties extends PropertyAccess<StockDetails> {
@Path("symbol")
ModelKeyProvider<StockDetails> key();
ValueProvider<StockDetails, String> name();
ValueProvider<StockDetails, String> symbol();
}
I am facing the below error while building this example, any help on the same is appreciated.
[INFO] --- gwt-maven-plugin:2.4.0:compile (default) @ gxt-grid-mvp-app ---
[INFO] auto discovered modules [gxt.grid.mvp.app.GridApp]
[INFO] Compiling module gxt.grid.mvp.app.GridApp
[INFO] Validating newly compiled units
[INFO] Ignored 3 units with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO] Scanning for additional dependencies: file:/D:/mrudul-workspace/maven-projects/gwt-examples/gxt-grid-mvp-app/src/main/java/gxt/grid/mvp/app/
client/view/StocksView.java
[INFO] Computing all possible rebind results for 'gxt.grid.mvp.app.client.view.StockDetailsProperties'
[INFO] Rebinding gxt.grid.mvp.app.client.view.StockDetailsProperties
[INFO] Checking rule <generate-with class='com.google.gwt.junit.rebind.JUnitTestCaseStubGenerator'/>
[INFO] [ERROR] Errors in 'file:/D:/mrudul-workspace/maven-projects/gwt-examples/gxt-grid-mvp-app/src/main/java/gxt/grid/mvp/app/client/
view/StockDetailsProperties.java'
[INFO] [ERROR] Line 10: No source code is available for type com.sencha.gxt.data.shared.PropertyAccess<T>; did you forget to inherit
a required module?
[INFO] [ERROR] Line 12: No source code is available for type com.sencha.gxt.data.shared.ModelKeyProvider<T>; did you forget to inher
it a required module?
[INFO] [ERROR] Line 14: No source code is available for type com.sencha.gxt.core.client.ValueProvider<T,V>; did you forget to inheri
t a required module?
I am trying a simple grid example. I have a class StockDetails.
@SuppressWarnings("serial")
public class StockDetails implements Serializable {
private String id;
private String name;
private String symbol;
}
And StockDetailsProperties
public interface StockDetailsProperties extends PropertyAccess<StockDetails> {
@Path("symbol")
ModelKeyProvider<StockDetails> key();
ValueProvider<StockDetails, String> name();
ValueProvider<StockDetails, String> symbol();
}
I am facing the below error while building this example, any help on the same is appreciated.
[INFO] --- gwt-maven-plugin:2.4.0:compile (default) @ gxt-grid-mvp-app ---
[INFO] auto discovered modules [gxt.grid.mvp.app.GridApp]
[INFO] Compiling module gxt.grid.mvp.app.GridApp
[INFO] Validating newly compiled units
[INFO] Ignored 3 units with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO] Scanning for additional dependencies: file:/D:/mrudul-workspace/maven-projects/gwt-examples/gxt-grid-mvp-app/src/main/java/gxt/grid/mvp/app/
client/view/StocksView.java
[INFO] Computing all possible rebind results for 'gxt.grid.mvp.app.client.view.StockDetailsProperties'
[INFO] Rebinding gxt.grid.mvp.app.client.view.StockDetailsProperties
[INFO] Checking rule <generate-with class='com.google.gwt.junit.rebind.JUnitTestCaseStubGenerator'/>
[INFO] [ERROR] Errors in 'file:/D:/mrudul-workspace/maven-projects/gwt-examples/gxt-grid-mvp-app/src/main/java/gxt/grid/mvp/app/client/
view/StockDetailsProperties.java'
[INFO] [ERROR] Line 10: No source code is available for type com.sencha.gxt.data.shared.PropertyAccess<T>; did you forget to inherit
a required module?
[INFO] [ERROR] Line 12: No source code is available for type com.sencha.gxt.data.shared.ModelKeyProvider<T>; did you forget to inher
it a required module?
[INFO] [ERROR] Line 14: No source code is available for type com.sencha.gxt.core.client.ValueProvider<T,V>; did you forget to inheri
t a required module?
You've declared public fields to hold your data, but PropertyAccess assumes that your bean has getter and setter methods. From http://en.wikipedia.org/wiki/JavaBeans, Java Beans are described as having "access to properties using getter and setter methods".
We may consider an enhancement in the future to allow this, but in general it is considered to be a best practice to provide public methods to access values, rather than encouraging direct access to the fields.
Add getId(), getName(), getSymbol() methods that return those fields to fix this issue - and if you need to write to the fields, you'll need setId(String), setName(String), and setSymbol(String) respectively.
I already have the getter and the setter for the declared fields, I did not mention in the post as a JavaBean with private fields will have getter and setter methods.
And in spite of these public getter and setter methods I am facing this error.
Sorry, I just read the code I saw, and went for the most apparent errors.
From the error log, this message:
> [INFO] [ERROR] Line 10: No source code is available for type com.sencha.gxt.data.shared.PropertyAccess<T>; did you forget to inherit a required module?
Are you sure you followed the setup instructions and added GXT to your module file (ends in .gwt.xml)
<inherits name="com.sencha.gxt.ui.GXT" />
It is also possible to make this feature work without the full GXT module, but most development work uses the whole thing.