Monthly Archives: May 2011

blogging 4m my blackberry

First blog of mine 4m my blackberry curve

get handle to the next and previous view of the train model

Add the following jstl function library to the jsp:root tag


and proceed with

text="goto page# #{fn:substringAfter( ,'@')}"
text="goto page# #{fn:substringAfter(controllerContext.currentViewPort.taskFlowContext.trainModel.previous ,'@')}"

some of the values that you can get related to trainModel previous and next actions are


Note: to get the display name from the trainstop you have to manually have the binding for next and previous strings added to the bean and evaluate the text manually like

public class Bean {
    TrainModel train;
    TrainStopModel trainStopModel;
String next;
  String previous;
    public Bean() {
      PageFlowStack stack = StateUtils.getCurrentViewPort().getPageFlowStack();
          if (stack.size() > 0)
            train = stack.peek().getTrainModel();
  public static Object evaluateEL(String el) {
      FacesContext facesContext = FacesContext.getCurrentInstance();
      ELContext elContext = facesContext.getELContext();
      ExpressionFactory expressionFactory =
      ValueExpression exp =
          expressionFactory.createValueExpression(elContext, el,

      return exp.getValue(elContext);
    public void setNext(String next) { = next;

    public String getNext() {

      trainStopModel = train.getNextTrainStop(train.getCurrentTrainStop());  = trainStopModel.getTextAndAccessKey();
        return next;

    public void setPrevious(String previous) {
      this.previous = previous;

    public String getPrevious() {
        if(train != null){
      trainStopModel = train.getPreviousTrainStop(train.getCurrentTrainStop());
          this.previous  = trainStopModel.getActivityId().getLocalActivityId();
        return previous;