cancel
Showing results for 
Search instead for 
Did you mean: 

Roadmap using HTMLB?

Former Member
0 Kudos

Hi

When developing in HTMLB/JSP, is is possible to make a roadmap(or something similar), like you can do in WebdynPro?

thanks

Peter

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Dmitry

Thanks for your answer, but the problem is, that the text beside the "buttons" should be localizisable, and the roadmap resizable

I was hoping for a standardcomponent

Best regards

Peter

dmitryjirov
Explorer
0 Kudos

Hi Peter,

With HTMLB you will need to implement a state machine which will look something like this

public class Controller extends PageProcessorComponent{

   public DynPage getPage() {

	return new MyDynPage();
    }
	
    public class MyDynPage extends JSPDynPage{
                private int state = 0;

        public void doProcessBeforeOutput() throws PageException {
                   switch(state){
                   case 0:
                      setJspName("page0.jsp");
                   break;
                   //...
                   case N:
                      setJspName("pageN.jsp");
                   break;
  

                   }
        }

        public void onStep0(Event event) {
                state=0;
        }

        public void onStepN(Event event) {
                state=N;
        }


	public void onBack(Event event) {
			
		state--;
	}			
		
	public void onNext(Event event) {
			
		state++;
	}        
   }
}

In the JSPs you will need to surface buttons/images with onClick referring to on...(Event event) methods listed above. Also you will need to save the state, I'd propose to put it on servlet request in

doProcessBeforeOutput()
componentRequest.getServletRequest().setAttribute("state", new Integer(state));

surface as

<input type="hidden" id="state" name="state" value="<%=state.toString()%>">

get back and analyze in

doProcessBeforeOutput()
String state = componentRequest.getParameter("state");

Best regards,

Dmitry