[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Fixgrid  XML
Forum Index -> Development
Author Message
unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

Hi,

the workplace tool shows me a ouple of events for a fixgrid. (GridRowSelect, GridRowExecute)

The way I catch these events is like that:
Code:
 	public class MyGrid extends FIXGRIDListBinding<FilmData> {
 		@Override
 		public void onGridAction (ActionEvent event) {
 			if (event instanceof BaseActionEventGridRowSelect) {
 				FilmData sel = grid.getSelectedItem ();
 				SearchDetailUI m_sdui = (SearchDetailUI) m_dispatcher.getDispatchedBean (SearchDetailUI.class);
 				m_sdui.setFilm (sel);
 			}
 			else if (event instanceof BaseActionEventGridRowExecute) {
 				FilmData sel = grid.getSelectedItem ();
 				SearchDetailUI m_sdui = (SearchDetailUI) m_dispatcher.getDispatchedBean (SearchDetailUI.class);
 				m_sdui.setFilm (sel);
 			}
 			super.onGridAction (event);
 		}
 
 	};
 


This works fine. To avoid any inner classes I would like to drag an action listener into the actionListener field of the fixgrid. When I do so the tool accepts the input but the listener will not be invoked.

Any help?

Joachim
mreich

Power User
[Avatar]

Joined: 30/01/2009 08:34:23
Messages: 744
Offline

Hi Joachim,

can you verify that the ActionEvent is type javax.faces.ActionEvent and not java.swt.ActionEvent?
May you take a look at the log file \enterpriseclient\server\tomcat\work\Catalina\localhost\project

Markus
[WWW]
unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

Dear Markus,

I am sure, it is javax.faces.event.ActionEvent.

Is it in principle possible, to define an ActionListener on the fixgrid item?

Joachim
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5521
Offline

The actionListener for the grid is responsible for "whole grid" events, i.e. if you drop some content on an empty area of the grid.

If you drop onto lines, then the corresponding line action listener are invoked...:

(I) Either you define per cell control within the line the DROPRECEIVE and the corresponding actionlistener...

(II) ...or you define FIXGRID-ROWDROPRECEIVE on grid level and override onRwoDrop(...) within the grid item implementation.

Typically II is simpler, but does not allow cell-specific-drop-behaviour.

Björn

PS: please check drag&drop examples within the demo workplace

Björn Müller, CaptainCasa GmbH
unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

Hi Björn,

I like to handle row selection in the UI class, not inside the row (griditem) class, because the row should be a simple object (POJO) that does not know anything about the user interface.

Is the hint in the developement tool "Events: GridRowSelect, ..." correct? If I map a managed bean method to the ActionListener of the grid, there is no notification when a row is selected.

So am I right in the way I show in the listing?

Joachim
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5521
Offline

we added an example (20090622) in grid section "Grid of BeanObjects" in order to show how to integrate existing beans from logic layer into grid processing.

Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team