Announcement

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

  • jandrulis
    replied
    Load on demand TreeGrid

    Thanks for responding, Isomorphic. I really love what I've seen of your library. I'm sure once I get past my start up confusion, it will save me tremendous time and effort.

    I've been using the example code provided in the TestAdvDataSource project provided in this thread to extract the filter criterion from the request object which is why I didn't embed it again here. I should have be clearer about that.

    After some additional investigation, it turns out that what I interpreted as an uninitialized DSRequest object was really due to this example having been created to handle the criteria format coming from the advanced filter builder but not the simpler criteria format coming from a tree grid and returning 'null' as a result. After examining the raw data field I could see the differences and believe I now understand what I need to do to handle the tree grid to support load on demand.

    Joe

    Leave a comment:


  • Isomorphic
    replied
    @jandrulis Try posting the code for your attempts. No one can tell what you might be doing wrong without seeing the code.

    Leave a comment:


  • jandrulis
    replied
    Load on demand TreeGrid

    I've continued my quest to use a GWT-RPC data source to drive a load on demand TreeGrid. I believe I've isolated my problem to somehow being unable to capture the request data from the ResultTree.

    My understanding of the process is as follows:

    1) User selects a node in the TreeGrid
    2) TreeGrid issues a fetchData() to retrieve children
    3) fetchData() creates a ResultTree that includes the children request as a criteria in dsRequest.data
    4) DataSource gets the dsRequest
    5) Since DataSource dataProtocol is set to CLIENTCUSTOM for GWT-RPC, the criteria remains as dsRequest.data, available for processing in transformRequest

    Everything seems to proceed as expected except that the data field is always null coming from a TreeGrid fetchData() when I try to process it in transformRequest.

    Any hints on what I'm doing wrong?

    Thanks!

    Joe

    Leave a comment:


  • dimavin
    replied
    Originally posted by jsantaelena
    Dmitriy,

    Here is my project that I'm using as a proof of concept. It's using my own customization of GWT RPC DS to work with Calendar, but it contains what you are looking for.

    http://www.4shared.com/file/108426527/9ed28154/calendar2.html

    Att,

    Att,

    I was able to run your code to see the datasource in action.

    Thank you very much,
    Dmitriy

    Leave a comment:


  • justinc
    replied
    Hi,

    I have also experienced this problem with trying to use a TreeGrid via the GWT-RPC method outlined here. Seems to be fine with ListGrid alright.

    Is there an issue here with using TreeGrid, or is it just not correct to use it like this?

    Regards,
    Justin

    Leave a comment:


  • jandrulis
    replied
    Problem connect GwtRpcDataSource to TreeGrid

    This question seems so simple I feel foolish asking it but I can't resolve it and can't find anything about it after searching the forums extensively so here goes:

    I created a project to try the TestAdvDataSource code and got it working fine. However, when I substituted a TreeGrid for the ListGrid I noticed that I can't read any fields in the DSRequest object. All the get methods throw a null pointer exception. My reading of the docs tells me the TreeGrid would populate the data field with a criteria to request the root nodes on the first call and child nodes as I open parent folders.

    The TreeGrid works fine if I ignore the DSRequest object and return dummy data so I'm confident the datasource is set up properly. I made no other changes to the example other than what was needed to set up the TreeGrid and add a field for the foreignKey.

    Any reason I should be having a problem with the DSRequest object being apparently uninitialized?

    Thanks

    Leave a comment:


  • efectobyte@gmail.com
    replied
    mivola - Michael

    ey mivola i'd would be grateful if you contact me at efectobyte@gmail.com . I'm also using gilead to manage entities

    mivola, you were right... this can be implemented almost without much effort... same service, service impl, dao's, domain, but as i said i ended out of memory... how did you avoid that?

    thanks for all of you
    great job with this project and svn
    if i break rules on this forum y apology, i didn't find a way to contact mivola

    skoder i also want to contact you as you also using gilead

    wich other way you can read data from db if it isn't trought rpc on web app???
    Last edited by efectobyte@gmail.com; 30 May 2009, 18:49.

    Leave a comment:


  • jsantaelena
    replied
    Originally posted by dimavin
    Hi,

    Can you please point me to the full code of GWT-RPC example including:
    - the onModuleLoad() method implementation, with proper ListGrid initialization and SimpleGwtRPCDS setup;
    - web.xml with service configuration.

    The current smartgwt-extensions trunk does not contain this.

    Thanks,
    Dmitriy
    Dmitriy,

    Here is my project that I'm using as a proof of concept. It's using my own customization of GWT RPC DS to work with Calendar, but it contains what you are looking for.

    http://www.4shared.com/file/108426527/9ed28154/calendar2.html

    Att,

    Leave a comment:


  • dimavin
    replied
    Full code of GWT-RPC example

    Hi,

    Can you please point me to the full code of GWT-RPC example including:
    - the onModuleLoad() method implementation, with proper ListGrid initialization and SimpleGwtRPCDS setup;
    - web.xml with service configuration.

    The current smartgwt-extensions trunk does not contain this.

    Thanks,
    Dmitriy

    Leave a comment:


  • ceravolo
    replied
    FilterEditor Criteria

    Hello,

    How to use the those header filters of the ListGrid (the one that shows when using ListGrid.setShowFilterEditor(true)) with the GwtRpcDatasource?

    The implementation sent by @bitblaster expects a AdvancedCriteria (get from a FilterBuilder).

    How can I retrieve the simple criteria from the DSRequest.data?

    Also, I need to programatically apply a filter.

    I need to do something like this:
    Code:
     
    void applyFilter(String p_columnName, String p_value)
    {
       Criteria v_criteria = new Criteria(p_columnName, p_value);
       m_ListGrid.fetchData(v_criteria);
    }
    But I've got the the same problem of not knowing how to extract the criteria from the DSRequest.data (since it is not a AdvancedCriteria)

    Thanks,
    Cerávolo

    Leave a comment:


  • jpgdev
    replied
    Boolean trouble

    Hi there (first of all: great thread - thanks to all contributors!)

    I'm using a GwtRpcDataSource (adapted bitblasters TestAdvDataSource) and a ListGrid for presentation. A DataSourceBooleanField I added to the DS makes the listgrid show a checkbox (as expected), but its value is always true/checked - regardless of the data. When the very same field is defined as DataSourceTextField it shows the correct values as text ("true"/"false").

    Has anybody experienced similar problems? any help greatly appreciated...

    EDIT:
    I was able to figure it out myself. It works as soon as copyValues (GwtRpcDataSource) calls ListGridRecord.setAttribute with a primitive boolean value instead of a Boolean object.
    Last edited by jpgdev; 25 May 2009, 09:46.

    Leave a comment:


  • olivier_nicollet
    replied
    Hi,

    I'm interrested in the GWT RPC DS. I made it work but now i would like to integrate the use of criterion sort and paging server side.

    Originally posted by bitblaster
    Alius, thank you for your solution, it is working perfectly! Now i want to integrate this with filter and sorting support, i'll let you know.

    I post here a working example of server-side paging support, since your example is client-side based and may be confusing for a newbye (like me :-)
    I created a FetchResult class (generic) to carry all fetch result information from the server call.
    At the moment this includes:
    - the total row count
    - the startrow returned from the server (which will be the same as that requested from the client)
    - the endrow returned from the server (which could be lower than that requested from the client, for example if in the previous call you returned 200 total rows but in the meantime some row was deleted)
    - the actual fetched list

    I post here your classes adapted to support server-side paging, the dto class TestRecord and the class GwtRpcDataSource remain the same as yours

    Bye!
    Bit
    I got warning cose of Serializable type for params in GWTCriterion :(
    Last edited by olivier_nicollet; 18 May 2009, 07:00.

    Leave a comment:


  • jsantaelena
    replied
    Calendar

    Ok, a resolved the problem of Updates no being reflected at view setting setEventAutoArrange(false), but now I have problems with entry overlap, what I do not deserve.
    Last edited by jsantaelena; 9 May 2009, 07:00.

    Leave a comment:


  • jsantaelena
    replied
    Calendar

    Hi,

    I'm trying to use it with Calendar. Until here I'm doing well all CRUD operations, except by Delete, that DEResponse.getData() give me only the ID. It lead me to do a findById before call the hibernate session.delete() (they claims the null properties when performing deletions. any idea how to solve it?).

    But, now I'm burning my mind trying to make the calendar reflect the changes. Here are the issues:

    -When I delete an item, in case of failure, the calendar deletes it from the view, even if I return DSResponse.STATUS_FAILURE at onFailure().

    -When update a entry, in case of success, the calendar isn't presenting changes. The entry remains untouched at screen.

    - How to display a message with the RPC error. I tryied to use DSResponse.setErrors(), but doesn't work.

    Thanks.
    Last edited by jsantaelena; 8 May 2009, 13:43.

    Leave a comment:


  • s0lidnuts
    replied
    TestDataSource.java @ executeUpdate method
    ListGrid grid = (ListGrid) Canvas.getById(request.getComponentId()); <- actually returns a DynamicForm, giving me a cast exception. Why is that ? What alterations should I do ?

    This is the page that requests the update
    Code:
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.widgets.IButton;
    import com.smartgwt.client.widgets.Window;
    import com.smartgwt.client.widgets.events.ClickEvent;
    import com.smartgwt.client.widgets.events.ClickHandler;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
    import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    public class UserManagementWindow { 
    
    	public void onLoad() {
    
    		DataSource dataSource = UserDataSource.getInstance();
    		Window w = new Window();
    
    		VLayout layout = new VLayout(15);
    		
    		final DynamicForm form = new DynamicForm();
    		form.setIsGroup(true);
    		form.setGroupTitle("Alterar");
    		form.setNumCols(4);
    		form.setDataSource(dataSource);
    
    		final ListGrid listGrid = new ListGrid();
    		listGrid.setWidth100();
    		listGrid.setHeight(300);
    		listGrid.setDataSource(dataSource);
    		listGrid.setAutoFetchData(true);
    		listGrid.addRecordClickHandler(new RecordClickHandler() {
    			public void onRecordClick(RecordClickEvent event) {
    				form.reset();
    				form.editSelectedData(listGrid);
    			}
    		});
    
    		layout.addMember(listGrid);
    		layout.addMember(form);
    
    		IButton button = new IButton("Salvar");
    		button.addClickHandler(new ClickHandler() {
    			public void onClick(ClickEvent event) {
    				form.saveData();
    			}
    		});
    		layout.addMember(button);
    
    		layout.setWidth100();
    		layout.draw();
    		
    		w.setCanDrag(true);
    		w.setCanDragResize(true);
    		w.addItem(layout);
    		w.setPixelSize(800, 500);
    		w.setTitle("Gerenciamento de usuários");
    		
    		//w.draw();
    	}
    }
    The DataSource is almost untouched from the version found in this thread.

    Thanks.

    Leave a comment:

Working...
X