on 06-16-2008 7:36 AM
hi
i have atable with no records and visible row count is 5 and i have two buttons ADD and Delete.when ever i click on ADD button a new row should be appened to the existing rows in atble and when i click on DELETE button selected row should be deleted (UI elements)along structure can u please tell me the required code for the above scenario
thanks
kishore
closed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
to insert a new record
IPrivate<viewname>.I<node_name>Element element = wdContext.create<node_name>Element();
wdContext.node<node_name>.addElement( element );
to delete a record
wdContext.node<node_name>().removeElement(wdContext.node<node_name>().getElementAt(wdContext.node<node_name>().getLeadSelection()));
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi kishore ,
After deleting the node , get the current size of node in one value attribute of
type integer and at design time you
set visibleRowCount properties of table to this value attribute .
like
if(wdContext.nodeTravel().size()>0)
{
IPrivateV_TravelRequestView.ITravelNode travelNode=wdContext.nodeTravel();
IPrivateV_TravelRequestView.ITravelElement travelElement;
for(int i=0;i<wdContext.nodeTravel().size();i++)
{
if(your condition on which node/row will be deleted)
{
i--;
travelNode.removeElement(travelElement);
wdContext.currentContextElement().setTravelDestinationRowCount(wdContext.nodeTravel().size())
// visibleRowCount propertyof table is set to TravelDestinationRowCount attribute
}
}
Edited by: piyush kumar on Jun 16, 2008 9:49 AM
Edited by: piyush kumar on Jun 16, 2008 9:51 AM
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.