In the form linked below, is there a way to have only one table header instead of a header above every single row dynamically generated? I set the binding of the header row to a mamimum of one (1) but it did not seem to have any effect. I want the header to dissappear if the user deletes all of the rows (deletes with the last visible row).
https://acrobat.com/#d=Mmpq-vPoGUdJumXEcaG6Sg
Thanks for any help you can provide with this.
-Don
Solved! Go to Solution.
Views
Replies
Total Likes
Place the following code in the click event of the "DeleteActionRow" button.
var nResponse = xfa.host.messageBox("You are about to delete this Action Item row. \n\nDo you want to continue?", "Deleting a row", 1, 2);
if (nResponse == 4) {
var oActionSubform = MeetingMinutes.LogoControls.resolveNode("ActionSubform[" + this.parent.parent.parent.index + "]");
var intCount = oActionSubform.Table1.Row2.instanceManager.count;
oActionSubform.Table1.Row2.instanceManager.removeInstance(this.parent.index);
if(intCount==1){
oActionSubform.Table1.HeaderA.presence = "hidden";
}
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
}
Place the following code in the Initialize event of the "DeleteActionRow" button".
var oActionSubform = MeetingMinutes.LogoControls.resolveNode("ActionSubform[" + this.parent.parent.parent.index + "]");
if(this.parent.instanceManager.count>0){
oActionSubform.TopicGroupA.Table1.HeaderA.presence = "visible";
}
Thanks
Srini
Views
Replies
Total Likes
Few things to do to achieve what you wanted to do.
1) For "ActionSubform", in the binding tab, uncheck the "Repeating subform for each data item"
2) For "Table1", in the binding tab, uncheck the "Repeating subform for each data item"
3) For "Row2", in the binding tab, check the "Repeating subform for each data item"
Do not check the min count.
4) In the click event of "AddActionRowButton1" button write the following code.
this.resolveNode('ActionSubform.Table1._Row2').addInstance(1);
MeetingMinutes.LogoControls.TopicGroupA.ActionSubform.Table1.HeaderA.presence = "visible";
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
5) For "HeaderA" object propeties, change the Row type to Body Row instead of Header Row.
In the Object properties, set the Presence to Hidden.
6) In the click event of "DeleteActionItem" button write the following code.
var intIndex = this.parent.index;
this.resolveNode('ActionSubform.Table1._Row2').removeInstance(intIndex);
if(intIndex == 0){
MeetingMinutes.LogoControls.TopicGroupA.ActionSubform.Table1.HeaderA.presence = "hidden";
}
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
7) In the initialize event of "DeleteActionItem" button write the following code.
if(this.parent.instanceManager.count>0){
MeetingMinutes.LogoControls.TopicGroupA.ActionSubform.Table1.HeaderA.presence = "visible";
}
Hope this helps..
Let me know if you still have issues..
Thanks
Srini
Views
Replies
Total Likes
Srini,
I appreciate your help with this.
The problems currently are:
Here's the revised form if you would please take a look:
https://acrobat.com/#d=QkwyNjDIFBB0LSgZkEMEJQ
Thank you,
~Don
Views
Replies
Total Likes
Here are the answers for your issues..
1) in the click event of the DeleteActionItem button place the following code.
var nResponse = xfa.host.messageBox("You are about to delete this Action Item row. \n\nDo you want to continue?", "Deleting a row", 1, 2);
if (nResponse == 4) {
var oActionSubform = MeetingMinutes.LogoControls.resolveNode("ActionSubform[" + this.parent.parent.index + "]");
var intIndex = this.parent.index;
oActionSubform.Table1.Row2.instanceManager.removeInstance(intIndex);
if(intIndex == 0){
xfa.host.messageBox("1");
oActionSubform.Table1.HeaderA.presence = "invisible";
xfa.host.messageBox("1");
}
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
}
2) In the Click event of the AddActionRowButton1 button, place the following code.
var oActionSubform = MeetingMinutes.LogoControls.resolveNode("ActionSubform[" + this.parent.parent.index + "]");
this.resolveNode('ActionSubform.Table1._Row2').addInstance(1);
oActionSubform.Table1.HeaderA.presence = "visible";
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
3) In the DeleteTopic button, place the following code.
var nResponse = xfa.host.messageBox("You are about to delete this Action Item row. \n\nDo you want to continue?", "Deleting a row", 1, 2);
if (nResponse == 4)
this.resolveNode('LogoControls._ActionSubform').removeInstance(this.parent.parent.index);
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
Thanks
Srini
Views
Replies
Total Likes
Sirini,
I'm sorry - I don't know what i have wrong.
I have uplaoded the revised form.
https://acrobat.com/#d=tVb*Kh2yJ89PMB32gjlCHQ
Thank you,
~Don
Views
Replies
Total Likes
Place the following code in the click event of the "DeleteActionRow" button.
var nResponse = xfa.host.messageBox("You are about to delete this Action Item row. \n\nDo you want to continue?", "Deleting a row", 1, 2);
if (nResponse == 4) {
var oActionSubform = MeetingMinutes.LogoControls.resolveNode("ActionSubform[" + this.parent.parent.parent.index + "]");
var intCount = oActionSubform.Table1.Row2.instanceManager.count;
oActionSubform.Table1.Row2.instanceManager.removeInstance(this.parent.index);
if(intCount==1){
oActionSubform.Table1.HeaderA.presence = "hidden";
}
if (xfa.host.version < 8) {
xfa.form.recalculate(1);
}
}
Place the following code in the Initialize event of the "DeleteActionRow" button".
var oActionSubform = MeetingMinutes.LogoControls.resolveNode("ActionSubform[" + this.parent.parent.parent.index + "]");
if(this.parent.instanceManager.count>0){
oActionSubform.TopicGroupA.Table1.HeaderA.presence = "visible";
}
Thanks
Srini
Views
Replies
Total Likes
Srini,
Thank you so much for taking the time to disgnose what I scripted wrong. I am very grateful to you for all your help and sharing your expertise. You are extremely talented and I hope to one day learn all this code you have so willingly shared.
Thanks so very much!
~Don
Views
Replies
Total Likes
Views
Likes
Replies