Hello,

I found another hint, that may be useful: Within the same application I do 
the same thin in a toally other way: This time, the list is a CellTable and 
the commands are rendered as a custom cell (see below). The anchors are 
created in a totally different way. But the same problem exists here, too! 
Isn't that strange?

I hope that these observations brings us closer to the solution.

(BTW: I wanted to try the HyperLink class, but when rendering into a cell 
one has put everything into a SafeHtmlBuilder. Can I use a HyperLink widget 
here?)

Magnus

public class ListCommandCell extends AbstractCell<ListCommandContext>
{
 public ListCommandCell ()
 {
  super ("click");
 }

 @Override
 public void render (Context context,ListCommandContext 
value,SafeHtmlBuilder sb)
 {
  boolean first = true;
  
  for (ListCommand c : value.cmd)
  {
   if (first)
    first = false;
   else
    sb.appendHtmlConstant("&nbsp;");

   
   String e = ListCommand.enc(c);
   String l = c.getLbl();
   String t = renderCommand (e,l);
   
   sb.appendHtmlConstant(t);
  }
 }
 
 public String renderCommand (String cmd,String lbl)
 {
  String t = "<a href='javascript:;' style='cursor: hand;' cmd='" + cmd + 
"'>" + lbl + "</a>";
  
  return (t);
 }

 @Override
 public void onBrowserEvent (Context context, Element parent,/*Game*/ 
ListCommandContext value,NativeEvent event, 
ValueUpdater</*Game*/ListCommandContext> valueUpdater)
 {
  super.onBrowserEvent(context, parent, value, event, valueUpdater);
  
  EventTarget tgt = event.getEventTarget();
  Element e = Element.as(tgt);
  
  String a = e.getAttribute("cmd");
  
  ListCommand c = ListCommand.dec(a);
  
  value.prc.onListCommand(c,value.idx);
 }
}

-- 
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/groups/opt_out.


Reply via email to