Question about scripts in repeatbel sub-form objects

Hi,
  I am working on creating a form which has a sub-form that can be repeated as many times as the user wants to. There is an ‘Add’ button which creates an instance of the sub-form on the form, when clicked.
On the sub-form I have 5 numeric fields say a1-a5 and 1 field say b1 which is the sum of all these 5 fields.
On the Main form I have a 2 fields - say t1 and f1.
The requirement is t1=f1+b1+(sub-form instance 2’s b1)+(sub-form instance 3’s b1)+ and so on …depending on as many sub-form instances there are that the user adds.
I have created Actions using the Action Builder such that when any of a1 to a5 fields are exited, b1 will be updated with the sum of a1-a5. At the same time t1 will be updated with sum of f1 and b1.
This works great for 1 instance of the sub-form. But when ‘Add’ is clicked and a second instance of the sub-form is added, then the script does not work as it did for the first instance of the sub-form. So for any instances of the sub-form added, when values are added to a1-a5 and the fields are existed, b1 does not get updated.
How can I fix this?
See attached form that I am creating for clarity.
‘Total Hours worked this week’ is the t1 I was talking about. See how it gets updated when values are entered in any of the hour fields. It works fine with the default instance of the T100/Strategic/Advantage Customer Information sub-form as well. But when I click on ‘Add Customer’ button to add another instance of the sub-form, it does not work as expected.
Please let me know if it is still not clear and I can explain the issue.

