以下是XPage的beforePageLoad事件中的两个代码块。假设变量是先前声明的。这就是问题的本质。我已经标记了块1和2.块1执行得很好但块2没有。如果我颠倒了订单,则块2执行但块1不执行。单个块似乎没有任何问题,但是一个接一个地运行它们似乎是一个问题。我的完整代码被try catch块包围 - 没有收到任何错误。
我很想知道我做错了什么。
谢谢,
丹
// BLOCK 1 - Get total no of guests on the voyage
var dbTraveler:NotesDatabase = session.getDatabase(null,
viewScope.pathDbGuests, false );
var viewTraveler:NotesView = dbTraveler.getView( "(vwGuestInfoByVoyage)" );
if (viewTraveler != null){
var nav:NotesViewNavigator = viewTraveler.createViewNav();
var entry:NotesViewEntry = nav.getFirst();
while (entry != null && !entry.isTotal()) {
if (entry.getColumnValues().firstElement().toString() == viewScope.voyage){
viewScope.cat = entry.getColumnValues().firstElement().toString();
viewScope.voyageGuestCount = entry.getChildCount().toFixed() ;
sessionScope.voyageGuestCount = viewScope.voyageGuestCount;
}else{
var tmpentry:NotesViewEntry = nav.getNextSibling(entry);
}
entry.recycle();
entry = tmpentry;
}
}
viewTraveler.recycle();
viewTraveler = null;
// Block 2 - Load pre-post travel details into an array
if(@Trim(@Left(sessionScope.DebarkEmbark,"@")) == "Embark"){
var viewpreTravel:NotesView = dbTravel.getView("luPreCruiseFlight");
if (viewpreTravel == null){//do nothing
viewScope.preTravelView = "luPreCruiseFlight View not found"
}else{
viewScope.preTravelView = "luPreCruiseFlight View found"
}
}else{
var viewpostTravel:NotesView = dbTravel.getView( "luPostCruiseFlight" );
if (viewpostTravel == null){//do nothing
viewScope.postTravelView = "luPostCruiseFlight View not found"
}else{
viewScope.postTravelView = "luPostCruiseFlight View found"
}
}
viewpreTravel.recycle();
viewpreTravel = null;
viewpostTravel.recycle();
viewpostTravel = null;
答案 0 :(得分:1)
您只能转到代码块1中else块中的下一个视图条目。