Dynamic Repeating Tables

D

dino07

Hi All,

I am currently trying to do the following:
1. insert a value into a repeating table from a drop-down list( secondary
storage) when the user click the "Add" button positioned next to the drop
down list

<snip>
IXMLDOMNamedNodeMap nnm, dataAttrs;
string sCode;
string sDesc;


sCode =
thisXDocument.DOM.selectSingleNode("/TEST_FORM/Test_Information/Individual_Test/Test_Code").text ;
sDesc =
thisXDocument.DOM.selectSingleNode("/TEST_FORM/Test_Information/Individual_Test/Test_Description").text ;
DOMNodeList rowList = thisXDocument.DOM.selectNodes("//Test_Requests");


thisXDocument.View.ExecuteAction("xCollection::insert", "Test_Requests_2");

// Refresh rowList due to new rows
rowList = thisXDocument.DOM.selectNodes("//Test_Requests");
// Fill the main table
nnm = rowList.nextNode().attributes;
nnm.nextNode().nodeValue = "";
nnm.nextNode().nodeValue = sCode;
nnm.nextNode().nodeValue = sDesc;


2. insert a x number of rows into a repeating tables from another repeating
table.
<snip>

IXMLDOMNamedNodeMap nnm, dataAttrs;
// Set namespace so that xpath will work - xpathNsStr lists all relevant
namespaces

DOMNodeList dataList = thisXDocument.DOM.selectNodes("//Group_Tests");
DOMNodeList rowList = thisXDocument.DOM.selectNodes("//Test_Requests");

//Add new rows to your table to adapt to datarows from the web service
for (int i = 0; i < (dataList.length - rowList.length); i++)
{
thisXDocument.View.ExecuteAction("xCollection::insert", "Test_Requests_2");
}

// Refresh rowList due to new rows
rowList = thisXDocument.DOM.selectNodes("//Test_Requests_2");

for (int i = 0; i < dataList.length; i++)
{
IXMLDOMNode dataNode = dataList.nextNode();
dataAttrs = dataNode.attributes;
string sGrpCode = dataAttrs.getNamedItem("Group_Test_Code").text;
string sCode = dataAttrs.getNamedItem("Test_Code").text;
string sDesc = dataAttrs.getNamedItem("Test_Description").text;

// Fill the main table
nnm = rowList.nextNode().attributes;
nnm.nextNode().nodeValue = sGrpCode;
nnm.nextNode().nodeValue = sCode;
nnm.nextNode().nodeValue = sDesc;
}

However, I cant seem to get sCode and sDesc in part(1) and if i subsituted
the values with hard-coded one, the system only populate one row and did not
work when i tried to add more by clicking the button "Add".

Do anyone know why? Any help is greatly appreciated!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top