The following sample is an illustration:
define page viewOrderHistory(){

var ord: Order
var submittedOrders : List<Order>
var user: User 

main
define body(){
init{
	user := securityContext.principal;
 	submittedOrders := from Order as o where o.customer = ~user;
	
//	submittedOrders :=[o | o : Order in submittedOrders where o.status == statusSubmitted ];
}

}

The problem is that when I move init out of body(), when accessing submittedOrders in body(), changes made to that in init block are not applied.

Submitted on 31 March 2010 at 12:57

Log in to post comments