Announcement

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

    #76
    Hello.
    In example DS (TestDataSource.java) @alius creates new record in ExecuteAdd method, for example:

    Code:
    TestRecord testRec = new TestRecord ();
    Is there any way to use existence domain object instead of creating new. For example: I have a form, which contain data from fetched domain object and I want save this object. I should transmit object to DS, where I can copy values from ListGrid to object attributes and then merge it using Gilead.

    Thanks. Any help would be appreciated.

    Comment


      #77
      Hello,

      I use your DataSource implementation and I have a little problem in my executeUpdate method. My grid is always sorted and when I update a record, this record is add in the end of the grid (the grid becomes unsorted).

      Are there any solution to resolve my problem?

      thx

      Comment


        #78
        Is there a good way to integrate the RPCRequest.showPrompt(...) to GWT-RPC DataSource? In current implementation, the cursor pointer is always pointer cursor. There is no indication to end user the browser is busy in communicating with server.
        thanks
        -jason

        Comment


          #79
          Originally posted by alius
          Hi,

          Problem is that response.setData () accepts only ListGridRecord[].

          (Question to Sanjiv: if DSResponse is quite general object, DataSource objects are used not only in ListGrid - why it accepts only one type of record? Possible solutions would be:
          1. accept Record[];
          2. add setData methods with different parameters.
          )


          You can try to overcome this (I haven't tried it myself):

          Create TileRecord[] (fill it with data from List you've got from server).
          Instead of response.setData (list) use response.setAttribute ("data", list);

          Hope that helps,
          Aleksandras
          DSResponse.setData now accepts Record[].

          Sanjiv

          Comment


            #80
            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.

            Comment


              #81
              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.

              Comment


                #82
                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.

                Comment


                  #83
                  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.

                  Comment


                    #84
                    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.

                    Comment


                      #85
                      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

                      Comment


                        #86
                        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

                        Comment


                          #87
                          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,

                          Comment


                            #88
                            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.

                            Comment


                              #89
                              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

                              Comment


                                #90
                                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

                                Comment

                                Working...
                                X