Author |
Message |
03/12/2009 12:21:01
|
hartmann
Power User
Joined: 20/08/2008 16:27:48
Messages: 73
Offline
|
Hi,
when adding a new row to a fixgrid I want to set the focus into the first field of the added line. I tried like this:
public void onAdd(ActionEvent event) {
requestFocusFirstName = RequestFocusManager.getNewRequestFocusCounter();
m_grid.deselectCurrentSelection();
GridItem item = addRow();
m_grid.selectItem(item);
m_grid.ensureItemToBeDisplayed(item);
}
but the focus is set to first filed in first line.
What's the right way to do that?
Horst
Filename |
demo.zip |
Download
|
Description |
|
Filesize |
1 Kbytes
|
Downloaded: |
401 time(s) |
|
|
|
03/12/2009 13:11:21
|
hartmann
Power User
Joined: 20/08/2008 16:27:48
Messages: 73
Offline
|
Hi,
got the solution myself. Just define the 'requestfocus'-attribute in the rowitem:
public void onAdd(ActionEvent event) {
m_grid.deselectCurrentSelection();
GridItem item = addRow();
m_grid.selectItem(item);
m_grid.ensureItemToBeDisplayed(item);
item.setRequestFocusItem(RequestFocusManager
.getNewRequestFocusCounter());
}
sorry for wasting your time
Horst
|
|
|
03/12/2009 17:24:48
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5555
Offline
|
Hi,
there is a nicer way...:
FIXGRIDListBinding has a method "selectAndFocusItem". With this method the first focus-able component of the grid will be focussed, so you do not have to do the requestFocus-things. If the grid's columns are changed, then your requestFocus-management will not properly work (e.g. if the user re-arranges columns) - the "selectAndFocusItem" method will always focus the first one...
Regards, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
17/05/2010 11:38:49
|
levy
Power User
Joined: 12/03/2008 16:38:22
Messages: 308
Location: XpertCenter
Offline
|
Hi,
I must provide the same behaviour for a ROWDYNAMICCONTENTBinding.
For example, lets look at the workpage "dynamic form" of the demo workplace:
1. Start the workpage
2. Add a lot of new comments until scroll bar appears
3. Scroll to the very bottom
4. Add a new comment
--> I would like the new comment to be visible
I have tried to set the focus by means of requestfocus-attribute, but it didn't work.
Any ideas?
Regards, Daniel
|
|
|
17/05/2010 11:46:49
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5555
Offline
|
...it should work with the focus management - any component that is focussed should be scrolled so that is gets visible.
Does the focus itself move into the newly created field? (you can test by entering some characters just after the page was updated, then scroll down and check if the characters are shown)
Regards, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
17/06/2010 09:00:41
|
rheinrichs
Power User
Joined: 08/05/2009 10:05:36
Messages: 209
Offline
|
Hi,
we have a problem with der FixGrid#selectAndFocusItem().
Sometime, e.g. a t:foldablepane is closed in combination with new Items, the function don't work for me.
Any idea? Need screenshots?
best regards
|
|
|
17/06/2010 09:03:51
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5555
Offline
|
...yes, definitely need more info. Either screen shot, or screen sharing, even better.
Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
17/06/2010 09:29:46
|
rheinrichs
Power User
Joined: 08/05/2009 10:05:36
Messages: 209
Offline
|
... maybe there is a different problem with t:foldablepane?
(@see: screenshot)
|
Filename |
bug2.jpg |
Download
|
Description |
|
Filesize |
35 Kbytes
|
Downloaded: |
349 time(s) |
|
Filename |
bug1.jpg |
Download
|
Description |
|
Filesize |
29 Kbytes
|
Downloaded: |
343 time(s) |
|
|
|
18/06/2010 19:04:08
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5555
Offline
|
OK... ...problem is (should be) solved with next update.
Thanks for telling us!
Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
|