Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-11-27
2
Medium Priority
?
288 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 1500 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

One of the questions I get asked again and again is how to validate a field value in an AcroForm with a custom validation script. Adobe provided a lot of infrastructure to do that with just a simple script. Let’s take a look at how to do that wit…
Have you ever come up with a need of emailing only few pages of PDF file to one of yourfriend or colleague, instead of whole Adobe file? If yes, then surely you have face problems in doing that! Read this section as I have suggested multiple solutio…
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…
Suggested Courses

721 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