|
|
|
|
|
Re: Paging Ivan! [message #132292 is a reply to message #132279] |
Tue, 12 May 2009 05:31 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Hi Howard,
maybe you don't need to test the BackSpace character at all. In the
verifyText if the text length is above the limit, substring it to the
textLimit and set the event.text to the substringed value.
Best,
Ivan
Howard wrote:
> Thanks Ivan.
>
> I tried to implement the verify listener, and noticed that RAP
> VerifyEvent extends TypedEvent instead of KeyEvent like SWT. This
> means no access to character field, so I can't test for BackSpace
> character. This is annoying because if I'm AT the limit, and try to
> backspace, I'll trigger this check:
>
> limit <= textField.getCharCount()
>
> which means either the popping a warning, or setting e.doit=false.
> Neither of which is pretty without the backspace check to allow
> deletion. Any suggestions?
>
> Howard
>
>
> Ivan Furnadjiev wrote:
>
>> Howard,
>
>> M7 is already on the way. Patching Qooxdoo about this bug is not an
>> easy task - this functionality is missing from the qooxdoo TextArea
>> component (HTML textarea has no such attribute maxLength).
>> As a workaround you can use a verify listener to check the typed
>> content length and not to allow the characters to exceed the max limit.
>
>> Best,
>> Ivan
>
>> Howard wrote:
>>> Thanks for the quick responses.
>>>
>>> Is there a way for me to patch in the fix in case the Qooxdoo team
>>> doesn't respond by Monday morning?
>>>
>>>
>>> Also...is M7 on track to come out on Monday? Any idea what time frame?
>>>
>>> Howard
>>>
>
>
|
|
|
|
Re: Still no joy...help?! [message #132426 is a reply to message #132413] |
Tue, 12 May 2009 15:42 |
Ivan Furnadjiev Messages: 2426 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Howard,
get the text from the event object itself and not from the textField.
Something like that:
String text = event.text;
if (limit < text.length) {
e.text = text.substring(0, limit);
}
Please note that the RAP verify event text field differ from the SWT and
contains the complete text (not only the modified region). See this bug
for more details:
244008: VerifyEvent field values differ from SWT
https://bugs.eclipse.org/bugs/show_bug.cgi?id=244008
Best,
Ivan
Howard wrote:
> That's an interesting idea, but unless I'm doing something wrong, the
> solution still doesn't work that well in RAP. Works great in SWT of
> course.
>
> if (limit < textField.getCharCount()) {
> e.text = textField.getText().substring(0, limit);
> }
>
> Seems like RAP doesn't get the e.start and e.end fields cleanly,
> and/or setting e.text. I'm able to exceed the limit if I type fast.
> And I just remembered that RAP doesn't check every character but in
> bunches, which then makes sense that any of these solutions won't work
> all that well.
>
> I guess unless there are any more solutions, I would need to TRY to
> help the user out by attempting to limit/warn the user, and then
> manually truncate incoming data.
>
> Howard
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03825 seconds