on 02-04-2008 11:41 AM
Hi,
i m having a table and displaying data by fetching from backend.
i added a toolbar item called button and named it as "Insert".
when i click on thins button the first row of the table should be empty with input fields. i want to insert data and when i click on save button it should update at backend.
kindly let me know how to insert empty row at starting of table.
thanks in advance.
Hi Venkat,
In order to edit a column in the table, the table cell editor of that column should be an input field. When you bind a table to a node, by default the table cell editor will be TextView. If you have already bound the table to node, first right click the desired column of the table and remove Table Cell Editor and then again right click and select 'Insert Table Cell Editor'. In the next screen select 'InputFiled'.
Thanks and Regards,
Shabeer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create an attribute of type boolean under the node bound to the table, and bind this to the readOnly property of the inputbox.
create an action for onLeadSelect, based on the selected element (Will be available as part of the parameter to this action) change the values of the attribute bind to the readonly property from true to false.
Regards
Ayyapparaj
[IWDNode.addElement()|https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/progmodel/api/IWDNode.html#addElement(int,%20com.sap.tc.webdynpro.progmodel.api.IWDNodeElement)]
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai venkat,
To add an empty row when addrow button is clicked here is the coding,
public void onActionaddrow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionaddrow(ServerEvent)
try
{
IPrivateSalesdet.ITablepartnersNode noder=wdContext.nodeTablepartners();
IPrivateSalesdet.ITablepartnersElement elem;
for(int i=0;i<1;i++)
{
elem= noder.createTablepartnersElement();
noder.addElement(elem);
IPrivateSalesdet.ITablepartnerssubnodeNode nodeEd=wdContext.nodeTablepartnerssubnode();
IPrivateSalesdet.ITablepartnerssubnodeElement EdEle;
for(int i=0;i<1;i++)
{
EdEle = nodeEd.createTablepartnerssubnodeElement();
nodeEd.addElement(EdEle);
}
}
catch(Exception e)
{
}
Regards
Sharanya.R
Edited by: Sharanya R on Feb 4, 2008 12:54 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sharanya...
Thanks for ur inputs.
i can able to insert an empty row. but its inserting at last row of the table. i want to insert at BEGINING.
here the inserted row should be editeable. i mean it hav to insert some values and press save button. it shoud update in databasse table.
first inserted row should be editable and all others should b non-editable.
how can i achieve this.
thanks in advance...
venkat
Hi Sharanya,
here is my code....
where i need to insert ur statement?
plz guide me... and this inserted row should be editable....
how could i do this?
public void onActionNew_Employee(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionNew_Employee(ServerEvent)
try
{
IPrivateDisplayView.IItabNode node = wdContext.nodeItab();
IPrivateDisplayView.IItabElement elem;
for(int i =0;i<1;i++)
{
elem = node.createItabElement(new Zemp_Master());
node.addElement(elem);
IPrivateDisplayView.IInsertNode node1 = wdContext.nodeInsert();
IPrivateDisplayView.IInsertElement elem1;
for( i=0;i<1;i++)
{
elem1 = node1.createInsertElement();
node1.addElement(elem1);
}
}
}
catch(Exception ex)
{
}
Thanks in advance
Hi,
You can use:
for(int i =0;i<1;i++)
{
elem = node.createItabElement(new Zemp_Master());
node.addElement(0,elem); // specify index
IPrivateDisplayView.IInsertNode node1 = wdContext.nodeInsert();
IPrivateDisplayView.IInsertElement elem1;
for( i=0;i<1;i++)
{
elem1 = node1.createInsertElement();
node1.addElement(0,elem1);
}
}
hope this will solve your problem.
thanks & regards,
Manoj
Edited by: Manoj Kumar on Feb 5, 2008 9:53 AM
hai venkat,
try to use manoj,s coding.hope that ll work for your case.If not add wdContext.nodetable().movefirst(); in the first line of the for loop you are using to create elements(row).
for( i=0;i<1;i++)
{
wdContext.nodetable().movefirst();
elem1 = node1.createInsertElement();
node1.addElement(elem1);
}
regards
Sharanya.R
Edited by: Sharanya R on Feb 5, 2008 5:46 AM
Hi,
Their are two ways to make an empty row
One is set the cardinaliity of the node bound to the table as 1..n
or else create an element in the init as
wdContext.node<YOURNODE>().createAndAddElement();
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
26 | |
10 | |
9 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.