on 06-10-2008 7:17 AM
hi,
ihave atable with some rows and i have two buttons ADD and DELETE when ever i click on add iam abe to add new row to the table and when ever i click on delete iam able to delete the row of the table,but my problem is when i click on delete i am able to delete only the UI elements in that row, but structure of the table is remaining as it is, can u please tell me the code to delete structure of the table also
thanks
kishore
Hi,
Set Visible Row Count property of the table to -1.
Regards,
Apurva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
_ you can take help from following code _
here in this case i have added one check bos in table , for
each row , those rows whos check box is selected will be deleted .
or you can use leadselection instead of check box.
Code Details
nodeTravel is bind with table ui.
wdContext.currentContextElement().setTravelDestinationRowCount(wdContext.nodeTravel().size());
in this line
TravelDestinationRowCount is a value attribute of type integer .
you set VisibleRowCount properties of table ui to travelDestinationRowCount
boolean flag=true;
if(wdContext.nodeTravel().size()>0)
{
IPrivateV_TravelRequestView.ITravelNode travelNode=wdContext.nodeTravel();
IPrivateV_TravelRequestView.ITravelElement travelElement;
wdContext.nodeTravel().setLeadSelection(0);
for(int i=0;i<wdContext.nodeTravel().size();i++)
{
travelElement=travelNode.getTravelElementAt(i);
boolean val=wdContext.nodeTravel().getTravelElementAt(i).getCheckBoxValue();
if(val)
{
i--;
travelNode.removeElement(travelElement);
wdContext.currentContextElement().setTravelDestinationRowCount(wdContext.nodeTravel().size());
flag=false;
wdContext.currentContextElement().setTravelMsg("");
}
}
if(flag)
{
wdContext.currentContextElement().setTravelMsg("No row is selected");//msg if deleting the row without selecting the checkbox...
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
i was used below code in one of my application, in my application i was called delete bapi inorder to delete particular employee details, in this case first i deleted the particular row using "removeElement()" and then i called Delete BAPI
please find out the below code.
int n = wdContext.nodeCatsrecordsGETLIST_Out().size();
int leadSelected = wdContext.nodeCatsrecordsGETLIST_Out().getLeadSelection();
IWDMessageManager messageMgr = wdThis.wdGetAPI().getComponent().getMessageManager();
for (int i = n - 1; i >= 0; --i)
{
if (wdContext.nodeCatsrecordsGETLIST_Out().isMultiSelected(i) || leadSelected == i)
{
wdContext.nodeCatsrecordsGETLIST_Out().removeElement(wdContext.nodeCatsrecordsGETLIST_Out().getElementAt(i));
ICatsrecordsGETLIST_OutElement out = (ICatsrecordsGETLIST_OutElement)wdContext.nodeCatsrecordsGETLIST_Out().getElementAt(i);
String s1 = out.getCounter();
wdContext.nodeBapi_Catimesheetmgr_Delete_Input().nodeCatsrecords().currentCatsrecordsElement().setCounter(s1); wdThis.wdGetCats_Time_Travel_CustController().executeBapi_Catimesheetmgr_Delete_Input();
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Kishore,
What is your exact requirment? Deleting a table structure means?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
That means you have 4 record shown in 4 rows of table...
but when you delete a record->its contents are deleted but -> table still shows 4 rows...
and you wan to show 3 rows only...
if this is the case then adjust the table size.....i.e. VisibleRowCount property of table
Edited by: snehal kendre on Jun 10, 2008 11:02 AM
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.