on 09-11-2008 5:05 AM
hi,
i want to create a table. the data i am getting from several inputfields n i want it to get populated in the table after pressing a button. i have set its cardinality to 1..n. so how to create a table n set its property to get it done.
thanx
Hi,
Product(value node)
|___Article(value attribute)
colour(value attribute)
cardinality 0..n
write following code on action of button.
public void onActionAddProduct(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionAddProduct(ServerEvent)
IProductsElement product = wdContext.createProductsElement();
product.setARTICLE(wdContext.currentContextElement().getARTICLE());
product.setCOLOR(wdContext.currentContextElement().getCOLOR());
product.setCURRENCY("EUR");
product.setSIZE(wdContext.currentContextElement().getSIZE());
product.setORDER_NUMBER(wdContext.currentContextElement().getORDER_NUMBER());
product.setPRICE(wdContext.currentContextElement().getPRICE());
product.setSPECIAL_FEATURES(wdContext.currentContextElement().getSPECIAL_FEATURES());
product.setTEXTILE_CATEGORY(wdContext.currentContextElement().getTEXTILE_CATEGORY());
wdContext.nodeProducts().addElement(product);
//@@end
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i want to create a table. the data i am getting from several inputfields n i want it to get populated in the table after pressing a button.
create on enode for the Table and as many attribute which you want to display in the table. i.e:-
<TableNode>
<attributeName>
<attributeAge>............like that.
Now on the action of the button try to create element for the table context node, here is the sample code:-
IPrivate<viewName>.I<node>Element ele1;
ele1 = wdContext.<nodename>().create<node>Element();
ele1.set<attributeName>(inputfields value);
ele1.set<attributeName>(inputfields value);
......
and so on
wdContext.<node>().addElement(ele1);
This will create element for the Table context. And bind the Table with this context at the design time.
Hope this may help you.
Deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Viral,
Check The Following
1.) First of all Confirm that that are you getting Data from several inputfields.
2.) Check whether you have binded the datasource Property of the Table to the Context Node.
3.) Check whether all the TableCellEditor's Text Property is binded to the Context Attributes.
4.) Check Whether the Singleton Property of the Value Node in the Context Tab Should be Set to " True " .
With Regards,
RooP KumaR.
IPrivateTableDemoCompView.IDetailsElement element=wdContext.nodeDetails().createDetailsElement();
element.setName(wdContext.currentDetailsElement().getName());
element.setAddress(wdContext.currentDetailsElement().getAddress());
element.setCity(wdContext.currentDetailsElement().getCity());
element.setPhone(wdContext.currentDetailsElement().getPhone());
wdContext.nodeDetails().addElement(element);
hi,
with ur code i think ur using the same node for form as well as for table.
make one more node with cardinality 0...n
and assign this node to table and proceed,
IPrivateTableDemoCompView.IDetailsTableElement element=wdContext.nodeDetailsTable().createDetailsElement();
element.setName(wdContext.currentDetailsElement().getName());
element.setAddress(wdContext.currentDetailsElement().getAddress());
element.setCity(wdContext.currentDetailsElement().getCity());
element.setPhone(wdContext.currentDetailsElement().getPhone());
wdContext.nodeDetailsTable().addElement(element);
Hi Viral,
You are using the same node for Binding Data to the Table & Capturing Data from Multiple Input Fields.
Take 2 Value Nodes in the Context. One for Binding Data to the Table & another One for Capturing Data.
With Regards,
RooP KumaR.
Edited by: Roop kumar Annavarapu on Sep 11, 2008 11:10 AM
i have created another node named DetailsTable with cardinality 0..n n proceed,
IPrivateTableDemoCompView.IDetailsTableElement element=wdContext.nodeDetailsTable().createDetailsTableElement();
element.setName(wdContext.currentDetailsElement().getName());
element.setAddress(wdContext.currentDetailsElement().getAddress());
element.setCity(wdContext.currentDetailsElement().getCity());
element.setPhone(wdContext.currentDetailsElement().getPhone());
wdContext.nodeDetailsTable().addElement(element);
but it still doesnot work.
thanx..
Hi,
take another value node with cardinality 0...n and define all attributes u like to add to table.
take table ui and go to properties u see the dataSource assign this node.
write this code on the button event,
IPrivate<ur view name>View.I<Node Name>Node i<Node Name>Node = wdContext.node<Node Name>();
IPrivate<ur view name>View.I<Node Name>Element i<Node Name>Element = i<Node Name>Node.create<Node Name>Element();
i<Node Name>Element .set<Your Attribute>(wdContext.current<Your form name>.get<Your attribute>());
i<Node Name>Node.addElement(i<Node Name>Element );
i<Node Name>Node.moveNext();
Regards,
ramesh
Edited by: Ramesh Babu V on Sep 11, 2008 9:52 AM
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.