Found this old thread, and thought it worth commenting.

I took a variant of Ralf's approach in an effort to get tabbing/enter key 
movement to the next cell.  In my recreation of EditTextCell, I revised the 
commit method:

   private void commit(Context context, final Element parent, ViewData 
viewData,
         ValueUpdater<String> valueUpdater)
   {
      String value = updateViewData(parent, viewData, false);
      clearInput(getInputElement(parent));
      setValue(context, parent, viewData.getOriginal());
      if (valueUpdater != null)
      {
         valueUpdater.update(value);
      }
      Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
         @Override
         public void execute()
         {
            NativeEvent clickEvent = Document.get().createClickEvent(1, 0, 
0, 0, 0, false, false, false, false);
            Element td = parent.getParentElement();
            Element nextTd = td.getNextSiblingElement();
           if (nextTd != null){
              nextTd.dispatchEvent(clickEvent);
           }
         }
      });
   }

It seems to work, and has the benefit that I don't need to extend or 
rewrite every possible editable cell type.

But, I don't know if there are any pitfalls that I've missed, other than it 
won't jump over a non-editable column to the subsequent editable column, 
and it won't jump to the next row.

Steve

On Friday, April 13, 2012 1:16:10 PM UTC-4, Alfredo Quiroga-Villamil wrote:
>
> Scenario is as follows:
>
> - CellTable with a column containing an EditTextCell.
> - Add new record to the ListDataProvider.
> - I can edit and do all the good stuff by hand to the newly added record 
> in the CellTable.
>
> Requirement:
>
> - Programmatically call a starttEdit on say the first cell of the newly 
> created row/record.
>
> My investigation results:
>
> After going through the code and investigating, all roads seem to point to 
> ViewData in EditTextCell. Specifically, ViewData in EditTextCell has 
> setEditing(boolean) which should do the trick. However, ViewData has 
> package access.
>
> Before I go and start to override, copy/paste things to be able to access 
> the ViewData member I need, I figured I ask first since this seems like a 
> basic operation when adding new records to a CellTable. I am thinking that 
> I am very likely missing something.
>
> Any help/pointers are appreciated.
>
> Thanks,
>
> Alfredo
>
> -- 
> Alfredo Quiroga-Villamil
>
> AOL/Yahoo/Gmail/MSN IM:  lawwton
>
>
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to