RequestContext and Seam

UI Components for JSF
Post Reply
morrigan
Posts: 1
Joined: 04 May 2010, 10:39
Location: Italy

04 May 2010, 11:29

Hi,

I've some problems with request context. I'm using jsf 1.2 + seam + primefaces 1.0.1.
I have this command button and javascript on my page

Code: Select all

		<p:commandButton id="searchAccident" value="Search"
			actionListener="#{mainAction.searchAccident}" 
			oncomplete="openAccidentIfFound(xhr, status, args)">
		</p:commandButton>
  ...
	<script type="text/javascript">
		//<![CDATA[
		        function openAccidentIfFound(xhr, status, args) {
		        	alert(status); // <-- this returns a parsererror
		        	alert(args); // <-- null!!!
			        alert("found:" + args.found);  
		        }
		    //]]>
	</script>


and my seam bean

Code: Select all

@Name(value="mainAction")
public class MainAction implements Serializable {
   ....
   Accident accident;

   public void searchAccident(ActionEvent event) {
      ...
      RequestContext ctx = RequestContext.getCurrentInstance();
      ...
      ctx.addCallbackParam("found", true);
      cxt.addCallbackParam("accidentNumber", accident.getNumber()); // is a String
   }
   ... setters/getters
}
My method on the bean is executed correctly, but it doesn't return any json on the response but the entire html, so in the javascript I get a parsererror in the status.
Any thoughts? What am I missing?

Thanks in advance

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

05 May 2010, 00:34

Hi,

Can you see the ajax response with firebug and post here?

It looks like there is a problem with ajax response.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: KeithJeomE and 39 guests