on 09-21-2007 9:58 AM
Hi, i have in a View a table that it´s refill with a table of sap when i press search... Now i want that if i press search and there aren´t rows... appear an popup: "There aren´t element" and... when i press other button (clean) the table clean it...
In short i want know count the rows in the table and clean the table...
Anybody can help me?
Thanks,
1. appear an popup: Use IWDWindow object
2. press other button (clean) the table clean it... : Call invalidate method of the node which is bound with the table,
3. want know count the rows in the table and clean the table: Use size function of the node element bound to the table.
Ashu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Sorry I missed the function
private IWDWindow createModelWindow(String windowName, String title, int width, int height)
{
IWDWindowManager windowManager = wdThis.wdGetAPI().getComponent().getWindowManager();
IWDWindowInfo modelWindowInfo = wdThis.wdGetAPI().getComponent().getComponentInfo().findInWindows(windowName);
IWDWindow modelWindow = windowManager.createModalWindow(modelWindowInfo);
if(modelWindow != null)
{
modelWindow.setTitle(title);
modelWindow.setWindowSize(width, height);
modelWindow.setWindowPosition(WDWindowPos.CENTER);
}
return modelWindow;
}
Regards
Ayyapparaj
Hi Ayyapparaj KV, i write this:
IWDWindow window = createModelWindow("aviso", "title" ,400, 200);
if(window != null)
{
window.show();
}
private IWDWindow createModelWindow(String windowName, String title, int width, int height)
{
IWDWindowManager windowManager = wdThis.wdGetAPI().getComponent().getWindowManager();
IWDWindowInfo modelWindowInfo = wdThis.wdGetAPI().getComponent().getComponentInfo().findInWindows(windowName);
IWDWindow modelWindow = windowManager.createModalWindow(modelWindowInfo);
if(modelWindow != null)
{
modelWindow.setTitle(title);
modelWindow.setWindowSize(width, height);
modelWindow.setWindowPosition(WDWindowPos.CENTER);
}
return modelWindow;
}
but when i execute, appear this error:
com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Parameter windowInfo must not be null.
Thanks,
Hi Victor,
Try this.
int noOfRows = wdContext.node<put the node name here> ().size ();
if (noOfRows == 0)
{
String dialog = "No of Rows in Table:" + noOfRows ;
IWDConfirmationDialog confDialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialog,wdThis.wdGetAPI().getViewInfo().getViewController().findInEventHandlers("OK"),"OK");
confDialog.setTitle("RollUp Window");
confDialog.setWindowPosition(200,100);
confDialog.setWindowPosition(WDWindowPos.LEFT);
confDialog.show();
}
Regards,
Mithu
Hi Victor,
if(wdContext.nodeOutput().size() ==0)
After weContext give a dot(. ) .Then type node and give control space from keyboard. It will give you the option to choose the node name. Select the output node name whose rows you want to count.
Make sure you are writing the code inside the method that is in view .
If your output node is not in the view.
Then use
int noOfRows =
wdThis.wdGet<put your component name here>Controller ().wdGetContext().nodeOutput().size();
if (noOfRows == 0)
{
..
}
Or In Diagram view you can do the mapping between the component controller and View also.
Regards,
Mithu
I find the solution... I have to map the node...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Victor,
1. For popup when there are no rows in a table:
In NWDS>View>Methods(tab)>ADD>eventHandler-->name it as OK
Write in the action of the search button
IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow("There are no rows in the table.",wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("OK"),"OK");
dialog.show();
2. For clearing the content of the table write in the action of the Clear button
wdContext.nodeCol1().invalidate();
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, i don´t understand you before...
I explain me... I have a button that have this code:
public void onActionBuscar(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionBuscar(ServerEvent)
wdThis.wdGetJCOCustController().ejecutar_Bapi();
//@@end
}
Refill the table with the data...
I wil want that, when execute wdThis.wdGetJCOCustController().ejecutar_Bapi(); count the number of rows, and if it´s zero, appear the popup...
If i create a new eventhandler, i can´t do this... no?
Thanks,
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.