on 04-07-2009 4:35 PM
Hi Experts,
Please tell me how to read data from each and every row in the table.
I have two views . The table control is in the second view. I am entering data manually into each row of a
table . Then i need to pass data from each row into the back end using a search button which is in the
first view. The search button is in the first view.
Please tell me how to read data from each and every row in the table.
I have mapped the table value node with the controller.
Thanks a lot.
Hi srini,
if you passing data from front end to back end.
suppose Value node for table is table. cardinality should be1:1
value attribute --Name,city.
Model VAlue node--Z_ModelTable_input.
Model Attribute --ModelName,ModeCity
model output table--Output.
Z_ModelTable_input. input=new Z_ModelTable_input.();
wdcontext.nodeZ_ModelTable_input.().bind(input);
then
for(int=0;i<wdcontext.nodeTable().size();i++)
{
input.ModelName(wdContext.nodeTable().getTableElementAt(i).getName());
input.ModelCity(wdContext.nodeTable().getTableElementAt(i).getCity());
}
wdContext.CurrentZ_ModelTable_inputElement().modelobject().excute();
wdContext.nodeOutput.invalidate();
Hope this way you can try
thanks
jati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
Got hrough all these coding its clear and good to copy all tecord to a model node from a value node,
tr this, and let me know if u face any problem
// check if data exists for Agency Allocation Data node
int nodeSizeAllocation = wdContext.nodeAgencyAllocationData().size();
IAgencyAllocationDataElement objAgencyDataElem = null;
Zsh_Charinfo objCharInfo = null;
if (nodeSizeAllocation > 0) {
Zh_Charity_Input CharityInput = modelCharity.createModelObject(Zh_Charity_Input.class);
wdContext.nodeCharityInput().bind(CharityInput);
// set CHARINFO input table with data from Agency Allocation Data node
AbstractList ablObj = new Zsh_Charinfo.Zsh_Charinfo_List();
for (int i = 0; i < nodeSizeAllocation; i++) {
objAgencyDataElem = wdContext.nodeAgencyAllocationData().getAgencyAllocationDataElementAt(i);
objCharInfo = new Zsh_Charinfo();
objCharInfo.setCharcode(objAgencyDataElem.getCharityCode());
if (objAgencyDataElem.getCharityType() != null && objAgencyDataElem.getCharityType().equals("")) {
objCharInfo.setChartyp(objAgencyDataElem.getCharityType());
} else {
objCharInfo.setChartyp("");
}
if (objAgencyDataElem.getDescription() != null && !objAgencyDataElem.getDescription().equals("")) {
objCharInfo.setDesclong(objAgencyDataElem.getDescription());
} else {
objCharInfo.setDesclong("");
}
if (objAgencyDataElem.getRegistrationNumber() != null && !objAgencyDataElem.getRegistrationNumber().equals("")) {
objCharInfo.setReg_No(objAgencyDataElem.getRegistrationNumber());
} else {
objCharInfo.setReg_No("");
}
ablObj.add(objCharInfo);
}
// set input parameters for the FM
wdContext.currentCharityInputElement().setPi_Pernr(strPernr);
CharityInput.setPt_Charinfo(ablObj);
// Execute the FM
wdContext.currentCharityInputElement().modelObject().execute();
Dont't confuse your self please look into the coding veryclearly that will make some sence
Cheers,
Apparao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Data is saved into a Context Node. You can find it in the property dataSource of Table.
Next just read it,
wdContext.nodeXXXXX() // for all rows or
wdContext.currentXXXXElement() // for one row (selected row)
for example,
for( int=0; i > wdContext.nodeXXXX().size(); i++) {
wdContext.nodeXXXX().getElementAt(i).getAtributeA()
wdContext.nodeXXXX().getElementAt(i).getAtributeB()
wdContext.nodeXXXX().getElementAt(i).getAtributeC()....
}
If you nedd fill that table just use bind
wdContext.nodeXXXXX().bind(List with all information)
Edited by: Sebastian Celestino on Apr 7, 2009 7:22 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
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.