Solved

Webflow Partial Rendering - Transition Evaluate not completed before rendering happens

Posted on 2008-10-07
2
1,794 Views
Last Modified: 2008-10-07
Hi,

I am having an issue with Spring Webflow.

I have a view that contains a standard h:datatable component. In the webflow xml, I define a transition that runs a method to refresh the list dependant on some filter values. The result is assigned to the viewScoped property in the original view. There is then a <render> tag with a fragment of the datatable.

The issue arises in when i hit the transition, i can see the method specified in the evaluate tag being called, and i can see it call the webservice that populates the list given to the datatable. However, the function is still mid way through its call (i halted it on the server hosting the service) - but the page still renders even though the function is still running to re-populate the list.

This gives the impression that the page filter and refresh is always once request cycle behind.

Code Snippets included. Any help is most appreciated.
From the flow.xml :
<view-state id="cashBatchListView" view="cashBatchList.xhtml" model="webapp">
	
<on-entry>
<evaluate expression="inwardCashService.retrieveBatchesForFilter(webapp, messageContext)" result="viewScope.batchHeaders" result-type="dataModel" />
</on-entry>
		
<transition on="applyFilter">			
<evaluate expression="inwardCashService.retrieveBatchesForFilter(webapp, messageContext)" result="viewScope.batchHeaders" result-type="dataModel" />	
<render fragments="cashBatchDataTableForm:batchListTable"/>
</transition>
</view-state>
 
From the facelet....
<h:dataTable id="batchListTable" styleClass="summary" 
value="#{batchHeaders}" var="bh" 
rendered="#{batchHeaders.rowCount > 0}">
 
From the backing bean ...
public List<BatchHeader> retrieveBatchesForFilter(InwardCashWebParamService webParam, MessageContext messageContext) {
						
ArrayList<BatchHeader> bhArray = new ArrayList<BatchHeader>();
		
try {
Getrecordstodisplayintype input2 = new Getrecordstodisplayintype();
 
// Set params omitted from snippet
			
System.out.println("Doing WebService ... ");
Record[] bhs = icp.getrecordstodisplay(input2);
System.out.println("returned from WebService ... ");
			
for (int x=0;x<bhs.length;x++)
{
BatchHeader bh = new BatchHeader();
// set up a item for list omitted from Snippet
 bhArray.add(bh);
 }				
} catch (Throwable error) {
System.out.println("Throwing Error:" + error.getMessage());	
throw new RuntimeException(error);
}
		
List<BatchHeader> bhList = bhArray;
return bhList;
}

Open in new window

0
Comment
Question by:ProgrammingSmurf
  • 2
2 Comments
 
LVL 1

Author Comment

by:ProgrammingSmurf
ID: 22659242
Additional:

I do not hit a throwable error, i can see the service complete normally ... but by this time, the web page is already rendered.
0
 
LVL 1

Accepted Solution

by:
ProgrammingSmurf earned 0 total points
ID: 22659941
Solved:

I had a link to apply the filter:
<sf:commandLink id="applySubset" value="Apply Subset" action="applyFilter" processIds="*" onchange="submit()"/>

I dont know why exactly it is firing, but the on change was submitting the form, and at the same time, the back end was calling the web service - i removed the onchange=-"submit()" and everything works fine.

Sorry for wasting your time.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Android studio getdrawable(int) is deprecated 4 85
Java Loop 6 61
session migration servlets 2 36
Running JavaFX on JDeveloper 12C 1 32
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question