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

Power User

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

Hi,
I have a code peace that recalculates a grid:

Code:
	
 public void onRowSelect() {
 			selectedQuery = this;
 			// listOfInteractiveComponents.deselectCurrentSelection();
 			AnalyticQuery analyticQuery = selectedQuery.getAnalyticQuery();
 			if (analyticQuery != null) {
 				ArrayList<String> dependencies = analyticQuery.getDependencyList();
 				if (dependencies != null) {
 					ArrayList<ComponentItem> list = (ArrayList<ComponentItem>) listOfInteractiveComponents.getItems();
 					for (ComponentItem component : list) {
 						if (dependencies.contains(component.getComponentId())) {
 							// component.setSelected(true);
 							listOfInteractiveComponents.selectItem(component, false);
 						} else {
 							// component.setSelected(false);
 							listOfInteractiveComponents.deselectItemWCB(component, false);
 						}
 					}
 				}
 			}
 		}
 
 

I use
Code:
 listOfInteractiveComponents.selectItem(component, false);
 listOfInteractiveComponents.deselectItemWCB(component, false);
 

as I don't want to receive any callbacks to onRowSelect/onRowDeselect of the grid's item.

As shown here I cannot stop it:
Code:
 Daemon Thread [http-50000-3] (Suspended (breakpoint at line 1348 in AnalyticTemplateMBean$ComponentItem))	
 	AnalyticTemplateMBean$ComponentItem.onRowDeselect() line: 1348	
 	AnalyticTemplateMBean$ComponentItemList(FIXGRIDBinding<itemClass>).deselectItemWCB(IFIXGRIDItem, boolean) line: 1735	
 	AnalyticTemplateMBean$UIQueryItem.onRowSelect() line: 1278	
 	FIXGRIDListBinding<ItemClass>(FIXGRIDBinding<itemClass>).selectItemWCB(IFIXGRIDItem, boolean) line: 1680	
 	FIXGRIDListBinding<ItemClass>(FIXGRIDBinding<itemClass>).selectItem(IFIXGRIDItem) line: 1672	
 	FIXGRIDListBinding<ItemClass>(FIXGRIDBinding<itemClass>).updateItemSelection(IFIXGRIDItem) line: 1646	
 	FIXGRIDListBinding<ItemClass>(FIXGRIDBinding<itemClass>).onGridActionExecute(ActionEvent) line: 1426	
 	FIXGRIDListBinding<ItemClass>(FIXGRIDBinding<itemClass>).onGridAction(ActionEvent) line: 1378	
 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available	
 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not available	
 	Method.invoke(Object, Object...) line: not available	
 	StackedMethodExpression.invoke(ELContext, Object[]) line: 68	
 	MethodExpressionDelegator.invoke(ELContext, Object[]) line: 108	
 	MethodExpressionDelegator.processAction(ActionEvent) line: 196	
 	FIXGRIDComponent(BaseActionComponent).broadcast(FacesEvent) line: 259	
 	UIViewRoot.broadcastEvents(FacesContext, PhaseId) line: 475	
 	UIViewRoot.processUpdates(FacesContext) line: 729	
 	UpdateModelValuesPhase.execute(FacesContext) line: 78	
 	UpdateModelValuesPhase(Phase).doPhase(FacesContext, Lifecycle, ListIterator<PhaseListener>) line: 100	
 	LifecycleImpl.execute(FacesContext) line: 118	
 	FacesServlet.service(ServletRequest, ServletResponse) line: 265	
 	ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 290	
 	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206	
 	LoginFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 46	
 	ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235	
 	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206	
 	ThreadingFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 226	
 	ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235	
 	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206	
 	CompressionFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 33	
 	ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 235	
 	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 206	
 	StandardWrapperValve.invoke(Request, Response) line: 233	
 	StandardContextValve.invoke(Request, Response) line: 191	
 	StandardHostValve.invoke(Request, Response) line: 128	
 	ErrorReportValve.invoke(Request, Response) line: 102	
 	StandardEngineValve.invoke(Request, Response) line: 109	
 	CoyoteAdapter.service(Request, Response) line: 286	
 	Http11Processor.process(Socket) line: 845	
 	Http11Protocol$Http11ConnectionHandler.process(Socket) line: 583	
 	JIoEndpoint$Worker.run() line: 447	
 	Thread.run() line: not available	
 


Shall I use component.setSelected(false); which is not recommend by the API?

Regards,

Joachim
CaptainCasa

Power User
[Avatar]

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

Hi,

NEVER call setSelected() on Item level!!! The JavaDoc tries to "forbid" this to everyone... ;-)

BUT: call selectItem/deselectItem - both methods provide a parameter variant by which you can decide if to execute the normal "binding processing" (onRowSelect/Deselect). Please check JavaDoc of FIXGRIDBinding.

Regards, Björn

Björn Müller, CaptainCasa GmbH
unger

Power User

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

Hi Björn,

I did so. I used false as actual parameter. But the items were called back!

Joachim
CaptainCasa

Power User
[Avatar]

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

...oh, yes you're rigfht: in the deselect case the boolean parameter is something different (I shoud have checked the javadoc on my own...)

We can add such a method...

Regards, Björn

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