Announcement

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

    Listgrid select a row

    Hello

    I have a listGrid and a form that is construct with same Datasources

    When I add or I save the form a new row appear in the listgrid that good.

    But I want to select this row.

    I do this :
    Code:
    Button save = new Button("save");
    save.addClickHandler(new ClickHandler() {
    			
        @Override
        public void onClick(ClickEvent event) {
            form.saveData(new DSCallback() {
    			
            @Override
             public void execute(DSResponse response, Object rawData, DSRequest   request) {
            SC.say("ok save ");
    	list.selectRecord(form.getValuesAsRecord());
            }
        });
    				
    }
    });
    But nothing is selected in the list grid !

    what can I do ?

    I have also play with

    onDataArrived (that need a list.fetch) not good !
    onSelectionChanged or UpdateSelection

    Thanks

    #2
    ok I have to do this

    Code:
    		Button save = new Button("save");
    		save.addClickHandler(new ClickHandler() {
    
    			@Override
    			public void onClick(ClickEvent event) {
    				list.fetchData(); //because of filtered data in grid
    				form.saveData(new DSCallback() {
    
    					@Override
    					public void execute(DSResponse response, Object rawData,
    							DSRequest request) {
    						SC.say("ok save ");
    						//list.selectRecord(form.getValuesAsRecord());
    						Record rec = list.getRecordList().find("id", form.getValuesAsRecord().getAttribute("id"));
    						list.selectRecord(rec);
    					}
    				});
    
    			}
    		});
    So list.selectRecord(form.getValuesAsRecord()); doesn't work
    and this is ok
    Record rec = list.getRecordList().find("id",form.getValuesAsRecord().getAttribute("id"));
    list.selectRecord(rec);

    I think this is a bug !
    because selectRecord use find (findByKeys)

    Comment


      #3
      When ever the table contains about 8000 rows it's doesn't work

      Please respond

      Comment

      Working...
      X