Solved

create subform using addInstance(), rename the subform, delete it later

Posted on 2006-11-27
2
281 Views
Last Modified: 2012-08-13
Hi,

I have a form where users can enter a case number and click a button.  The button then creates 3 subforms throughout the main form using addInstance().  In the first subform there is a button that says "Delete Section".  Once that is clicked I want all 3 subforms to be deleted.  The user may have created a number of sections so I need to identify the correlating two sections.

I thought I could just rename each subform based on the case number that the user entered and then reference each subform to be removed that way, but it doesn't work.

I can 'apparently' rename the subform, but when using the new name when using removeInstance() it doesn't work.

Test rename of subform:
// this is in the initialization parameter of the field containing the policy number

this.rawValue = "123"
app.alert(this.parent.name);  // provides the current subform name correctly.  
this.parent.name = this.rawValue; // should change the subform name to "123"
app.alert(this.parent.name); // shows the value "123" which is what I would expect and want

BUT

if I now click a button saying: ._123.removeInstance(0);
it doesn't work.
If I now click a button saying: .OriginalFormName.removeInstance(0);
it works.

So it doesn't appear that the subform name is really being changed at all.  It's a ruse  :-(

Any help would be great.
0
Comment
Question by:srsyddev
2 Comments
 
LVL 44

Accepted Solution

by:
Karl Heinz Kremer earned 500 total points
ID: 18028668
I don't have an answer to your question (I don't use Designer).

One of the Adobe Blogs has been dealing with the Instance manager quite a bit. You might be able to get an answer to your question when you either contact the blogger directly, or by posting a comment in the blog: http://blogs.adobe.com/formbuilder/scripting/instance_manager/
0
 

Author Comment

by:srsyddev
ID: 18065992
I cound another solution.  Code included just in cae it helps someone else.

{
var indexno = this.parent.index;
form1.Page3.Subform11.Subform13._Option7.removeInstance(indexno);
this.parent.parent._Subform10.removeInstance(0);
}
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Can Be Caused By Disabled Services I have encountered a problem viewing PDF files using Adobe Acrobat Reader.  For the longest time, PDFs might launch or might not.  Sometimes they took about 15 minutes to appear after launching them. After som…
PDF files have been in the limelight due to its unmatched features.  Personal documents, emails, business reports and eBooks are all converted into PDF files owing to peerless features provided by it. Adding watermark to a PDF file is a method to se…
In this video, we show how to perform Bates Numbering/Stamping of PDF documents using Power PDF Advanced, the newest product from the Document Imaging division of Nuance Communications. There are two editions of Power PDF — Standard and Advanced. Th…
We often encounter PDF files that are pure images, that is, they do not have text characters, but instead contain only raster graphics. The most common causes of this are document scanning software and faxing software/services that create image-only…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now