Add using the instance

I am trying to create a document that has 4 separate tables in that the user will enter data for different materials.  I created a button to add another line in each of the 4 tables using the following JavaScript code:

frmCredit4._Item.addInstance (1);
frmCredit5._Item.addInstance (1);
frmCredit6._Item.addInstance (1);
frmCredit7._Item.addInstance (1);
XFA. Form.Recalculate (true);

All works great so far, but I need to have the first column to repeat in each 4 tables, which is where I'm stuck.  I tried setting the binding at the global level, but makes everything that has been entered in the first line of the first rehearsal of table in all other lines of all tables, which of course do not work because I need different data in each of the lines in the first column.  Any suggestions?

Thank you

Michael

Your requirement is delicate and very difficult (I love the stuff). See the attachment here, that's what I did...

1 set the binding to normal

2. added FormCalc code to the "output" of the Table1:Column1:txtMaterialComp event

Here is the script

var partLeft
var partRight

partLeft = Substr ($.somExpression, 1, 69) //69 is the length of the characters before the "5" in the SOMexpression of the field
partRight = Substr ($.somExpression, 71, 200) //71 is the position of starting for the right part and 200 is to get the characters up to the end... or you can have 500
xfa.host.messageBox (Concat(partLeft,5,partRight))

var transferTo5
transferTo5 = Concat (partLeft, 5, partRight, "is", "" ", $.rawValue," "")
xfa.host.messageBox (transferTo5)
eval (transferTo5)

This script will dynamically access the number of the instance, and then sets the value of the specified field.

Hope you can consider here and add additional script to fill the rest of the tables you need.

Good luck

Tags: Adobe LiveCycle

