how to use navigateTo in java

Hi All,
I have 2 screens ScreenA, ScreenB.I am in ScreenA. To move on SceenB I wrote following stuff inside a method f()(getting called from JSP onserverclick=‘f’) of ScreenA.java file.

//===========================================
public void f() throws GXGeneralException{
GXNavigateRequest obj = new GXNavigateRequest();
obj.setDestinationScreenName(“ScreenB”);
getGXSession().navigateTo(obj);
}
//===========================================

But it is not working.

Please help me out :frowning: .
Thanks in advance

Arijit

have you set up a navigation Map in the ApplinX repository?

You either need to use the constructor to set the map name to use or call setMapName before doing a navigateTo

Hi Arijit,

The solution Douglas provided is OK if you are working with ApplinX 5.2.
However, if you are working with version 8, ApplinX automatically records the Application Map as you navigate through the host application in the session view.
To enable and use the application map you need to do the following:

  • - Enable Map steps recording in the ApplinX application properties (Navigation node)
    - Approve the desired steps in the map view
    - The only thing your code sample is missing is a gx_handleHostResponse() call after the navigateTo command. it should look like this:

public void f() throws GXGeneralException{ 
	GXNavigateRequest obj = new GXNavigateRequest(); 
	obj.setDestinationScreenName("ScreenB"); 
	getGXSession().navigateTo(obj);
	gx_handleHostResponse();
}