on 11-24-2009 11:24 AM
Dear All,
As my screen is long hence if an error comes we will require to scroll down so I have added a message area UI element and in do modify method of the view i have request focus to my message area but it is not working. Below is the code which I have written:
try{
IWDMessageArea msgarea=(MessageArea)view.getElement("MessageArea");
msgarea.requestFocus();
}
catch(Exception e)
{
}
Is there any other property or changes need to be made.
Thankyou.
Regards,
Santosh
Hi All,
I found this thread looking for the solution to the same topic and it helped a lot so I like to share an alternative solution:
public void wdDoModifyView(com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if(!wdComponentAPI.getMessageManager().isEmpty()){
view.getElement("MainMessageArea").requestFocus();
}
//@@end
}
Regards,
Andrés Acero
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In would say, create an input field at the top left corner of the screen. Set its width to zero and bind it to a context attribute say Va_ShowMesg of type string. Now insert a MessageArea UI element just below the inputfield to display all the erro message at the top left.
Now if you request focus for the input field using the following code, the focus will automatically come to the Message Area as well.
wdThis.wdGetAPI().requestFocus(wdContext.currentContextElement(),wdContext.getNodeInfo().getAttribute(
wdContext.currentContextElement().VA__SHOW_MESG));
You can call this code whenever you need to display message to user in the message area and shift focus of the screen to the message displayed.
Regards,
Tushar Sinha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Friend,
The Very First thing is that you should not use the modify view hook method without condition according to the best practices. you can shift this code to the on change of the UI element from which you are getting that Exception.
2nd you can put the message area on the top of the view.
Regards
Jeetendra.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.