Solved

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

Posted on 2006-11-27
2
286 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] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

The ability to edit PDF documents can be useful, however it may not be a straight forward process. Many non-technical people don't realise that a PDF document is basically an image rather than a text file, even if it contains nothing but text. If…
This article focuses on how to remove password security from multiple PDF files by Adobe Acrobat program. Sometimes it is essential to access the stored data items and to print, edit as well as copy content from Portable Document Format files in abs…
In this first video of the three-part Xpdf series, we introduce and describe Xpdf, a library containing nine command line utilities that perform various functions on PDF files. We show where the library is located and how to download it, discuss its…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

752 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