Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Repitive calls to the Backing Beans on Submit

 
Marius Snyman
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have faces page called myworklist.xhtml.

On this page I use a richfaces datatable to display available work objects.

When a user clicks on a hyperlink the specific work item is retrieved from the database.

I notice the following:
During the initial load the backing bean reads the database 3 times before the pages is rendered. The same data is therefore retrieved 3 times from the database.

When the user selects an item the database is again read 3 times before the work item is displayed.

On the workpage, a button allows the user to take ownership of the workitem. At this time a jbpm process is updated with the task being assigned to the user.

Because 3 trips are made during each call, the jbpm process is asked to assign the task to the user thrice. On call 2 the jbpm process will throw an error.

I have been unable to determine why my backing bean methods are called multiple times and wondered if any hand on the ranch can maybe shed some light on this.
 
Marius Snyman
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved my triplicate request by setting ajaxSingle=true on the a4j:commandLink and on the rich:panelMenuItem
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic