Solved

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

Posted on 2006-11-27
2
285 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to export html file format from OneNote 4 780
Convert SVG to PDF 5 111
Office 2010 Pro Programs & Acrobat Reader Won't Open 7 98
download Adobe Reader 6 47
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…
PaperPort is a popular document imaging/management product from Nuance Communications (http://www.nuance.com/). It is in widespread use by both individuals (http://www.nuance.com/for-individuals/by-product/paperport/index.htm) and businesses (http:/…
In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …

740 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