on 2005 Aug 04 4:29 PM
Hi All.
I wanna know if there exists an api that allows me to change the title of the browser dinamically. I mean that the title of the browser will change depending of some actions and events, and i want to do this change programatically.
I hope somebody can helps me.
Thx
Best Rgds.
Gregory.
Gregory,
TaskBinder.getCurrentTask().getApplicationWindow().setTitle("Hi, Greg!")
Note the following:
1. Non-documented methods were used.
2. It is tested to work in stand-alone WD application, I have no clue what happens in portal.
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is being set by the title property of your window.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gregory,
hope you want to change the default window title i.e. the browser title on some event. You can try the following solution
<b>create two static variables for the view controller class:</b>//@@begin others
private static IWDWindow window;
private static boolean changeWindowTitle = false; //for checking whether to change the title or not
//@@end
<b>In the event handler method create the window object for the default window of your application:</b>
public void onActionChangeWindowTitle(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent)
{
//@@begin onActionselectedMyStep(ServerEvent)
IWDWindowInfo winInfo = wdComponentAPI.getComponentInfo().findInWindows("DefaultWindow");
window = wdComponentAPI.getWindowManager().createModalWindow(winInfo);
changeWindowTitle = true;
//@@end
}
<b>Now in wdDoModifyView check the condition and set the new title:</b>
public static void wdDoModifyView(IPrivateTestCompView wdThis, IPrivateTestCompView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if(changeWindowTitle){
((Window)window).setTitle("My New Window Title");
}
//@@end
}
Let me know whether it works or not...
regards,
Shubhadip
Shubhadip,
1. Component (and therefore all of its controllers) is created per session (also there are could be several instances of the same component even per session) so using static variables is a "no-no"
2. As I understand the question it is necessary to change title of current main application window (not a pop-up)
VS
User | Count |
---|---|
69 | |
10 | |
10 | |
10 | |
10 | |
8 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.