voyent
Force a "bit" of a page to re-fresh!  XML
Forum Index -> JBoss Seam Integration Go to Page: 1, 2 Next 
Author Message
tony.herstell

Joined: 01/Dec/2006 00:00:00
Messages: 206
Offline


Given:

Code:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml"
 	xmlns:h="http://java.sun.com/jsf/html"
 	xmlns:ui="http://java.sun.com/jsf/facelets"
 	xmlns:f="http://java.sun.com/jsf/core"
 	xmlns:s="http://jboss.com/products/seam/taglib"
 	xmlns:ice="http://www.icesoft.com/icefaces/component">
 	<head>
 		<meta http-equiv="Content-Type"
 			content="text/html; charset=iso-8859-1" />
 		<link rel="stylesheet" type="text/css" href="./css/risingstars.css" />
 		<link rel="stylesheet" type="text/css" href="./xmlhttp/css/xp/xp.css" />
 		<title>Upload</title>
 	</head>
 	<body>
 
 		<ui:composition xmlns="http://www.w3.org/1999/xhtml"
 			xmlns:ui="http://java.sun.com/jsf/facelets"
 			xmlns:h="http://java.sun.com/jsf/html"
 			xmlns:f="http://java.sun.com/jsf/core"
 			xmlns:s="http://jboss.com/products/seam/taglib"
 			xmlns:ice="http://www.icesoft.com/icefaces/component"
 			template="/WEB-INF/pages/template.xhtml">
 
 			<!-- content -->
 			<ui:define name="title">
 				<ice:outputText value="#{messages.form_upload}" />
 			</ui:define>
 			<ui:define name="content">
 
 			<ice:form>
 				<ice:panelGrid columns="1">
 					<fieldset>
 						<legend>
 							<ice:outputText value="#{messages.fieldset_upload}" />
 						</legend>
 							<ice:panelGrid columns="1">
 								<ice:graphicImage value="/content/images?id=#{pictureId}&thumbnail=false"/>
 							</ice:panelGrid>
 							<!-- Messages -->
 							<ice:panelGrid columns="1">
 								<ice:messages infoClass="error" globalOnly="true" />
 							</ice:panelGrid>
 
 							<ice:panelGrid columns="1">
 								<fieldset>
 									<legend>
 										<ice:outputText value="#{messages.fieldset_upload}"/>
 									</legend>
 									
 									<ice:panelGrid columns="1">
 										<ice:inputFile style="border:none; width:400px; height:70px;"
                                 			actionListener="#{uploadController.action}"/> <!-- progressListener="#{uploadController.progress}" -->
                         				<ice:outputProgress id="progress" value="#{uploadController.percent}"/>
 									</ice:panelGrid>
 
 									<ice:panelGrid columns="1" width="100%">
 										<div align="right">
 											<ice:commandButton action="#{uploadController.cancel}"
 												value="#{messages.button_cancel}" immediate="true"
 												type="submit" />
 											<ice:commandButton id="done" type="submit"
 												value="#{messages.button_done}" immediate="true"
 												action="#{uploadController.done}" />
 										</div>
 									</ice:panelGrid>
 
 								</fieldset>
 							</ice:panelGrid>
 
 						</fieldset>
 					</ice:panelGrid>
 				</ice:form>
 
 			</ui:define>
 			<!-- content -->
 		</ui:composition>
 
 	</body>
 
 </html>
 


I want to force
Code:
 <ice:graphicImage value="/content/images?id=#{pictureId}&thumbnail=false"/>
 


to be re-drawn (after I have uploaded an image using this page).

Can you advise how I do this?

(hoping you are not going to say use "bindings" as these still don't appear to work).

:)
tony.herstell

Joined: 01/Dec/2006 00:00:00
Messages: 206
Offline


Guys, any idea about this?
I can actually go the browser re-fresh button and hey-presto the new image appears... but there must be a better way to do this??

Basically the pictureId has changed so I just need to give the page a kick somehow to get the image re-requested from the "content" servlet?

Ohh.. so close to finishing this upload image bit....


greg.dick

Joined: 26/Oct/2004 00:00:00
Messages: 85
Offline


Normally, we would suggest that you drive this from the server, via the RenderManager. We're still working on getting classloading issues straightened out with that approach, but the following should work.

