on 07-10-2007 4:26 AM
Hello Friends
I am having table having one column as InputField and rest are the textview fields
I input the data and click the button that will add them to a node.
But what is happening is it is adding the current value to all the fields replacing other filelds.
Like suppose I am having 3 rows
In column I input 10
In column 2 input 20
In column 3 input 30
Now it is setting the value 30 to all the 3 fields.
Can any one tell me the code to set 10, 20 and 30 as different value in a node as entered by me.
Thanks
Hi,
Hope the cardinality of your node is ..n
TestNode
Element1
Element2
Element3
If the node structure is as above
on click of the add button
call the method wdContext.nodeTestNode().createandaddelements
then start entering values to all the input fields
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
i am your scernario as follows
Context
TN_node (value node of cardinality 0:N)
val1 (value attribute under value node)
val2 (value attribute under value node)
i have binded Tn_node to table and val1 is textview and val2 is inputfield
public void wdDoInit()
{
//@@begin wdDoInit()
for(int i=0;i<5;i++)
{
IPrivateTestView.ITN_nodeElement ele=wdContext.nodeTN_node().createTN_nodeElement();
wdContext.nodeTN_node().addElement(ele);
ele.setVa1("val"+i);
}
//@@end
}
i have a button go in which printing all the values
public void onActionGo(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionGo(ServerEvent)
for(int j=0;j<wdContext.nodeTN_node().size();j++)
{
//IPrivateTestView.ITN_nodeElement
IPrivateTestView.ITN_nodeElement ele=wdContext.nodeTN_node().getTN_nodeElementAt(j);
wdComponentAPI.getMessageManager().reportSuccess("-----"+ele.getVa1());
wdComponentAPI.getMessageManager().reportSuccess("-----"+ele.getVa2());
}
Hope this helps,
If your problem is not solved please post your code like this
Thanks and Regards,
Arun
Hello Friends
I am having table having one column as InputField and rest are the textview fields
I input the data and click the button that will add them to a node.
But what is happening is it is adding the current value to all the fields replacing other filelds.
Like suppose I am having 3 rows
In column I input 10
In column 2 input 20
In column 3 input 30
Now it is setting the value 30 to all the 3 fields.
Can any one tell me the code to set 10, 20 and 30 as different value in a node as entered by me.
hai vivek ,
will u plz send the code that is adding all 3 fields as same i need that plz help me out
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vivek,
Just create and add an element at the time of clicking the add button
ie. Inside the button action, paste the following code
IPrivet<view>.I<Table>Node tNode=wdContext.node<Table>();
IPrivet<view>.I<Table>Element tEl=tNode.create<Table>Element();
tNode.addElement(tEl);
Regards
Fahad Hamsa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check the cardinality of the node which has the attribute, for which the input field has been bound to.It must be o..n.
Regards,
Prabhakar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
What is the context structure of your table node ?
Also specify the mapping of inputfield to the context attribute ?
I have created the context attribute for the InputField under the table node (cardinality 0..n, selection 0..n,singleton true) and it is working fine.
Could you explain us what you are doing in your action of the button ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Change the property of value node <b>Singleton to false</b> initially it is true
Thanks and Regards,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.