Asp.net Datagrid with Paging - Can this be tracked? - Tracking :: 4 posts - 2 authors - Last post: Jun 19A lot of the datagrid results use paging - is it possible to track separate pages of the results? I need to know at http://groups.google.com/group/analytics-help-tracking/browse_thread/thread/83ece0aa2ad36de6?fwc=1HOME | Hi folks,
is there a way to use a PagingToolbar within a Grid? I am getting my data using a Bean and cannot bind that stuff.
Thanks!
Thanks Darrell,
The new paging grid example doesn't seem to make any difference to it. I thought that the example would cover the new BeanModel operation?
Kind regards
ACC
Hi Darrell,
Latest SVN error ... build 517 2.0 API Changes 656
[javac] /root/workspace/com.extjs.gxt/user/src/com/extjs/gxt/ui/client/widget/form/ComboBox.java:804: java.lang.Object cannot be dereferenced
[javac] String newValue = m.get(getDisplayField()).toString();
This blasted page bean grid is driving me crazy. Normal grid beans work. Paged don't.
I'm using Java 1.5, Linux Ubuntu 2.6.24 Eclipse 3.3
Could be related to the JBoss side of things. The IsSerializable...
ACC
Thanks Darrell, very fast response!
Still nothing working for me in this Paging mechanism...
I can get non pageload data fine!
This is pretty much the whole thing for getting it fetched off the JBoss server and displayed in a page grid
This is the main test class, (I'm not sure why I need to extend BaseModelData when the BeanModelTag is all that is needed for the standard BeanModel Grid). Is this the problem?
public class WsTest extends BaseModelData implements BeanModelTag,Serializable,IsSerializable {
private static final long serialVersionUID = 9003110853413414367L;
private String value;
protected WsTest() {}
public WsTest(String value) {
this.value = value;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
I have a client webserviceAsync.java file which has this...
public void getWsTests(PagingLoadConfig config, AsyncCallback callback);
The client side Webservice :
public PagingLoadResult getWsTests(PagingLoadConfig config); CodeGuru: Custom DataGrid With Next, Previous, First, Last, and :: Jan 31, 2007 Here, you have to understand how DataGrid renders controls for Pager. The DataGrid renders controls like this (LinkButton or label) (Literal http://www.codeguru.com/csharp/.net/net_data/datagrid/article.php/c13153HOME | CodeSnip: Customized DataGrid Paging: ASP Alliance:: In this article, Surya demonstrates how to create a customized DataGrid with paging functionality. http://aspalliance.com/825_CodeSnip_Customized_DataGrid_PagingHOME |
On the server side I have this line in the WebserviceLocal.java
@WebRemote
PagingLoadResult getWsTests(final PagingLoadConfig config) ;
And the implementaion file WebserviceImpl.java (for completeness):
This routine appears to work fine .
public PagingLoadResult getWsTests(final PagingLoadConfig config) {
WsTest w1 = new WsTest("Jenny");
WsTest w2 = new WsTest("Aly");
WsTest w3 = new WsTest("Tom");
List sublist = new ArrayList();
sublist.add(w1);
sublist.add(w2);
sublist.add(w3);
return new BasePagingLoadResult(sublist, 0, sublist.size());
}
The client side code is pretty similar
to your example ..
(I've checked that "name" and "description" exist and service is picked up fine)
RpcProxy proxy = new RpcProxy() {
@Override
public void load(Object loadConfig, AsyncCallback callback) {
service.getWsTests((PagingLoadConfig) loadConfig, callback);
}
};
// loader
BasePagingLoader loader = new BasePagingLoader(proxy, new BeanModelReader());
loader.setRemoteSort(true);
loader.load(0, 50);
ListStore store = new ListStore(loader);
final PagingToolBar toolBar = new PagingToolBar(50);
toolBar.bind(loader);
List columns = new ArrayList();
columns.add(new ColumnConfig("value", "Value", 150));
ColumnModel cm = new ColumnModel(columns);
Grid grid = new Grid(store, cm);
grid.setLoadMask(true);
grid.setBorders(true);
grid.setAutoExpandColumn("value");
ContentPanel panel = new ContentPanel();
panel.setFrame(true);
panel.setCollapsible(true);
panel.setAnimCollapse(false);
panel.setButtonAlign(HorizontalAlignment.CENTER);
panel.setHeading("Paged Images");
panel.setLayout(new FitLayout());
panel.add(grid);
panel.setSize(600, 350);
panel.setBottomComponent(toolBar);
add(panel);
Now I have had to add "implements IsSerializable" to BasePagingLoadConfig.java, SortInfo.java, and Style.java to make it easy for JBoss to accept the rpc.
Thanks for your fast responses. I'm really keen to knock this bit over and get paged grids going!
Sincerely
ACC
I'm using the SVN 1.1 library,
I'm communicating to a JBoss SEAM server. I've added IsSerializable to
BasePagingLoadConfig
SortInfo
Doing so has enabled the code to work and I have it tested using the new BeanModel (based upon the excellent Blog entry http://extjs.com/blog/2008/07/14/preview-java-bean-support-with-ext-gwt/
But I'm trying to use it with the Paging Table ..
BeanModelReader reader = new BeanModelReader();
final BasePagingLoader loader = new BasePagingLoader(proxy,reader);
ListStore store = new ListStore(loader);
The simple grid works, but not the paging table ...
Any ideas?
I added a paging grid example to the explorer demo (PagingGridPage). Change is in SVN.
Try now.
Thanks for the quick reply!
I notice that I now get a compile error (after cleaning etc). The previous few svn checkouts have worked well..
A goof in the checkin or have I done something silly?
compile:
[mkdir] Created dir: /root/workspace/com.extjs.gxt/build/bin
[javac] Compiling 373 source files to /root/workspace/com.extjs.gxt/build/bin
[javac] /root/workspace/com.extjs.gxt/user/src/com/extjs/gxt/ui/client/widget/grid/GroupingView.java:260: java.lang.Object cannot be dereferenced
[javac] Element g = XDOM.getElementById(m.get("_groupId").toString());
[javac] ^
[javac] /root/workspace/com.extjs.gxt/user/src/com/extjs/gxt/ui/client/widget/grid/GroupSummary.java:126: java.lang.Object cannot be dereferenced
[javac] refreshSummaryById(m.get("_groupID").toString());
[javac] ^
[javac] /root/workspace/com.extjs.gxt/user/src/com/extjs/gxt/ui/client/widget/grid/GroupSummary.java:133: java.lang.Object cannot be dereferenced
[javac] refreshSummaryById(model.get("_groupID").toString());
[javac] ^
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 3 errors
I added another demo page that uses BeanModel. The only difference in the code is that the service returns beans and the loader uses a ModelBeanReader. Changes are in SVN.
Okay, I let myself down in that a class variable 'callback' in my PageTable code was overriding the local callback in the RpcProxy load function. I need to take more heed of the Eclipse IDE warnings. Still working on this darn Paging Bean Grid!
Also, I notice in the sample code "PagingBeanGridPage.java" that the variable 'Stock' should be replaced by BeanModel (If my understanding is correct).
Also Darrell, what are your thoughts on the inclusion of 'IsSerializable' into the BasePagingLoadConfig and SortInfo, SortDir classes? My JBoss RPC comms needs it. It shouldn't be an issue to include in the library I would imagine?
regards
ACC
Fix is in SVN.
Great stuff! All going.
Thanks Darrell, excellent work!
No paging within grids yet ?
Revision 685 in the trunk had the compile error...
Nortel Unveils Vision, Strategy for Israeli High-Performance Net
Busy Friday Leads to Strong Close for Net Stocks
|