In the constructor of your uploadController, grab the reference to the PersistentFacesState object.

PFState state = PersistentFacesState.getInstance();

Then, in the FileUpload Bean, for example, we've been doing the following. For you, wherever you know that you need to re-render:

try {
// execute the lifecycle to initialize Seam to prevent
// IllegalStateExceptions, and render.
state.execute();
state.render();

} catch (RenderingException re ) {
System.out.println("Rendering exception : " + re);
re.printStackTrace();
}
[Email]
tony.herstell

Joined: 01/Dec/2006 00:00:00
Messages: 206
Offline


Thanks Greg,

I think you think you are talking to someone who knows something about how it all works :(

I have a bit in the page that I want to force to "re-do"
<ice:graphicImage value="/content/images?id=#{pictureId}&thumbnail=false"/>

This will re-call the contentServlet and this will feed back the bytes for the new image.

Code:
 	@Override
 	protected void doGet(HttpServletRequest request,
 			HttpServletResponse response) throws ServletException, IOException {
 
 		if (IMAGES_PATH.equals(request.getPathInfo())) {
 			ContentController contentController = (ContentController) Component
 					.getInstance(ContentControllerImpl.class);
 
 			String id = request.getParameter("id");
 			Image imageToFetch = null;
 			if (id != null && !"".equals(id)) {
 				imageToFetch = contentController.getImage(Long.parseLong(id));
 			}
 
 			boolean thumbnailRequired = true;
 			String thumbnailRequiredParameter = request.getParameter("thumbnail");
 			if (thumbnailRequiredParameter != null && !"".equals(thumbnailRequiredParameter)) {
 				thumbnailRequired = Boolean.parseBoolean(thumbnailRequiredParameter);
 			}
 			
 			String contentType = null;
 			byte[] data = null;
 
 			if (!thumbnailRequired && imageToFetch != null && imageToFetch.getImage() != null && imageToFetch.getImage().length > 0) {
 				contentType = imageToFetch.getType();
 				data = imageToFetch.getImage();
 			} else if (thumbnailRequired && imageToFetch != null && imageToFetch.getThumbnail() != null && imageToFetch.getThumbnail().length > 0) {
 				contentType = imageToFetch.getType();
 				data = imageToFetch.getThumbnail();
 			} else if (noImage != null) {
 				contentType = "image/png";
 				data = noImage;
 			}
 
 			if (data != null) {
 				response.setContentType(contentType);
 			}
 			response.getOutputStream().write(data);
 			response.getOutputStream().flush();
 		}
 	}
 



when the image is uploaded from the upload component it comes into the action method:

Code:
          // The image needs to be in the database to be picked up by the Content servlet.
 	em.persist(image);
 			
 	// Re Read the image back (gets the primary key too)
 	try {
 		Object resultOfQuery = em.createQuery("from Image i where i.name = :name")
 			.setParameter("name", fileName)
 				.getSingleResult();
 		this.image = (Image)resultOfQuery;
 	        // Get the parentObjectPrimaryKey for the picture (so on page refresh will show THIS image)
 	        picturePrimaryKey = this.image.getId();
 


from...

Code:
     @TransactionAttribute(TransactionAttributeType.REQUIRED)
     public void action(ActionEvent event) {
     	log.info("> action");
         InputFile inputFile = (InputFile) event.getSource();
         if (inputFile.getStatus() == InputFile.SAVED) {
             String fileName = inputFile.getFileInfo().getFileName();
             String contentType = inputFile.getFileInfo().getContentType();
 
             File file = inputFile.getFile();
             byte[] inputFileAsBytes = getFileAsBytes(file);
             
     		// Check if the image needs to be rescaled
             int width = Math.min(MAX_IMAGE_WIDTH, 70);
             ImageIcon icon = new ImageIcon(inputFileAsBytes);
 			boolean rescale = false;
 			if (width > 0 && width != icon.getIconWidth()) {
 				rescale = true;
 			}
 
 			byte[] inputFileAsThumbnailAsBytes = null;
         	// Rescale the image if required
         	if (rescale) {
         		inputFileAsThumbnailAsBytes = getRescaledImageAsBytes(contentType, width, icon); 
         	} else {
         		inputFileAsThumbnailAsBytes = inputFileAsBytes;
         	}
 			Image image = (Image)Component.getInstance("image", true);
 			image.setName(fileName);
 			image.setType(contentType);
 			image.setThumbnail(inputFileAsThumbnailAsBytes);
 			image.setImage(inputFileAsBytes);
 			image.setVersion(0);
 			
             // The image needs to be in the database to be picked up by the Content servlet.
 			em.persist(image);
 			
 			// Re Read the image back (gets the primary key too)
 			try {
 				Object resultOfQuery = em.createQuery("from Image i where i.name = :name")
 					.setParameter("name", fileName)
 						.getSingleResult();
 				this.image = (Image)resultOfQuery;
 	            // Get the parentObjectPrimaryKey for the picture (so on page refresh will show THIS image)
 	            picturePrimaryKey = this.image.getId();
 			} catch (NoResultException nre) {
 				log.error("Whoops! Image just inserted not found!");
 				List<Image> resultListOfQuery = em.createQuery("from Image").getResultList();
 				for (Image eachimage: resultListOfQuery) {
 					log.info(eachimage);
 				}
 			}
 
         } else if (inputFile.getStatus() == InputFile.INVALID) {
             inputFile.getFileInfo().getException().printStackTrace();
         } else if (inputFile.getStatus() == InputFile.SIZE_LIMIT_EXCEEDED) {
             inputFile.getFileInfo().getException().printStackTrace();
         } else if (inputFile.getStatus() == InputFile.UNKNOWN_SIZE) {
             inputFile.getFileInfo().getException().printStackTrace();
         }
         log.info("< action");
     }
 


what do I put where?
tony.herstell

Joined: 01/Dec/2006 00:00:00
Messages: 206
Offline


just added the synchronous update to false.
greg.dick

Joined: 26/Oct/2004 00:00:00
Messages: 85
Offline


And have the following in your web.xml:

<context-param>
<param-name>com.icesoft.faces.synchronousUpdate</param-name>
<param-value>false</param-value>
</context-param>


This allows asynchronous updates, server initiated renders to update the view.
[Email]
greg.dick

Joined: 26/Oct/2004 00:00:00
Messages: 85
Offline


You should be able to do it in the class that contains the action method. We have a Seam component showcase coming out soon that has a working example of the FileUploadServlet. It appears to be similar to what you're doing. In the progress method of the InputBean we can call the execute() and render() methods on the state object.
[Email]
tony.herstell

Joined: 01/Dec/2006 00:00:00
Messages: 206
Offline


so how do I tell this bit of the page to re-render?

<ice:graphicImage value="/content/images?id=#{pictureId}&thumbnail=false"/>

????

I can give it an id and somehow tell that id to re-render?

<ice:graphicImage id="====id=====" value="/content/images?id=#{pictureId}&thumbnail=false"/>


PFState state = PersistentFacesState.getInstance();

...

// Now get the image on the page to be re-fetched...
state.execute();
state.render("=== id ====");

or

I can tell the whole page to re-render itself? will that cause it to go off to the content servlet to get the image again?

PFState state = PersistentFacesState.getInstance();

...

// Now get the page to be re-fetched... which will force the image to be re-fetched
state.execute();
state.render();

defaults to page???


tony.herstell

Joined: 01/Dec/2006 00:00:00
Messages: 206
Offline


in my start upload (conversation) I took a cope of facesState .
Code:
 
 	@Begin
 	@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
 	public String startUpload(Object selectedObject) {
 		log.info("> startUpload");
 		
 		facesState = PersistentFacesState.getInstance();
 		
 		String theValueToBeReturned = null;
 		state = PersistentFacesState.getInstance();
 		if (selectedObject instanceof Organisation) {
 			parentObjectKind = ParentObjectKind.ORGANISATION;
 			Organisation organisation = (Organisation)selectedObject;
 			parentObjectPrimaryKey = organisation.getId();
 			log.info("Organisation Id was => " + parentObjectPrimaryKey);
 			if (organisation.getPicture() != null) {
 				picturePrimaryKey = organisation.getPicture().getId();
 			}
 			theValueToBeReturned = "upload";
 		} else if (selectedObject instanceof User) {
 			parentObjectKind = ParentObjectKind.USER;
 			User user = (User)selectedObject;
 			parentObjectPrimaryKey = user.getId();
 			log.info("User Id was => " + parentObjectPrimaryKey);
 			if (user.getPicture() != null) {
 				picturePrimaryKey = user.getPicture().getId();
 			}
 			theValueToBeReturned = "upload";
 		} else {
 			log.error("upload called with object type not supported.");
 		}
 		logConversation("Upload");
 		log.info("< startUpload");
 		return theValueToBeReturned;
 	}
 
 
 


In my action I did as you suggested.
Code:
 
             // The image needs to be in the database to be picked up by the Content servlet.
 			em.persist(image);
 			
 			// Re Read the image back (gets the primary key too)
 			try {
 				Object resultOfQuery = em.createQuery("from Image i where i.name = :name")
 					.setParameter("name", fileName)
 						.getSingleResult();
 				this.image = (Image)resultOfQuery;
 	            // Get the parentObjectPrimaryKey for the picture (so on page refresh will show THIS image)
 	            picturePrimaryKey = this.image.getId();
 
 	            try {
 	            	log.info("Doing a facesState.execute");
 					facesState.execute();
 				} catch (RenderingException e) {
 					e.printStackTrace();
 					log.error("RenderingException"+e);
 				}
 	            try {
 	            	log.info("Doing a facesState.render");
 					facesState.render();
 				} catch (RenderingException e) {
 					e.printStackTrace();
 					log.error("RenderingException"+e);
 				} 
 
 
 


result was no change, and worse the page hangs for ever if I tried to leave it.

I will wait for Dr #2 and see if I can work it out.

:(
tony.herstell

Joined: 01/Dec/2006 00:00:00
Messages: 206
Offline


Taking all the code out but leaving synch=false and it just started working (once only mind)... but thats enough for now.

:)
tony.herstell

Joined: 01/Dec/2006 00:00:00
Messages: 206
Offline


Now seems to work ok.
:)
greg.dick

Joined: 26/Oct/2004 00:00:00
Messages: 85
Offline


A couple of things to be clear on.

I suggested putting the execute() and render() within the action(ActionEvent) method. This would be unnecessary, as the action method will only generally be called from within the invoke_application phase, already within a JSF lifecycle.

So what constitutes a server initiated render, where you might want to update some of the page? In an application with a single user focus, it would only likely be needed for timed rendering, (such as an IntervalRenderer obtained from the RenderManager) in the case of a stock ticker application, for example.

In a multi-user focus application, such as the auction monitor, users join a render group when they start viewing the page, and when someone submits a bit, it's a server initiated render that updates all the users in the group, so all the auction watchers receive the updates.

Or, in the case of our FileUpload component, the FileUpload Servlet didn't initiate a JSF lifecycle, it's just out there as a servlet handling requests. When this servlet updates the bean acting as the backing bean for the FileUpload component, then it was necessary to initiate a render pass to update the page.

Also, you shouldn't need to worry at all about the 'bit' of the page that you want to update. The rendered output is 'diffed' against the current rendered result, and only the DOM changes are sent back to the browser.
[Email]
tony.herstell

Joined: 01/Dec/2006 00:00:00
Messages: 206
Offline


My image is being sucked from a servlet.

How doe the "page" know the image on it has changed?

If it does this by seeing that the image id has changed then when a new image overwrites the old image it seems the id does not change (took me by supprise!)

I persist the image each time:

em.persist(image);
 


The first time it gets set to say: #3

If the user uploads another image in the same conversation; then it stays on #3 !!!

The renderer would not notice a change.



Perhapos thats why I get the problem in the other thread:
Having to upload twice....


I think you have been on to see the effect... but there are no new images so perhaps not.
:(
Farlo

Joined: 10/Jan/2007 00:00:00
Messages: 23
Offline


Bindings can be used with SEAM but you need to create an event scoped bean , make the bidnings to that and inject it into your conversation scoped bean. This is a known SEAM issue independent of Icefaces.

http://docs.jboss.com/seam/1.1.7.RC1/reference/en/html/conversations.html#d0e4606

For example on your conversation scoped be have a bindings bean injected:

Code:
 	@In(create=true)
 	private MyBeanBindings myBeanBindings;
 


The bindings bean looks like this:

Code:
 @Name( "myBeanBindings" ) 
 @Scope( ScopeType.EVENT ) 
 public class MyBeanBindings {
 
 	private DataPaginator dp = new DataPaginator();
 
 	public DataPaginator getDp() {
 		return dp;
 	}
 
 	public void setDp(DataPaginator dp) {
 		this.dp = dp;
 	}
 }
 


Then on your page you would use something like this:

Code:
 <ice:dataPaginator        for="myTable"
                                    paginator="true"
                                    fastStep="3"
                                    paginatorMaxPages="20"
                                    rendered="#{myMainBean.renderPaginator}"
                                    binding="#{myBeanBindings.dp}">
 
tony.herstell

Joined: 01/Dec/2006 00:00:00
Messages: 206
Offline


Not having much luck...

Given this:


Code:
 
 <ice:dataTable id="usersTableComponent" value="#{users}" var="the_user"
                 sortColumn="#{findUserController.sortColumn}"
                 sortAscending="#{findUserController.ascending}"
                 rows="10">
                 <!-- binding="#{findUserController.usersTable}"> Can't get to work -->
 
 ...
             <ice:dataPaginator id="usersTablePaginatorComponentText"
                                 for="usersTableComponent"
                                 rowsCountVar="rowsCount"
                                 displayedRowsCountVar="displayedRowsCountVar"
                                 firstRowIndexVar="firstRowIndex"
                                 lastRowIndexVar="lastRowIndex"
                                 pageCountVar="pageCount"
                                 pageIndexVar="pageIndex"
                                 binding="#{dataPaginatorEventForBinding.dp}">
 


it gives:

Caused by: java.lang.IllegalArgumentException: Can not set nz.co.risingstars.actions.user.DataPaginatorEventForBinding field

as you can see below....

Code:
 3:18:05  debug 	[window.async-connection] : send > 
 | partial=false |
 | ice.event.target=_id52:_id53:usersMenuSection:usersFindMenuOption:_id102 |
 | ice.event.captured=_id52:_id53:usersMenuSection:usersFindMenuOption:link |
 | ice.event.type=onclick |
 | ice.event.alt=false |
 | ice.event.ctrl=false |
 | ice.event.shift=false |
 | ice.event.meta=undefined |
 | ice.event.x=202 |
 | ice.event.y=119 |
 | ice.event.left=false |
 | ice.event.right=false |
 | _id52=_id52 |
 | icefacesCssUpdates= |
 | viewNumber=1 |
 | _id52:_idcl=_id52:_id53:usersMenuSection:usersFindMenuOption:link |
 | focus_hidden_field= |
 | conversationPropagation=none |
 | focus=_id52:_id53:usersMenuSection:usersFindMenuOption:link |
 | window=3519 |
 | icefacesID=Ca7SbHxyx7FQnyC_DDngrA |
 | viewNumber=1 |
 3:18:05  debug 	[window.async-connection.ui] : [5051709] : send asynchronous POST
 3:18:05  warn 	[window.async-connection] : failed to listen for updates
 [object Error]
 3:18:06  debug 	[window.async-connection.ui] : [5051709] : receive [200] OK
 3:18:06  error 	[window] : Server side error
 3:18:06  error 	[window] : javax.faces.FacesException: Error calling action method of component with id _id52:_id53:usersMenuSection:usersFindMenuOption
 	at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
 	at javax.faces.component.UICommand.broadcast(UICommand.java:106)
 	at com.icesoft.faces.component.menubar.MenuItemBase.broadcast(MenuItemBase.java:129)
 	at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
 	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
 	at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
 	at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
 	at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCycle(ReceiveSendUpdates.java:66)
 	at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:46)
 	at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
 	at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
 	at com.icesoft.faces.webapp.http.core.PushServer.service(PushServer.java:35)
 	at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
 	at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:29)
 	at com.icesoft.faces.webapp.http.servlet.PushServlet.service(PushServlet.java:27)
 	at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:41)
 	at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:18)
 	at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:32)
 	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:31)
 	at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:41)
 	at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:18)
 	at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:48)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
 	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
 	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:359)
 	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
 	at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:54)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
 	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
 	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
 	at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
 	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
 	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
 	at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
 	at java.lang.Thread.run(Thread.java:619)
 Caused by: javax.faces.el.EvaluationException: /WEB-INF/pages/template.xhtml @109,180 action="#{findUserController.startFind}": javax.ejb.EJBException: java.lang.IllegalArgumentException: could not set field value: findUserController.dataPaginatorEventForBinding
 	at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
 	at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
 	... 48 more
 Caused by: javax.ejb.EJBException: java.lang.IllegalArgumentException: could not set field value: findUserController.dataPaginatorEventForBinding
 	at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
 	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
 	at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
 	at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
 	at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
 	at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
 	at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
 	at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
 	at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
 	at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:203)
 	at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
 	at $Proxy131.startFind(Unknown Source)
 	at nz.co.risingstars.actions.user.FindUserController$$FastClassByCGLIB$$d7deafdf.invoke(<generated>)
 	at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
 	at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
 	at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:74)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
 	at org.jboss.seam.interceptors.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:40)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
 	at org.jboss.seam.interceptors.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:31)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
 	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
 	at org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:52)
 	at org.jboss.seam.intercept.Proxy$$EnhancerByCGLIB$$a2aea3b4.startFind(<generated>)
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 	at java.lang.reflect.Method.invoke(Method.java:597)
 	at com.sun.el.parser.AstValue.invoke(AstValue.java:130)
 	at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
 	at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
 	at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
 	... 49 more
 Caused by: java.lang.IllegalArgumentException: could not set field value: findUserController.dataPaginatorEventForBinding
 	at org.jboss.seam.Component.setFieldValue(Component.java:1527)
 	at org.jboss.seam.Component.access$500(Component.java:132)
 	at org.jboss.seam.Component$BijectedField.set(Component.java:2251)
 	at org.jboss.seam.Component.injectAttributes(Component.java:1336)
 	at org.jboss.seam.Component.inject(Component.java:1163)
 	at org.jboss.seam.interceptors.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
 	at org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
 	at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:69)
 	at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:103)
 	at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
 	at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 	at java.lang.reflect.Method.invoke(Method.java:597)
 	at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
 	at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
 	at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:71)
 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
 	at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
 	at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:46)
 	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
 	at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
 	... 85 more
 Caused by: java.lang.IllegalArgumentException: Could not set field value by reflection: FindUserControllerImpl.dataPaginatorEventForBinding on: nz.co.risingstars.actions.user.FindUserControllerImpl with value: class nz.co.risingstars.actions.user.DataPaginatorEventForBindingImpl$$EnhancerByCGLIB$$c03bfe3a
 	at org.jboss.seam.util.Reflections.set(Reflections.java:75)
 	at org.jboss.seam.Component.setFieldValue(Component.java:1523)
 	... 108 more
 Caused by: java.lang.IllegalArgumentException: Can not set nz.co.risingstars.actions.user.DataPaginatorEventForBinding field nz.co.risingstars.actions.user.FindUserControllerImpl.dataPaginatorEventForBinding to nz.co.risingstars.actions.user.DataPaginatorEventForBindingImpl$$EnhancerByCGLIB$$c03bfe3a
 	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
 	at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
 	at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
 	at java.lang.reflect.Field.set(Field.java:657)
 	at org.jboss.seam.util.Reflections.set(Reflections.java:61)
 	... 109 more
 3:18:09  debug 	[window.async-connection.blocking] : [4926386] : connection closed
 3:18:09  info 	[window] : page unloaded!
 
 




Code:
 package nz.co.risingstars.actions.user;
 
 import com.icesoft.faces.component.datapaginator.DataPaginator;
 
 public interface DataPaginatorEventForBinding {
 
     public DataPaginator getDp();
     
     public void setDp(DataPaginator dp);
     
 }
 





Code:
 package nz.co.risingstars.actions.user;
 
 import org.jboss.seam.annotations.Name;
 import org.jboss.seam.annotations.Scope;
 import org.jboss.seam.ScopeType;
 
 import com.icesoft.faces.component.datapaginator.DataPaginator;
 
 @Name("dataPaginatorEventForBinding")
 @Scope(ScopeType.EVENT)
 public class DataPaginatorEventForBindingImpl {
 
     private DataPaginator dp = new DataPaginator();
 
     public DataPaginator getDp() {
         return dp;
     }
 
     public void setDp(DataPaginator dp) {
         this.dp = dp;
     }
 }
 



and in FindUserControllerImpl...

Code:
     @In(create = true)
     private DataPaginatorEventForBinding dataPaginatorEventForBinding;
 


 
Forum Index -> JBoss Seam Integration Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team