Vjay's solution works great! Essentially, take out all of your other programming on the individual fields, and hard script the field you want the sum to show on. By directly referencing the fields, Adobe is able to tell the difference between one instance and another and doesn't get them mixed up. (I have found for some of these dynamic functions, the Action Builder doesn't really work, so you need to code by hand)
My only suggestion, would be to perhaps modify Vjay's code a little, and use Javascript instead of Formcalc. We have run into the problem where if a user is using the form from a webserver or something and hasn't actually been saved to the user PC, the Formcalc scripts won't run, only Javascript. But it all depends on how you are using your forms.
Here is your line of code changed to Javascript, in case you want to make that change. (there's really not much difference at all)
this.rawValue = sum(CustomerTimeBD.Row1.Cell1.rawValue + CustomerTimeBD.Row1.Cell2.rawValue + CustomerTimeBD.Row2.Cell1.rawValue + CustomerTimeBD.Row2.Cell2.rawValue + CustomerTimeBD.Row3.Cell1.rawValue + CustomerTimeBD.Row3.Cell2.rawValue + CustomerTimeBD.Row4.Cell1.rawValue + CustomerTimeBD.Row4.Cell2.rawValue + CustomerTimeBD.Row5.Cell1.rawValue);

Similar Messages

  • Question about documenting process maps and form object properties

    Does the new version of Workbench have a tool that allows us to print a report showing the properties of the object used in a form template or process map? For example... showing all of the properties like fonts, size, patterns, defaults, whether or not a field is required, etc...? I am also checking to see if this capability has been added to Workbench for Process Maps?

    No it does not but there is a blog entry by John Briinkman that will analyze your form template and give you some of that information. Here is a link to the blog entry:
    http://blogs.adobe.com/formfeed/2011/05/updated-form-report-tool.html
    Paul

  • Question about using constant variables in Forms

    As I am still very new to Forms, please forgive my ignorance if the answer to my question is very simple. I am trying to figure out how to use constant variables within my Forms application. For example, if I want to setup return code constants for the application (mind me, these are examples):
    RC_SUCCESS CONSTANT PLS_INTEGER := 1;
    RC_FAILURE CONSTANT PLS_INTEGER := 0;
    RC_YEAR_DATA_NOT_FOUND := 50;
    Then in a module I created, if I wanted to check the return code against one of the constants I would do:
    DECLARE
    rc PLS_INTEGER;
    BEGIN
    GET_YEAR_DATA('2000', rc);
    IF rc = RC_YEAR_DATA_NOT_FOUND THEN
    -- Do some error handling
    END IF;
    END;
    I know that you can declare constants within individual procedures or packages but I can't see to find information on how to do this globally for the application. I've read about using global variables within Forms but the CHAR data type only and the fact the value can be changed doesn't really fit for this purpose. Am I missing something? Is there a config file or something for the webserver that can be used to set these up??
    Any help would be appreciated.
    Thanks

    To declare constants create a Package-Specification in a pll and deifne all your constants there, something like:
    PACKAGE PK_CONSTANTS IS
      RC_SUCCESS CONSTANT PLS_INTEGER := 1;
      RC_FAILURE CONSTANT PLS_INTEGER := 0;
      RC_YEAR_DATA_NOT_FOUND := 50;
    END;Then attach that pll to all your forms-modules, and use it like
    IF rc = PK_CONSTANTS.RC_YEAR_DATA_NOT_FOUND THEN
    END IF;A word about exceptions or errors: In my eyes its clearer (and in case of exceptions even better) to raise an exception than to hide it behind return-codes.

  • Question about using calculations in PDF form

    I am creating an order form with fields using simple calcuation math (price field x qty field = subtotal field). My question is, if the quantity fields in the order form are blank I would like the subtotal and total fields to remain blank as well. However it shows and prints as 0.00. Is there a way to change that?

    Use this code as the custom validation script for that field:
    if (event.value == 0) event.value = "";

  • Question about doing math in pdf form

    Hi, I have created a filable form in adobe. I am trying to perform some basic math in this pdf form but I can't seem to get it to work. I have few fields that I am using basic logic to calculate one field. I used the following code.
    if (Dropdown4> 0){
    KWH = Dropdown3 * Dropdown4 * KWH1;}
    else
    {KWH = Dropdown3*Dropdown4*Dropdown1;}
    endif
    KWH1 is a fillable field but dropdown1, dropdown 3 and dropdown 4 are fields with drop down lists. I want to populate field KWH based on the logic above. I don't get any result whatsoever. The KWH field is blank.

    The custom calculate script for the KWH field would be something like:
    // Get the value of the fields, as numbers
    var DD1 = +getField("Dropdown1").value;
    var DD4 = +getField("Dropdown4").value;
    var DD3 = +getField("Dropdown3").value;
    var KWH1 = +getField("KWH1").value;
    // Set this field's value
    event.value = DD4 > 0 ? DD3 * DD4 * KW1 : DD3 * DD4 * DD1;
    That last line is equivalent to:
    if (DD4 > 0) {
        event.value = DD3 * DD4 * KW1;
    } else {
       event.value = DD3 * DD4 * DD1;
    There are a number of tutorials available if you want to learn more about creating custom calculation scripts in PDF forms. Post again if you need help finding them.

  • Question about using library items in forms

    After a long time I am again returning to this perpetual fountain of Dreamweaver knowledge.
    I am converting a site from AGL to DW. In AGL I used a separate template for the forms (there are over 10) and used "components" to create the different forms. Each form shared features with other forms but were not identical, all together 5 components. When I converted over to DW the 5 compnents were made into 5 "library items" but neither the form template or the library items work, by that I mean they do not update if I make a change.
    Hence I want to make 5 new library items to use in the forms my question is this: when I choose an item to put in the form like a text field or radio button I always get this window.
    Though I read the documentation I am still not really clear about the "style" option so I just choose "no label tag." What is this used for? Any examples of how it is used?
    Regarding "position" before or after the item, what is this all about? I have been choosing "after form item" but I don't really know what the difference is and what advantages or disadvantages acrue from these choices.
    Regarding "Access key" and "Tab index" I sort of have the idea of what it is about but an example of how they work in action would clear up any nebulosity.
    But my real puzzle is with the following which pops up at the end when I am inserting a form items.
    Since the library items are not separate forms in themselves I have NOT added the form tag because my reasoning is that when I make the new form templates it will have the requisite form tags. Am I correct in this line of thinking? Or do I have to add form tags every time I add form elements to a form? I really don't want to have to do the whole thing over again if I get it wrong. So if one of you kind souls could guide me in doing it right the first time I would really appreciate it.
    I am using a MBP, OS X 10.6.8, DW CS6
    BvL

    To declare constants create a Package-Specification in a pll and deifne all your constants there, something like:
    PACKAGE PK_CONSTANTS IS
      RC_SUCCESS CONSTANT PLS_INTEGER := 1;
      RC_FAILURE CONSTANT PLS_INTEGER := 0;
      RC_YEAR_DATA_NOT_FOUND := 50;
    END;Then attach that pll to all your forms-modules, and use it like
    IF rc = PK_CONSTANTS.RC_YEAR_DATA_NOT_FOUND THEN
    END IF;A word about exceptions or errors: In my eyes its clearer (and in case of exceptions even better) to raise an exception than to hide it behind return-codes.

  • Question about script in sun studio creator2 and netbean6.1

    Hi, I have a quick question
    I have started a project by using sun studio creator2, the main page contains following script, it works perfectly fine.
    <script type="text/javascript">
    function getUser()
    var net = new ActiveXObject("wscript.network");
    document.getElementById('form1:hiddenField1').value = net.UserName;
    </script>
    And then I bind the field to a managed bean's property.
    However, because I need to use netbean6.1 to continue this project. I find previous script doesn't work any more. (I can get net.UserName, but I can't store the value to hiddenfield)
    I checked woodstock documentation, and guess following will do the same job
    <webuijsf:script>
    function getUser() {
    var net = new ActiveXObject("wscript.network");
    var domNode = document.getElementById('_form1:hiddenField1');
    domNode.setProps({value:net.UserName});
    </webuijsf:script>
    Once run the getUser() function, I got an "object doesn't support this property or method".
    It looks like IE security level setting problem. If it is so, because it is company setting. There is nothing I can do here.
    Any one knows workaround to store the retrived userName into hiddenfield?
    Thanks in advance!!!

    any help is appreciated

  • Beginner's question about scripting and deployment automation

    I am new to the SAP and BusinessObjects world.  I do production support for BusinessObjects XI R3.1.  One of my functions is to deploy Universe.unv and WEBI Report files from development into QA and production.  This is currently a manual process involving downloading files and lots of key strokes and mouse clicks using the BusinessObjects Client Tools.  My question ->:  is there a way to automate this process?  Can I do this with the SAP scripting wizard?  I am familiar with many different scripting and programming languages, I just need to be pointed in the right direction.
    Thanks for your help!

    I would take a step back and learn more about the fundamentals of Flash before going farther. In the Welcome Screen of Flash Profressional there is a "Learn" section. Here are some links from it:
    Introducing Flash: http://www.adobe.com/go/fl_learn1
    Symbols: http://www.adobe.com/go/fl_learn2
    Timelines and Animation: http://www.adobe.com/go/fl_learn3
    Instance Names: http://www.adobe.com/go/fl_learn4
    Simple Interactivity: http://www.adobe.com/go/fl_learn5
    ActionScript: http://www.adobe.com/go/fl_learn6

  • Question about using database links in Forms 10g

    I have a form that uses a database link for the "Query Data Source Name," i.e. it is set to some_view@some_db_link
    For some reason when I run a query using the DB link the query takes approximately 30 seconds. When I remove the link and go local the query takes about one second. Has anybody observed and addressed this issue before (without going local of course)?
    Thanks,
    Thomas

    Let me first say that it is never a good idea to use a db link in the data source. It is better to create a synonym in the database and use this as the data source. If the db link changes, you only have to do this in the database, without recompiling forms.
    create synonym some_view for some_view@some_db_link
    This may already solve your problem. If not, than see if the query is also slow in sqlplus. You may have a problem in your connection between the two databases.

  • One more question about "snap to" points in audio objects

    sorry, one more question people.............. is there a way to set a "snap to" point in an audio region? Can I have logic set a point, or an "anchor" within an audio region that would coincide with the cursor. Once I get the cursor to a bar or a beat, is there a command that would allow a "snap to" point to be created in an audio object? That way I could clean up any "noise" or "chatter" at the beginning of an audio bounce or any audio object, and still have no problem pasting it all over my arrangement. I'm sure it's in here somewhere, but can't find it in the manual..
    thanks again!!!

    The anchor point in an audio region can be moved to wherever you want it to be. Let's say you recorded a loud piano bass note and afterwards you trimmed the file so that the attack of this sound happens right at the beginning of the audio region. Your anchor point will now coincide with the begnning of that region. This means that you can place that audio at, say, bar 37 and it's guaranteed that the attack of that sound will play exactly at bar 37. In this case anchor point = position of audio region in the Arrange Window.
    Even though you haven't played a MIDI note into the song in order to place this audio region, an "event" is generated for this sound which can be viewed in a special version of the Event Editor which shows the position of all audio regions in the arrangement. Access this by simply clicking on a blank area of the Arrange window and then opening the Event Editor.
    So let's say this sound is positioned at bar 37. Open the Event Editor (as described above) and you'll see an event at 37 1 1 1 and the name of that audio region to its right. In this case, the event's position = the start of the sound file = the position of the anchor within that sound file. If you changed the position of that event to 38, or 109, or 3, that audio region will be "triggered" at any of those positions. That sound will always "attack" on a downbeat.
    Now let's say you reversed that pinao note in order to create a dramatic swell into a section of your song. (Open the sample editor and use the Reverse function). At this point, the anchor point is still positioned at the beginning of the file! Play back the sequence (from our bar 37) and the audio will play back from bar 37, only backwards this time; the peak of that piano note will be at some point later than 37.
    So let's say you wanted to position this sound so that it hits exactly on the downbeat of bar 37. How do you do it? Well, you could always slide the audio file in the Arrange Window and try to line up the attack of the audio waveform with the downbeat of bar 37, but there's an easier way...
    Open the sample editor and move the anchor point to the end of the file, coinciding with the peak of the waveform (the piano's attack is now at the end because we reversed the audio). Next, close the sample editor window, click on a blank area in the Arrange Window and open the Event Editor. You'll see that this audio region is still positioned at bar 37, but the actual beginning of the sound file now starts before bar 37. Now when you play back, Logic will start playing that sound file before bar 37, but the audio's peak will be lined up at bar 37.

  • Questions about scripts

    Hello,
    I'm recently learning computer science in school and I am learning how to create some scripts. I'm having trouble in creating some type of script and I was wondering if someone could help me out on it. I'm not asking for you guys to write the whole script for me but some tips on what I should look for, etc. I know most of the terminology.
    scripts with problems:
    1) Write a program that calculates n!
    2)Write a program that determines whether a given natural number is prime or composite.
    3)Write a program with three integer variables, n1, n2, and n3. Initialize two of those variables, i.e. n1 and n2, with input from the user. Then swap the values of these two variables so that the value that was originally in n1 winds up in n2 and the value that was originally in n2 winds up in n1. Note: The third variable plays an important role. If you are having trouble, first try the next problem below involving the two balls and the three boxes.
    Thanks Alot. I appreciate the help.

    1) Popular example which people would suggest you use recursion. If you want it simpler, use for loop. Google gives you tons of example.
    2) Prime is only divisible by 1 and itself. So you would look for "%" operator for finding the remainder.
    3) I think this one is pretty straight forward.
    Actually, before posting these question, any idea in your mind ?

  • Question about mapping art to a 3d object

    I'm looking for help with mapping art to a 3d object using the extrude and bevel effect, and I keep running into the same issues.
    I've attached an image of what I'm trying to replicate (on the left) and where I am currently at (on the right). The left image is what we're looking to duplicate, in a 3d manner, but I'm not able to add the roll tail (which now needs to have a bit of a curve coming towards you), without there being numerous surfaces in the 'map art' box. What I am hoping is that there is a way to create one surface that wraps completely around the roll, and then down to the tail, and curling towards the viewer. Currently when I do this it creates numerous surfaces so I have to map the art to piece it together and it doesn't line up with the other mapped art. I would so appreciate any help you can offer!
    Also, I'm not able to get a great shadow inside the roll, is there something I'm missing with the lighting options?
    Thank you!
    (Using AI CS6 on a PC)

    I managed this quickly:
    for some reason it split the top surface of the reel into two though. the divide is at the top. I just mapped the symbol to both so it looks like it's going all round.

  • Question about data extraction from web forms

    I am developing a simple web form in DreamWeaver MX for
    increased accesibility for users who utilize screen reader
    software, as navigating PDF forms is still currently very difficult
    for most of the screen readers to navigate. I was wondering if
    there is a way to take an .asp webform that a user fills out and
    when they hit a print button it would extract the data from the
    form and open an Adobe PDF form and populate the data they entered
    into specific fields within the PDF form which would allow them to
    print an official copy of the form they used the web version to
    complete. Any insight into this possibility is greatly appreciated!
    Thanks,
    AU PSD

    Regex? Lots of indexOf? Parsing...

  • Question about scripting of foreign keys

    When I script FK_SalesOrderHeader_Address_BillToAddressID key from AdventureWorks.[Sales].[SalesOrderHeader] I get this:
    ALTER TABLE [Sales].[SalesOrderHeader] WITH CHECK ADD CONSTRAINT [FK_SalesOrderHeader_Address_BillToAddressID] FOREIGN KEY([BillToAddressID])
    REFERENCES [Person].[Address] ([AddressID])
    GO
    ALTER TABLE [Sales].[SalesOrderHeader] CHECK CONSTRAINT [FK_SalesOrderHeader_Address_BillToAddressID]
    GO
    EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Foreign key constraint referencing Address.AddressID.' , @level0type=N'SCHEMA',@level0name=N'Sales', @level1type=N'TABLE',@level1name=N'SalesOrderHeader', @level2type=N'CONSTRAINT',@level2name=N'FK_SalesOrderHeader_Address_BillToAddressID'
    GO
    What is second ALTER statement for (the one highlighted with bold font)? First ALTER statement already includes WITH CHECK, so isn't the second one redundant?

    The 2nd Statement enables the Foreign Key.
    I think it is redundant because FOREIGN KEY is enabled by default when you execute the 1st statement.
    This script is generated by SSMS (Yes?), This is added just to ensure that CONSTRAINT is enabled.
    - Vishal
    SqlAndMe.com
    Yes, it is generated by SSMS 2008.

  • Question about Break Columns on Tabular Form

    is it possible to have the following result on apex Tabular Form while doing Break Columns ??
    To place one blank line between departments, enter the following command:
    BREAK ON DEPARTMENT_ID SKIP 1
    Now rerun the query:
    DEPARTMENT_ID LAST_NAME                     SALARY
               20 Hartstein                      13000
               80 Russell                        14000
                  Partners                       13500
               90 King                           24000
                  Kochhar                        17000
                  De Haan                        17000
    6 rows selected.The result achieved was not as expected, the sample is hosted on https://apex.oracle.com/pls/apex/f?p=10037 demo/1234 please help
    Region Source :
    select DEPTNO, EMPNO, ENAME, JOB,MGR, HIREDATE, SAL,COMM
    from "#OWNER#"."EMP"Report Attributes :
    Break Columns - First Column

    LTaura wrote:
    what does the built-in tabular form and break functionality do ?The built-in tabular form wizard generates the tabular form report and ApplyMRU and ApplyMRD processes to handle the submitted form.
    The report renders the retrieved data values as HTML form controls to enable them to be edited by the user. The <tt>DEPTNO</tt> in from the first row in your query is rendered thus:
    &lt;input type="text" name="f01" size="16" maxlength="2000" value="10" id="f01_0001" autocomplete="off"&gt;and that in the second row as:
    &lt;input type="text" name="f01" size="16" maxlength="2000" value="10" id="f01_0002" autocomplete="off"&gt;Since these are not exactly the same (different <tt>id</tt> attributes), the built-in break formatting sees them as different values, so no report break is applied.
    However, even if this was not the case and the break was applied to give only 3 text items for the 3 <tt>DEPTNO</tt> values, the ApplyMRU and ApplyMRD processes expect a <tt>DEPTNO</tt> value to be submitted for each row, and would fail for the subordinate <tt>EMP</tt> rows where it was missing.

Maybe you are looking for