Captive Imagination
September 10, 2010, 03:43:35 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Hosting change completed. Please send an e-mail to support@captiveimagination.com if you have any problems.
 
   Home   Help Search Calendar Login Register  
Pages: 1 [2]  All   Go Down
  Print  
Author Topic: A collection of wierdnesses I found in some components.  (Read 4291 times)
0 Members and 1 Guest are viewing this topic.
GrandMasterBirt
Full Member
***
Offline Offline

Posts: 148


View Profile
« Reply #15 on: June 11, 2008, 08:50:53 PM »

For the scrolling, I think the best solution is to add a Box to the application. This box has a min width auto height, width 100%. The application sets the vertical/horizontal scroll policies, and thats it. Then when anything is below size you get the nice scroll bars to scroll through all content horizontally and vertically always on sides of screen. I was doing it incorrectly. Sorry for wasting your time.
Logged
GrandMasterBirt
Full Member
***
Offline Offline

Posts: 148


View Profile
« Reply #16 on: June 11, 2008, 10:01:55 PM »

I noticed TextInput does not dispatch KEY_UP events.

Code:
private EventHandler enterKeyHandler = new EventHandler(new  EventListener(){
@Override
public void eventOccurred(final Event evt) throws Exception {
                System.out.println("Hit");
KeyEvent kev = (KeyEvent) evt;
if(kev.getKey().equals(Key.ENTER)){
UIRobot.click(searchButton,0,0,0,0,false,false,false);
}
}
},true,false,Event.Type.KEY_UP);

Never gets called after adding it as

Code:
TextInput foo = new TextInput();
foo.addEventListener(enterKeyHandler);

Am I doing something wrong or is the event just not getting dispatched?
Logged
darkfrog
Administrator
Inspired Imagination
*****
Offline Offline

Posts: 2650


View Profile
« Reply #17 on: June 12, 2008, 07:14:54 AM »

It works fine for me...

Code:
    input = new TextInput();
   
    EventHandler enterKeyHandler = new EventHandler(new  EventListener(){
    public void eventOccurred(final Event evt) throws Exception {
                System.out.println("Hit");
    }
    },true,false,Event.Type.KEY_UP);
    input.addEventListener(enterKeyHandler);
   
    add(input);

Is there something else in your code perhaps preventing that from happening (stop propagation perhaps) or overriding update/init and not calling super?
Logged
GrandMasterBirt
Full Member
***
Offline Offline

Posts: 148


View Profile
« Reply #18 on: June 12, 2008, 09:53:43 AM »

The object is a plain TextInput. It is contained inside a CustomComponent. The listener is the CustomComponent itself.

No calls to .stopPropagation.
Logged
darkfrog
Administrator
Inspired Imagination
*****
Offline Offline

Posts: 2650


View Profile
« Reply #19 on: June 12, 2008, 02:07:07 PM »

Post the complete code for the custom component and I'll have a look.

BTW, you don't need to acceptRecursion flag set since you're listening to the component itself and there are no children under it.
Logged
GrandMasterBirt
Full Member
***
Offline Offline

Posts: 148


View Profile
« Reply #20 on: June 15, 2008, 10:54:19 PM »

Correction to pagination issue: If you paginate to a different page, the selection remains the row that was previously selected AND no selected/unselected event is fired. (that was old info) [new info] when selecting another row no selected event is fired the first time. After the first time normal behavior resumes.
Logged
darkfrog
Administrator
Inspired Imagination
*****
Offline Offline

Posts: 2650


View Profile
« Reply #21 on: June 16, 2008, 07:39:36 AM »

You believe it should clear the selection entirely when you change pages or maintain selection across multiple pages?
Logged
GrandMasterBirt
Full Member
***
Offline Offline

Posts: 148


View Profile
« Reply #22 on: June 16, 2008, 09:07:19 AM »

I think clear IF no-selection is allowed. If not, then ensure that events get dispatched for selected/unselected. Also when clearing selection ensure that unselected event gets dispatched.
Logged
darkfrog
Administrator
Inspired Imagination
*****
Offline Offline

Posts: 2650


View Profile
« Reply #23 on: June 16, 2008, 09:31:54 AM »

What do you mean by, "if no selection is allowed"?
Logged
GrandMasterBirt
Full Member
***
Offline Offline

Posts: 148


View Profile
« Reply #24 on: June 16, 2008, 12:27:59 PM »

BasicSelectionManager(Container container, boolean multiSelect, boolean allowNone)

If allowNone is true, then deselect with the appropriate unselected event.
If allowNone is false, then just dispatch the appropriate selected unselected events.
Logged
darkfrog
Administrator
Inspired Imagination
*****
Offline Offline

Posts: 2650


View Profile
« Reply #25 on: June 16, 2008, 02:06:52 PM »

ah, gotcha'
Logged
Pages: 1 [2]  All   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.238 seconds with 22 queries.