Solved

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

Posted on 2006-11-27
2
287 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This article is in response to a question here (http://www.experts-exchange.com/Other/URLs/Q_28283850.html) at Experts Exchange. The Original Poster has a scanned signature and wants to make the background transparent so that the signature may be pl…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…

630 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