on 11-14-2007 8:15 PM
I have a component. When first displayed it shows data from the current week. There is a button that is for the prior week information. When the user clicks this button the appropriate onAction fires. I then run the necessary methods in the component controller. How do I get the new data to show on the page? The current "wdDoModifyView" has logic used in order to do some special table processing so I need to call it.
Any suggestions?
Diane
If i understood your requirement correctly, you want to display some data on click of the button.
wdModfiyView will be called for each request. So if you want to show special table just activate that piece of code using some boolean operation. Declare one boolean static variable in the global scope (bottom of your view), make this boolean variable true in your button selection method. In wdModfiyView use boolean variable to show special table.
Regards,
Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You know I thought it would call the modify view everytime - but I wasn't seeing that. I put messages in and saw the following based on my code ---
Modify view called Build View
I clicked the button Prior week
Message stating the button was click happened - No Modify view
public static void wdDoModifyView(IPrivateDetailView wdThis, IPrivateDetailView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
BuildView(WeekToProcess.CURRENT_WEEK, wdThis, wdContext, view);
IWDMessageManager msgMgr = wdThis.wdGetAPI().getComponent().getMessageManager();
java.util.Date mDate = new java.util.Date();
msgMgr.reportWarning("Do Modify View " + mDate);
//@@end
}
public void onActionPriorWeek(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionPriorWeek(ServerEvent)
IWDMessageManager msgMgr = wdThis.wdGetAPI().getComponent().getMessageManager();
msgMgr.reportWarning("Prior Week");
GregorianCalendar priorWeekDate = new GregorianCalendar();
priorWeekDate.setTime(new java.util.Date());
priorWeekDate.add(GregorianCalendar.DATE,-7);
wdThis.wdGetEmployeeTimeVerificatioinCustController().getEmployeeTimeData(priorWeekDate.getTime());
//@@end
}
private static void BuildView(short weekToProcess,IPrivateDetailView wdThis, IPrivateDetailView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view)
{
IWDMessageManager msgMgr = wdThis.wdGetAPI().getComponent().getMessageManager();
msgMgr.reportWarning("BuildView");
....does more logic....
}
What did I do wrong? Why after the button click action does my modify view not execute?
Regards,
Diane
Diane,
This is working for me. For Each request i could see calling wdModfiyView - data.
It is in the specification.
public static void wdDoModifyView(.....){
IWDMessageManager msgMgr = wdThis.wdGetAPI().getComponent().getMessageManager();
msgMgr.reportWarning("Do Modify View " + TestView.sayHello("Sridhar"));
java.util.Date mDate = new java.util.Date();
msgMgr.reportWarning("Do Modify View " + mDate);
}
private static IWDMessageManager msgMgr = null;
in the global scope i created message manger and instantiate in the init method
like, msgMgr = wdComponentAPI.getMessageManager();
// calling this static method in wdModify method.
private static String sayHello(String name){
msgMgr.reportSuccess("Name "+name);
return "Hey "+name;
}
// I can see all 3 statements every time on my screen.
Regards,
Sridhar
Do you really need to change the view after the action? If yes, the standard technique is to set a flag (boolean context attribute) in the action handler and check/reset it inside wdDoModifyView().
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.