- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Hello,
I am having some problems in using InstanceManager (dynamic tables). I try to add and delete new rows by using checkboxes. If a checkbox gets clicked a new row, with a value given from the checkbox, appears. If a checkbox gets deactivated, then the row, it has created, is going to be removed.
I use addInstance to add new lines into the table. In this case new line apperas always at the end of the table, which is just perfect! It is exactly the way I need it. But I have no idea how to pass over the value of my checkboxes right to the last line of my table.
I have tried to use moveInstance an it just messed up my form. (uploaded here: www.hs-augsburg.de/~nikg-fh/mypdf.pdf )
My Form:
My Code:
MyForm.page1.checkbox1::change - (JavaScript, client)
if (this.rawValue == "1")
{
var myInstance = xfa.form.MyForm.page1.MyTable._MyRow.addInstance(1);
var fromIndex = xfa.form.MyForm.page1.MyTable._MyRow.index;
var toIndex = myInstance.index;
// Value of col. "CheckBox-Value"
xfa.form.MyForm.page1.MyTable.MyRow.checkboxValue.rawValue = "CheckBox 1"; // <<<<<HERE IS THE PROBLEM!!!!!
// Value of col "fromIndex"
xfa.form.MyForm.page1.MyTable.MyRow.fromIndex.rawValue = fromIndex;
// Value of col "toIndex"
xfa.form.MyForm.page1.MyTable.MyRow.toIndex.rawValue = toIndex;
// Move Row
xfa.form.MyForm.page1.MyTable._MyRow.moveInstance(fromIndex, toIndex); // <<<< Don't need to use this Method?!
}
else
{
var rowToDelete = xfa.form.MyForm.page1.MyTable._MyRow.index;
xfa.form.MyForm.page1.MyTable._MyRow.removeInstance(rowToDelete);
xfa.form.MyForm.page1.deletedRow.rawValue = rowToDelete + 1;
}
it just gets messed up with this code, because of moveInstance (all checkboxes have similar coding):
any checkbox clicked:
checkbox1 klicked
checkbox 2 klicked:
checkbox 3 klicked:
Views
Replies
Total Likes