Tuesday, April 15, 2014

Re: TextArea in Custom Cell won´t allow space characters

Ahh got it working! I needed to override the isEditing method so that it will return true if the textarea is focused.

Am Dienstag, 15. April 2014 23:15:52 UTC+2 schrieb Jambi:
It seems that for me it would be easier to prevent the CellList to prevent the behaviour I mentioned. This approach seems to create a TextInput Cell but I want to use my own Element composition within my CustomCell since the TextArea is only one part of it. Or does this code have the necessary fragments that would prevent the selection from intercepting the keyup event for the space bar? 

Am Dienstag, 15. April 2014 22:48:23 UTC+2 schrieb Juan Pablo Gardella:


2014-04-15 17:35 GMT-03:00 Jambi <michael.l...@googlemail.com>:
Hey there,

I am stucking with implementing a TextArea within a custom cell. The focus event on click works and I can type in some characters. But the cell won´t allow any space characters since the keyup on space bar seems to be reserved by the CellList itself for selection stuff. What I want to do is to completely disable/ignore all selection functionalities of the CellList and I tried it with something like this:

list.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);

list.setSelectionModel(new NoSelectionModel());

but theres no difference. Arrow key up and down should also be disabled. I just want the regular TextArea behaviour int the TextArea.

In my CustomCell class in onBrowserEvent I can do something like this (after registered the KEYUP event in the constructor):

if(event.getType().equals(BrowserEvents.KEYUP) && event.getKeyCode() == KeyCodes.KEY_SPACE) {
  ... code does execute here ...
}

But I have no Idea how to implement the native space bar manually. It should be easy to append a space character at the end of my textarea string. But I would need the cursor position if I want to put a space in between characters and so forth. This would be one huge hack. I wouldn´t like this ,). Wouldn´t solve the key up and down issue though.

I wasted hours on this now... please help (=


Cheers,

Michael


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@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.

No comments:

Post a Comment