Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • ludi
    replied
    You are right!
    I forgot to invoke invalidadecache.
    Now it works fine!

    Leave a comment:


  • mihai007
    replied
    did you try to call listGrid.invalidadecache and then listgrid.fetchdata?

    Leave a comment:


  • ludi
    replied
    Hello,

    I just tried to used the GwtRpcDataSource Class.
    Almost all things works fine, but I am not able to refresh the content of the DataSource with attendeesDataSource.fetchData();

    My ListGrid looks like
    Code:
    attendeesList = new ListGrid();
    // list.setWidth(500);
    attendeesList.setHeight100();
    attendeesList.setAlternateRecordStyles(true);
    attendeesList.setShowAllRecords(true);
    attendeesDataSource = new AttendeesDataSource();
    attendeesList.setDataSource(attendeesDataSource);
    attendeesList.setAutoFetchData(true);
    attendeesList.setCanEdit(false);
    and my DataSource Class
    Code:
    public class AttendeesDataSource extends GwtRpcReadOnlyDataSource {
    
    		private List<Attendee> attendeeList;
    		
    		public AttendeesDataSource() {
    			  
    
    		        
    			DataSourceField field;
    			field = new DataSourceTextField("name", "Name");
    			field.setRequired(true);
    			addField(field);
    			
    			field = new DataSourceTextField("email", "Email");
    			field.setRequired(true);
    			addField(field);
    			
    			field = new DataSourceTextField("active", "Aktiv");
    			field.setRequired(true);
    			addField(field);
    			
    			field = new DataSourceTextField("status", "Status");
    			field.setRequired(true);
    			addField(field);
    			/*
    			field = new DataSourceIntegerField ("ID", "ID");
    	        field.setPrimaryKey (true);
    	        addField(field);*/
    		}
    
    		@Override
    		protected void executeFetch(final String requestId,
    				final DSRequest request, final DSResponse response) {
    			System.out.println("--TODO executeFetch");
    			ModeratorService.Util.getInstance().getAttendees(study.getIdStudy(),
    					new AsyncCallback<List<Attendee>>() {
    
    						public void onFailure(Throwable caught) {
    							response.setStatus(RPCResponse.STATUS_FAILURE);
    							processResponse(requestId, response);
    						}
    
    						public void onSuccess(List<Attendee> result) {
    							//damit wir nicht immer neu laden müssen
    							attendeeList = result;
    
    							//attendeesDataSource.
    							// Calculating size of return list
    							int size = result.size();
    							
    							ListGridRecord[] list = new ListGridRecord[size];
    							for (int i = 0; i < result.size(); i++) {
    								ListGridRecord record = new ListGridRecord();
    								Attendee a = result.get(i);
    								System.out.println(a.getName());
    								record.setAttribute("ID", a.getIdAttendee());
    								record.setAttribute("name", a.getName());
    								record.setAttribute("email", a.getEmail());
    								record.setAttribute("active", a.isActive()?"JA":"NEIN");
    								record.setAttribute("status", a.getStatus().name());
    								list[i] = record;
    							}
    							response.setData(list);
    							//response.setTotalRows(result.size());
    							processResponse(requestId, response);
    						}
    					});
    
    		}
    
    public abstract class GwtRpcReadOnlyDataSource
        extends GwtRpcDataSource {
    
    	@Override
    	protected void executeAdd(String requestId, DSRequest request,
    			DSResponse response) {
    	}
    
    	@Override
    	protected void executeRemove(String requestId, DSRequest request,
    			DSResponse response) {
    	}
    
    	@Override
    	protected void executeUpdate(String requestId, DSRequest request,
    			DSResponse response) {
    	}
    }
    The service ModeratorService.Util.getInstance().getAttendees was invoked every time I pressed the refreh button. The received data are fine.
    For me it seems that the GridList does not refresh the content. I tried to use the refresh Functioon of the ListGrid as well, but it does not work either.

    Does anyone have a good idea?
    Thanks a lot

    Leave a comment:


  • mihai007
    replied
    Well I just added this to my Dropbox public folder so you can direct download without all the ads/limits, whatever from free sevices from here:
    http://dl.getdropbox.com/u/335287/TestAdvDataSource.zip

    For any updates for the file, just send it to me and I'll update. ( mihai.ile on gmail.com )

    Leave a comment:


  • bitblaster
    replied
    @all:
    Sorry, i didn't know there was such a download limit, i uploaded the archive in other free services:
    http://www.mediafire.com/?vfmhyag6mhb
    and
    http://www.filefactory.com/file/af92...DataSource_zip

    Leave a comment:


  • sjivan
    replied
    Originally posted by ebardet
    Just reacting to
    Any reason why getStartRow returns an int where getEndRow returns an Integer? Or this is just a glitch.

    Emmanuel
    The default for start row is 0, however there is no default for end row and if it is not set by the user, it will be null.

    Leave a comment:


  • Przemeq
    replied
    To anyone who has it - please post it somewhere for everyone

    Leave a comment:


  • mercus
    replied
    Hi bitblaster,

    Would you also send to me?
    My email is mercus@u-watch.tv

    Thank you very much!
    Mercus

    Leave a comment:


  • jasonzhang2002
    replied
    Hi, bitblaster
    I'd like to use your file, too. If convenient, please send it to me, too. My email is jasonzhang2002@gmail.com.
    thanks
    -jason

    Leave a comment:


  • mnenchev
    replied
    Well great, but from rapid share it could be downloaded just 10 times, so it seems that 10 people already downloaded it before me :(. Could you pls send it to my mail: god_like_@abv.bg
    Or upload it some where else.

    Leave a comment:


  • bitblaster
    replied
    Hi to all, at last i managed to use filtering, sorting and pagination (lazy loading) all server-side.
    Starting from the excellent work af alius, i improved its base class GwtRpcDatasource and created a set of utility classes which help in the creation of a Rpc datasource.
    I made a simple Eclipse project showing this functionalities so that you can test it quickly and import the classes you need in your project.
    The most important innovation is the management of the advanced criterias passed from the smartgwt's FilterBuider, which are converted in a internal tree of GWTCriterions and then passed server-side where they're converted in a true-java Criterion tree, which in turn, using reflection, filters our result.

    So, briefly, in the server call you have:
    - filter criterions
    - sorting field
    - pagination start and end

    Using this information you can do your data extraction in whatever way you need and return the result to the (client) caller.
    I made a simple example with a static list of data and it works (i've not implemented the sorting, but it's trivial).

    I tried to upload here a zip (24kb) with the project, but it's not possible, so i've uploaded it to rapidshare and put here the link.

    http://rapidshare.com/files/21686999...ource.zip.html

    @Administrators: If it's in contrast with the forum rules please remove this link

    Let me know if you find bugs or a way to improve it.
    Bye
    Bit

    Leave a comment:


  • btekab
    replied
    Anybody had success using this datasource with TreeGrid

    Using the latest sample code from “smartgwt-extensions” everything works for ListGrid and DynamicForms for the “SimpleGwtRPCDS”. However, even after setting “setForeignKey” field it looks like the “executeFetch” is never called on the datasource when put in TreeGrid.

    Leave a comment:


  • sjivan
    replied
    Originally posted by usrinivas
    Thank you Aleksandras for your help. I downloaded latest SmartGWT jar files from SmartGWT website. Looks like updated DSProtocol.java is not included in the latest jar files? where to get the latest jar files?
    You can also find nightly builds. Details here

    Sanjiv

    Leave a comment:


  • alius
    replied
    Originally posted by usrinivas
    Thank you Aleksandras for your help. I downloaded latest SmartGWT jar files from SmartGWT website. Looks like updated DSProtocol.java is not included in the latest jar files? where to get the latest jar files?
    You have to build your own SmarGWT from latest sources. Here is an instruction how to do it:

    http://code.google.com/p/smartgwt/wiki/BuildingFromSVN

    Aleksandras.

    Leave a comment:


  • usrinivas
    replied
    Thank you

    Thank you Aleksandras for your help. I downloaded latest SmartGWT jar files from SmartGWT website. Looks like updated DSProtocol.java is not included in the latest jar files? where to get the latest jar files?

    Leave a comment:

Working...
X