Similar Questions

  • Adding subform by using the Instance Manager

    Good day;

    I develop a form and one of the things that I'm trying to do is to get a full subform to repeat if the user needs to add more items.

    The subform has 1 table and 1 row. If the user selects from a drop down list of all except 'green' status, a text box becomes visible, and the user needs to add details.

    I placed a button on a subform separated if the user wants (needs) add 2 or more projects.

    I tried to use the following and I get the standard error "general".

    psl_list_subform.instanceManager.addInstance (1);

    I go to this topic properly or I am average in left field.

    Thank you all

    Chomp

    What is the line Reapeat set for Psl_list_subform? You have a maximum value defined for this subform? If you have still questions can send you the form at [email protected] and I'll take a look.

    Paul

  • List implied when you use the instance of an object TABLE.

    I've been looking for a solution to this problem, but nothing helped.
    I have an XML schema that specifies in the root element:
    < xsd: element name = "onestring" type = "xs: String" minOccurs = "1" maxOccurs = "1" / >
    < xsd: element name = "manystrings" type = "xs: String" minOccurs = "1" maxOccurs = "unbounded" / >

    So I created a few types in my database:
    CREATE OR REPLACE TYPE VARCHAR_TABLE AS VARCHAR TABLE (5);
    /

    CREATE or REPLACE TYPE rootelement AS OBJECT)
    onestring varchar (5),
    manystrings VARCHAR_TABLE
    )
    /

    Now, I do the following:
    DECLARE
    XML XMLTYPE.
    obj rootelement;
    BEGIN
    obj: = rootelement ("valA", VARCHAR_TABLE ('val1', 'val2', 'val3'));
    XML: = XMLTYPE (obj);
    print_out (xml.getstringval);
    END;
    /

    And on this basis, the result I get is:
    < ROOTELEMENT >
    valA < ONESTRING > < / ONESTRING >
    < MANYSTRINGS >
    val1 < VARCHAR2 > < / VARCHAR2 >
    val2 < VARCHAR2 > < / VARCHAR2 >
    val3 < VARCHAR2 > < / VARCHAR2 >
    < / MANYSTRINGS >
    < / ROOTELEMENT >

    When I want to see is:
    < ROOTELEMENT >
    valA < ONESTRING > < / ONESTRING >
    val1 < MANYSTRINGS > < / MANYSTRINGS >
    val2 < MANYSTRINGS > < / MANYSTRINGS >
    val3 < MANYSTRINGS > < / MANYSTRINGS >
    < / ROOTELEMENT >

    This can be accomplished? I also need the output XML to be read back in. (currently I call XMLTYPE (xml) .toObject (obj);).

    Thanks in advance.

    Dave

    Well, since the XSL Transformations worked at 10.1 too, what follows will do what you want

    SELECT XMLTYPE(ROOTELEMENT('valA', VARCHAR_TABLE('val1', 'val2', 'val3'))).TRANSFORM(XMLTYPE('
    
        
    
        
            
                
                    
                
                
                    
                
            
        
    
        
            
                
           
            
        
    
        
            
                
            
        
    
    
    ')) AS TRANSFORMED
      FROM DUAL
    

    Sorry for a previous solution that would not apply to your version, but I struggle to remember the characteristics of each of them separate. I remembered vaguely (I work with 11g for a bit now) that APPENDCHILDXML was the 10g feature, but does not remember that it was in fact 10.2.

    Concerning

    Philippe

  • Fields of text, of the instances or variables

    Hello
    I received conflicting information about how the text fields must be directed to and I would like to clarify. One place, I read that you should always use the var scope in the field of text properties panel to give your text field a variable name, and you should not use the instance name field. Someone told me exactly the opposite, saying that the var on the text field properties panel has been left more of Flash 5 and it should not be used.

    I built a GUI with type of Calculator buttons which filled a text entry field. I gave the text field a name var and not an instance name. They worked very well. I have now found something to incorporate in the GUI, but it was built with text fields with no variable names instance names. When I try to adapt my gui or the new code does not have one or the other, they work fine separately.

    I'd appreciate really any clarification you could offer.
    Thank you
    Beatie

    Ah, well, I try to fill the text with a button input field. Code:

    var Name1 = "";
    times_btn.onRelease = function() {}
    "" Name1 = name1 + ' * ";
    }

    has worked with a var name, but not at all working with an instance name. Actually even try to target using this.display1 = this.display1 + "*"; " does not work with an instance name, so maybe that's the answer. The only thing is that I have other text fields, make what they need with only the name of the instances. It's confusing.

    Thank you
    Beatie

    P.S. Oh no it's just bad coding.

    times_btn.onRelease = function() {}
    display1. Text = display1.text + "*"; "
    }

    works very well. Thanks for your reply, it really helped.

  • Multiple instances of Application when you use the background thread

    Hi all

    I recently added a background thread in an application that is launched from an other point of entry. This background thread will constantly (every X seconds) carry out checks of RMS and compares the timestamps. When recalcitrant, he sends a notification to the user who launches the application when clicked. The problem is...

    When the user clicks on the notification, it will open the application normally (with the icon and everything), but it also opens a second instance that does not have an icon. I have concluded that the code that actually launches the request isn't the culprit (because if I take out, it nevertheless opens the second instance). This makes me think that it has something to do with the ApplicationDescriptor.

    My notification Manager has this line:

    ApplicationDescriptor appDescriptor = new ApplicationDescriptor (ApplicationDescriptor.currentApplicationDescriptor (), application name, new String [] {});

    If I change this to only return the currentApplicationDescriptor() or add the arguments in the array of strings, notifications do not work.

    Can anyone think of a reason why this is happening?

    I solved the problem I had.

    In the end, I ended up changing this code:

    final ApplicationDescriptor mainDescription = ApplicationDescriptor.currentApplicationDescriptor ();
    final ApplicationDescriptor appDescriptor = new ApplicationDescriptor (mainDescription, application_name, new String [] {});

    TO:

    moduleHandle int = CodeModuleManager.getModuleHandle (APPLICATION_NAME);
    ApplicationDescriptor mainDescriptor;

    If (moduleHandle! = 0)
    {
    ApplicationDescriptor apDes [] = CodeModuleManager.getApplicationDescriptors (moduleHandle);
    apDes = mainDescriptor [0];

    ApplicationMessageFolderRegistry folderReg = ApplicationMessageFolderRegistry.getInstance ();

    If (folderReg.getApplicationFolder (NotificationManager.INBOX_FOLDER_ID) == null) {}
    notificationManager.init (folderReg, mainDescriptor);
    }
    }

    Instead of using the currentApplicationDescriptor(), I was referencing the module of the application itself using the CoreModuleManager. My init method takes in the ApplicationDescriptor and use it for everything.

    Thanks to all who have any time to read my post!

  • Add the instance before existing instance

    Hi all

    is it possible to add a new instance of a subform to show in a top of the existing subform? the way it works now when you add a click on the button to add a subform, the new subform appears under the exisitng subform and so on, each time that I add a subform there goes down. I want the opposite to happen where new subforms, always appear at the top of the old subforms.

    It depends on where you want the subform actually go.

    Suppose that you have a button inside a subform and you still want the new subform to go on top of the entire stack of subforms:

    this.parent.instanceManager.insertInstance(0);
    

    If you want to add it right above some instance that you are working on, and then copy the following code will work:

    this.parent.instanceManager.insertInstance(this.parent.index);
    

    Note: You must add or remove reference points depending on what you use to raise the event, of course.

  • How to use the different instances of the object of the view

    Hello adf'rs.

    Is it possible to instantiate or use multiple instances (ie. instantiations) of a view object that exists in a module of the app?

    You can do this manually by creating a new iterator required in your binding tab.
    So instead of sliding the VO directly in the page, click the link tab, add a new binding executable iterator and point to this one by your ELs on the page itself.

  • Use the string as instance name

    var character: Array = new Array();

    for (var i: int = 1; i < = 26; i ++)

    {

    If (I < 10)

    {

    Persona.push ("persona0" + i);

    }

    on the other

    {

    Persona.push ("persona" + i);

    }

    }

    //

    var personaclip = persona [4]; persona04

    var personainstance:MovieClip = new personaclip();

    addChild (personainstance);

    What I'm trying to do here, is first to create a table of all 26 clips that are already in the library and the value of export for actionscript, persona01 to persona26.

    Can I choose the number for the clip to use, which is persona04. I would like to add that, for the scene. So I first create the instance of the element persona04 through personainstance and then add it by addChild.

    But the variable personainstance is where I'm going wrong I get an error #1007 trying to create an instance on an element that is not a constructor. How can I make it clear that for the movieclip personainstance I want to select the clip of persona04 form the library? Guess I have to convert the string "persona04" in the name of the constructor, somehow.

    creating instances of dynamic class using strings
    -------------------------------------------------------------

    var ClassRef: Class = Class (getDefinitionByName ("className"));
    var classInstance: * = new ClassRef();
    addChild (classInstance);

  • Could not add the instance of a hidden subform

    I use Adobe Designer 10 and have used the Action feature to set up my buttons.

    Here's the problem:

    The user is presented with a question:

    You eat apples? Yes/No.

    If the user selects the 'Yes' box, then the subform, 'WhatKindofApples', is set to Visible and appears.

    If the user eat more than one kind of apple, the user must be able to add additional instances of 'WhatKindofApples' by clicking on the button 'add additional apples '.

    If the subform, 'WhatKindofApples', is set to Visible the button 'Add additional apples' works very well.

    If the subform is set to Hidden, then the Add button does not work.

    So, it seems that there is some kind of conflict between being able to add additional instances of subforms hidden once they become visible. I have included my form Javascript code.

    Here is the Javascript code for the Add button:

    Form1. WhatKindofApples.AddAddlApples::click - (JavaScript, client)

    + PRODUCT - CHANGE (ID:0482B39E - E8D0-4F08-B 313-E142D733EE1F CRC:2782582760)

    + Type: Action

    + Result1: AddInstance ("$Node2")

    + Node2: form1 [0]. WhatKindofApples [0]

    + Node1: form1 WhatKindofApples [0] [0]. AddAddlApples [0]

    + Condition1: Button ("$Node1", "click")

    + ActionName: AddlEntityPrivate.click

    this.resolveNode('form1._WhatKindofApples').addInstance (1);

    If (xfa.host.version < 8) {}

    XFA. Form.Recalculate (1);

    }

    //-

    Any help would be greatly appreciated!

    Hello

    I suspect that the addInstance() is trying to work. Keep in mind that the addInstance() will create a new instance of the object that is repeated in its original state. So if the extensible object has hidden, then if new instances are created they will be also hidden.

    A work around would be to establish the presence of the subform to visible in design mode (object > field palette). Then, in the object > range of binding the value the number Min 0. This means that when the form is rendered, the subform will not appear. Finally, the script in the click event of the button would add an instance, rather than make it visible.

    Hope that helps,

    Niall

  • Subforms in subforms add the problem of the Instance

    Hello

    I am new to Adobe Livecycle Designer (I use version 8.2.1) but I managed to almost all elements of the long form that I need to produce, with the exception of a section, I'm having trouble getting it to work properly. In the example, I have a subform extensible "organization" subform "Membership" page, which has buttons add and remove instances, which are working properly. But within each instance of this "organization" subform is another subform instance stretch "ExpertNames" with the buttons add and remove instances.

    The 'Body' form allows an organization to be named and the subform 'ExpertNames' allows several members of this organization to be named and associated with each organization. The user should be able to list several organizations of each with one or more members. I can successfully add several instances of the 'Body' form using one after another

    Membership.Organisation.instanceManager.addInstance(1)

    and remove the instance selected using

    Membership.Organisation.instanceManager.removeInstance(this.parent.index)

    I have the following text together on the button to add a new instance of the form 'ExpertNames '.

    Membership.Organisation.ExpertNames.instanceManager.addInstance(1);

    and the following to delete the instance selected in the form 'ExpertNames '.

    Membership.Organisation.ExpertNames.instanceManager.removeInstance(this.parent.index);

    However when I add a second instance of the form 'Body' which is a new organization and try and add additional members to the Organization of the 2nd it adds them to the organisation ofst 1 rather than the second! I have an example in the form of problem I can send if necessary.

    Hope someone will be able to help with this.

    Thanks in advance

    Lara

    Send the form to [email protected] and include an explanation of the question and I'll have a look when I get the chance.

    Paul

  • decide on the instance of class really used at runtime

    Hello:
    I need to ask something form the Pb and then wrap the result of the query as an object and I have several types of mark, so I tried to extract them by using the extension mechanism.

    ----------------------------------
    abstract class AbstractExecutor {
         public String     sql;
         public abstract String execut();
    }
    class UserExecutor extends AbstractExecutor {
         @Override
         public String execut() {
              ArrayList<User> resList = new ArrayList<User>();
              sql = "select username from user";
              // user the sql to query from db
              ResultSet rs = null;//
              // iterative the rs, make each record to a User object and put it to the
              // list:someting like that:
              User u = new User("This argument coms from the db");
              resList.add(u);
              // build the result string by the resList, here I just call its toString
              // method for example.
              return resList.toString();
         }
         static class User {
              String     name;
              public User(String name) {this.name = name;}
         }
    }
    class MessageExecutor extends AbstractExecutor {
         @Override
         public String execut() {
              ArrayList<Message> resList = new ArrayList<Message>();
              sql = "select title from message";
              // use the sql to query from db
              ResultSet rs = null;//
              // iterative the rs, make each record to a Message object and put it to
              // the list:someting like that:
              Message u = new Message("This argument coms from the db");
              resList.add(u);
              // build the result string by the resList, here I just call its toString
              // method for example.
              return resList.toString();
         }
    
         static class Message {
              String     title;
              public Message(String title) {this.title = title;}
         }
    
    }
    
    public class Client {
         public static void main(String[] args) {
              Map<String, AbstractExecutor> map = new HashMap<String, AbstractExecutor>();
              map.put("1", new UserExecutor());
              map.put("2", new MessageExecutor());
    
              // get the parameter from request...
              int type = 2;
              map.get(type + "").execut();
         }
    }
    --------------------------------------

    Of course the steps in the logic of two bussiness (the UserExecutor and the MessageExecutor) are then same with the others, the only difference is the 'sql' and the 'class' used for wraped the result (the user and the Message)
    so I'm wondering, can I extract the same logic to their superclass (AbstractExecutor)?

    I tried generics:
    --------------------------------------
    abstract class AbstractExecutor<E> {
         public String     queryFields[]={};
         public String execut(){
              ArrayList<E> resList = new ArrayList<E>();
              sql = "select "+queryFields[0]+" from "+queryFields[1];
              // use the sql to query from db
              ResultSet rs = null;//
              // iterative the rs, make each record to a E object and put it to
              // the list,someting like that:
              E e = ? // here how to make a instance of E(a User object or a Message object)?
              resList.add(e);
              // build the result string by the resList, here I just call its toString
              // method for example.
              return resList.toString();
         }
    }
    If the above work, the UserExecutor can be like this:
    class UserExecutor extends AbstractExecutor<User> {
         //just override the fields of its superclass.
         queryFields={"username","user"};
    }
    class User{
              String     name;
              public Message(String name) {this.name = name;}
    }
    I wonder if it's possible? If generic manufacturers cannot operate, are there other ways to do this?
    What I want to really reduced repetitive codes and makes stretch, since I can add another executor in the future.

    Your example is simplistic in that the business logic of 'client' (ArrayList.toString ()) depends on the type of the objects in the list.
    With this in mind...

    I wonder if it's possible?

    Yes, just replace the question mark with a call to abstract method (Note: which highlights the model Template methodGoF):

    abstract class AbstractExecutor {
         protected abstract E createInstanceOfContent(ResultSet rs);
    
        public String execut(){
          ArrayList resList = new ArrayList();
          sql = "select "+queryFields[0]+" from "+queryFields[1];
          // use the sql to query from db
          ResultSet rs = null;//
          // iterative the rs, make each record to a E object and put it to
          // the list,someting like that:
          E e = createInstanceOfContent(rs);
          resList.add(e);
          // build the result string by the resList, here I just call its toString
    }
    
    class UserExecutor extends AbstractExecutor {
          protected User createInstanceOfContent(ResultSet rs) {
            User user = new User();
            user.setName(...);
            return user;
        }
    }
    

    are there other ways to do this?

    Your executor abstract is not really taking advantage of security of generic type, so you could do it with simple inheritance:

    abstract class AbstractExecutor{
        protected abstract Object createInstanceOfContent(ResultSet rs);
    
        public String execute(){
          ArrayList resList = new ArrayList();
          sql = "select "+queryFields[0]+" from "+queryFields[1];
          // use the sql to query from db
          ResultSet rs = null;//
          // iterative the rs, make each record to a E object and put it to
          // the list,someting like that:
          E e = createInstanceOfContent(rs);
          resList.add(e);
          // build the result string by the resList, here I just call its toString
    }
    
    class UserExecutor extends AbstractExecutor {
          protected Object createInstanceOfContent(ResultSet rs) {
            User user = new User();
            user.setName(...);
            return user;
        }
    }
    

    What I want to really reduced repetitive codes and makes stretch, since I can add another executor in the future.

    Good intention. Try to identify the operations that are common to all types of executor (for example, the creation of some entity, storage in a collection, iteration over the collection,...) and ask if they take advantage of a common interface of the manipulated entities (your example does not show that).

    For your information, Spring 'JDBC' or 'DAO' API, I don't remember the name, introduced models this kind of logic for awhile now. Even if you do not use Spring as a framework for Dependency Injection, spring-jdbc library is worth the visit.

  • 11g RAC Installation fails add the instance on windows 2003 Server

    I am install 11g RAC on windows server 2003.
    Finished creating House of CRS and it looks good.
    Tried to create the database using DBCA it gives me below error. Help, please.

    D:\ > srvctl add instance d mgrpdb-i mgrpdb1 - n mgrpcluster-1
    PRKO-2010: error in adding instance to the node: mgrpcluster-1
    PRKR-1008: adding the instance mgrpdb1 on the mgrpcluster-1 node to the cluster database
    mgrpdb failed.
    PROC-27: error in authentication layer authentication failure [ALS error informat
    ion: category: operation [1234]: [scls_iddb_get_privgrp_id_by_name] location: [L
    [ookupAccoun] others: [LookupAccountName failed] Dep: [1332]] [1]

    concerning
    Musaddaq

    Salvation;

    Please check below and see its useful for your question:

    Upgrade to 10204 CRS cannot start Instance resource to aid native group 'dba' [603667.1 ID]
    PRK % error - Cause and Action required [ID 178435.1]
    Bug 3584146 - PRKR-1008 instance adding to SIR via SRVCTL [3584146.8 ID]

    It may be useful

    Respect of
    HELIOS

  • Cannot add the instance ID

    I'm working on a flash AS2 file that contains drop-down list boxes.

    When I start the program I can right click on a button and add instance code it is to say the current selection is the button.

    After working on the file for a while, I can't do that.

    When I right click on the new buttons and objects and select actions the current selection shows as a frame not the
    object I want to add code too.

    It's very frustrating because I can not add the instance code.

    Any help would be greatly appreciated

    Alfred

    I think the problem was the button pin of current script. Some how I clicked on it and little matter I have a click right on it should always be the last script that I used before I hit the button.

    Thanks for your quick response.

    Alfred

  • Multiple sites using the same instance of CF?

    Hi Gang-
    I have a client who has recently improved CF Pro to Enterprise and they use in a relatively simple way as an intranet. They would like to help me configure a second instance for the purpose of a staging server, but I noticed after they revealed they do not have the link of Enterprise Manager in their CF Admin screen.

    They need to reinstall CF using the MultiServer installation version to be able to deploy a second instance of CF? Need to uninstall and reinstall? Ugh...

    Can't they just create a second site under their web server, using a different port and you worry about the second instance of CF? Best practices for a moment, remember, they do not necessarily expand on this server, it is intended to be a staging server.

    Any ideas on the best and fastest way to handle this?

    Many thanks in advance,
    Rich

    Many questions, many answers. :-)

    Yes, rich, they would need to install the version multiserver for you to see this Enterprise Manager option in the CF Admin. But no, they would not need to uninstall the server deployment (what you did) to add to the MultiServer deployment. They can coexist (although it is not something most would do in general).

    The best news for you is that, Yes, they can indeed just set up a second site on their web server, and who also point to the deployment server CF one you have installed. It is, of course, assuming that they are running a web server that supports multiple sites. If it's Apache, you're good. If this is Windows, then as long as the Windows Server 2003 (or 2008 or Vista), you're good, too. (Just to be complete, for other readers, XP does not allow you run multiple sites at the same time.)

    If during the installation of the CF tells you that there all sites on the web server with CF, you need do nothing again create site. It should be immediately able to run pages CF. If you said that it is in CF link to a site, then you will need run the server web Configurator again. You can do it manually, even after installation. See the CF Admin and Config docs to learn more about it, as well as on this issue. (I know many like to just run things and hope that the interface is pretty clear, but as this issue shows, for some things anyone installing CF will be well served by looking at this collection of Miss often.)

    Hope that helps, Rich. It is not a RTFM response. :-) Suffice it to say that if you need more that what I said, it's in the manual. Yet, I am happy to answer follow up if I can.

  • no user key can be used for the instance of the component integration "Contact."

    I try to use the InsertOrUpdate method on the contacts. All I'm trying to add is a first contact name, first name, telephone number and the owner. Using InsertOrUpdate I get, no user key can be used for the instance of the component integration "Contact."

    I can use the Insert method with no problems. What Miss me? Why the InsertOrUpdate method will not insert it?

    Thank you.

    Hey... I also had the same problem into account.

    so I tried to give the ExternalSystemId. and it worked... It should work once you set the external id.

    Concerning
    Balaji Tr.

Maybe you are looking for