Cfajaxproxy bind with dynamic form

I have a form with many rows built in a cfloop.  I am trying to do a simple client side calculation if the user changes a value in a text box.  I can ge the calculation to work, but it places the result in the last row of the form rather than the row the user changed.  In other words, they change the values in a text box on row 3 for example.  It calculates the right value(using row 3 values) and places the result in the last row(for example row 54).
<td align="center">
     <cfinput id="costPerUnit_#currentrow#" name="costPerUnit_#currentrow#" required="yes" value="#products.COSTPERUNIT#" tabindex="-1">
</td>
<td align="center">
     <cfinput id="ozPerUnit_#currentrow#" name="ozPerUnit_#currentrow#" required="yes" value="#products.OZPERUNIT#" tabindex="-1">
</td>
<td align="center">
               <cfajaxproxy bind="javascript:doCalcCostPerOz({costPerUnit_#currentrow#},{ozPerUnit_#currentrow#})" />
               <script>
               function doCalcCostPerOz(c,o) {document.getElementById("costPerOz_#currentrow#").value = (parseFloat(c)/parseFloat(o)).toFixed(2);}
               </script>
     <cfinput id="costPerOz_#currentrow#" name="costPerOz_#currentrow#" type="text" value="#products.COSTPEROZ#">
</td>
Does anyone have any insight how to make sure the results of the above calculation go to the proper row?  I assume it has something to do with the bind expression above and the fact that the costPerOz_#currentrow# is not in the bind expression.

I think I found a workaround for this.  I stored the currentrow in a hidden input field and passed it to the javascript function.  Here is the code that worked for me:
<!--- thisinput field only stores the current row in order to display the resule of the below javascript calculation --->
<cfinput id="rowIndex_#currentrow#" name="rowIndex_#currentrow#" type="hidden" value="#currentRow#">
<td align="center">
<cfajaxproxy bind="javascript:doCalcCostPerOz({costPerUnit_#currentrow#},{ozPerUnit_#currentrow#},{rowIndex_#currentRow#})" />
<script>
                              var fieldName = "costPerOz_";
                              function doCalcCostPerOz(c,o,r) {
                                        document.getElementById(fieldName.concat(r)).value = (parseFloat(c)/parseFloat(o)).toFixed(2);
</script>
<!---#products.COSTPEROZ#--->
<cfinput id="costPerOz_#currentrow#" name="costPerOz_#currentrow#" type="text" value="#products.COSTPEROZ#" readonly="yes" tabindex="-1">
</td>

Similar Messages

  • I created new table in database and want to bind with system form

    Hi All,
    1) i created new table in database and want to bind with system form .
    2) How i bind this field to system form sale order where i added new folder tab in that i added some fields that fields i want to bind with database. when i click on the next ,previous ,first and last button
    bind value should change.
    Awaiting soon reply
    Rajkumar G.

    hi,
    try this
    Public Sub BindDataToForm()
            Dim oItem As SAPbouiCOM.Item
            Dim oEdit As SAPbouiCOM.EditText
            Dim oComboBox As SAPbouiCOM.ComboBox
            '// getting the matrix column by the UID
            'oItem = oForm.Items.Item("docname")
            'oComboBox = oItem.Specific
            'oComboBox.DataBind.SetBound(True, "OSRI", "BaseType")
            'oItem = oForm.Items.Item("docno")
            'oEdit = oItem.Specific
            'oEdit.DataBind.SetBound(True, "OSRI", "BaseEntry")
            oColumn = oColumns.Item("Code")
            'oColumn.DataBind.SetBound(True, "", "DSCardCode")
            oColumn.DataBind.SetBound(True, "OSRI", "ItemCode")
            oColumn = oColumns.Item("Serial")
            oColumn.DataBind.SetBound(True, "OSRI", "IntrSerial")
            Try
                oColumn = oColumns.Item("Inspection")
                oColumn.DataBind.SetBound(True, "OSRI", "U_Inspection")
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
            oColumn = oColumns.Item("Quality")
            oColumn.DataBind.SetBound(True, "OSRI", "U_Quality")
            oColumn = oColumns.Item("Status")
            oColumn.DataBind.SetBound(True, "OSRI", "U_Status")
            oColumn = oColumns.Item("Finish")
            oColumn.DataBind.SetBound(True, "OSRI", "U_Finish")
            oColumn = oColumns.Item("Thickness")
            oColumn.DataBind.SetBound(True, "OSRI", "U_Thickness")
            oColumn = oColumns.Item("uom")
            oColumn.DataBind.SetBound(True, "OSRI", "U_NetUOM")
            oColumn = oColumns.Item("length")
            oColumn.DataBind.SetBound(True, "OSRI", "U_Length")
            oColumn = oColumns.Item("height")
            oColumn.DataBind.SetBound(True, "OSRI", "U_Height")
            oColumn = oColumns.Item("sqf")
            oColumn.DataBind.SetBound(True, "OSRI", "U_sqf")
            oColumn = oColumns.Item("sqm")
            oColumn.DataBind.SetBound(True, "OSRI", "U_sqm")
        End Sub

  • Panel with dynamic form

    I need to create panels with dynamic forms. Why does my application will have various forms and if I have to create a lot of forms it will take too long to complete my application.
    Can anyone help me?

    So my idea is as follows ...
    I need to create various forms, actually I wanted to create a scheme where the forms to adopt the characteristics defined by me.
    <s:Panel width="350">
                <mxml:CustomForm dataConfig="{dataConfig1}" width="100%" />
    </ S: Panel>
    Yo I'm adding the inputbox, LABES and buttons on the panel through the
    dataConfig1 = new ArrayCollection ([
                        (Label: 'Name', message: 'Invalid name', validateType 'noblank', id: 'name', text: 'Pedro Claudio', required: true),
                        (Label: 'Mail', message: 'Invalid Email' validateType: 'email', id: 'email', text:'', required: true)
    I wonder if this is the easiest way to create the forms?
    How does this business of the panels child?

  • Spry event listeners with dynamic form elements

    Hi ,
    I am trying to implement spry event listeners with a form that has dynamic check boxes and text field name. I now i can get the elements in a var and loop through with a normal function but can this work for spry events listeners

    Short answer is yes. But I have a feeling that you need further assistance, in which case give us a URL to a page that you want to apply the event listener to.

  • Bizarre CFIF issue with dynamic form variables? Very strange...

    I can't figure out what I'm doing wrong here.  Here's my code.  Issue explained below.
                <cfquery name="reviewconfigloader" datasource="MOLMS">
                SELECT *
                FROM dbo.BaseModel
                WHERE dbo.BaseModel.AccountID = #molmsAccountID# AND.dbo.BaseModel.basemodelActive = 1
                </cfquery>
          <table width="100%" border="0" cellspacing="0" cellpadding="3">
            <cfloop query="reviewconfigloader"><cfif isdefined("form.baseconfig#reviewconfigloader.basemodelID#") AND ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ "" AND ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ 0><cfoutput><tr>
              <td width="40%" bgcolor="##F7F7F7" class="basemodelsub">     #form['baseconfig#reviewconfigloader.basemodelID#']#  #reviewconfigloader.basemodelName# #reviewconfigloader.basemodelSubName#</td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">x 14 </div></td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$486/yr</div></td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$1444/yr</div></td>
              <td width="15%" bgcolor="##F7F7F7" class="basemodelsub"><div align="center">$1444/3 yr</div></td>
            </tr></cfoutput></cfif></cfloop>
          </table>
    What I'm doing here is fairly basic.I'm running a query with a number of configs in it...and then creating a loop to output them.  Ultimately, I only want the configurations that didnt have 0 submitted in the form on the previous page.  Each one of the configs in the config query has a dynamic form variable on the previous page with a quantity tied to it.  I am trying to eliminate all quantities past that aren't 0 (or not eliminate, just not show)...as you can see from the cfif statement.
    Here's where it gets weird.  You'll notice I output #form['baseconfig#reviewconfigloader.basemodelID#']#, just for testing, which shows me the quantity as it should.  I ran a test and put in a couple of 1s, 0s, 12s, 6s, etc in the form fields on the previous page.  If this thing worked, it wouldnt show anything for any of the records with their basemodelID value being submitted as 0.  Not the case.  It shows all records.  What is more hilarious is that it outputs perfectly in my test #form['baseconfig#reviewconfigloader.basemodelID#']#, showing the correct numbers entered in the previous form, the 1s, the 0s, etc, tied to each record.  But for whatever reason, the cfif code isn't catching it.
    What's even more bizarre...I replaced the cfif ("form.baseconfig#reviewconfigloader.basemodelID#") NEQ 0 with GT 12 (12 was the highest number that I put in the form) and it still showed all records.  Then I put it in as LT 12 and it showed nothing.  I decided  to take it one step further and put it in for GT 1231243242343 (random massive number), which it still showed all of the records.  So somehow, my CFIF statement thinks that  ("form.baseconfig#reviewconfigloader.basemodelID#") is a incredibly large number, although when I output it in the row below, it is the number it should be.
    I'm stumped.  Any ideas?  Thanks in advance!!

    Hey Dan...thanks....unfortunately...with the cfif testing, thats kinda what I'm
    doing because I dont have an "expected" value.  My expected value is anything a user inputs thats greater than zero, hence NEQ 0 and NEQ "". The real problem is taht what I'm outputting works and what the cfif clause is seeing is obviously very different.
    As far as your comment about looping out the variables and then setting a query equal to the value in a cfquery, remember...these are form objects and therefore nothing can be tied back to the database.  The result from the code is establishing a form variable (example.... form.basemodel1 (if 1 was the basemodelID from the database query) so it can capture whatever data the user has passed from the previous page in a text input.  So that input could have been 23, it could have been 1053.
    So really the only way to do it is create a query and loop out the variables.... and attach them to form objects (basemodel1, basemodel2, basemodel3 etc where the 1,2 and 3 are the unique ID's for those models in the database), and then look for where those form objects may have been filled in in the previous page by stating IF this form object not equal to 0 or "", output the data.
    Does that make sense?  Thanks for the help guys I'm completely stumped by this.  I've done this a million times with CFIF and I'm really struggling with why this isnt working....
    JE    

  • Are there any options (current or future) for working with dynamic forms on the iPad?

    We have a few iPads for use in our lab and are trying to utilize them as best we can.  Until now, we've had no luck finding a way to use dynamic forms (specifically and preferably from Adobe LiveCycle) on the iPads.  We use forms as electronic worksheets, and are trying to determine the best avenue to continue down.  Any suggestions would be appreciated.

    I only spent a few seconds searching, but I did find this... https://itunes.apple.com/us/app/dynoforms/id689415970?mt=8
    I'm sure there are other apps out there as well.

  • Slow loading and tabbing with dynamic form

    Hi. I have a 45 page pdf and I need to be able to select some pages to not print based on content of a field. To do this I understand the form needs to be saved in Acrobat v7 or greater and saved as a dynamic form. So far so good. When I create the dynamic form by opening the existing 45 page pdf, livecycle creates a form object for each line in the document. That's a ton of objects that don't need to be objects. I am adding 15 enterable fields into this document. For example the document may contain a line of text "Last Name", this appears as a form object as described. I am adding a text field next to that so the user can enter their last name. After saving the document it takes a long time to load and the tabbing from field to field is very slow. I am thinking this might be due to processing all the form objects that don't need to be form objects, but not sure. Question: based on my description is there a way to create this document without all those non-enterable form objects?

    Hi. I have a 45 page pdf and I need to be able to select some pages to not print based on content of a field. To do this I understand the form needs to be saved in Acrobat v7 or greater and saved as a dynamic form. So far so good. When I create the dynamic form by opening the existing 45 page pdf, livecycle creates a form object for each line in the document. That's a ton of objects that don't need to be objects. I am adding 15 enterable fields into this document. For example the document may contain a line of text "Last Name", this appears as a form object as described. I am adding a text field next to that so the user can enter their last name. After saving the document it takes a long time to load and the tabbing from field to field is very slow. I am thinking this might be due to processing all the form objects that don't need to be form objects, but not sure. Question: based on my description is there a way to create this document without all those non-enterable form objects?

  • Help with Dynamic Form Input

    Hello,
    I'd like to generate a form with a PL/SQL script.
    Basically I'd like to ask the user to rank a set of items.
    I have two tables one, ITEMS [ID (Primary Key), NAME (VARCHAR2)] and one PREFERENCES [ID (Primary Key), ITEM_ID (Foreign Key),PREFERENCE (Number), USERNAME (VARCHAR2)]
    From what I understand Collections and APEX_ITEM would be useful here.
    What should I do next?
    Should I read all of the ITEMS ( there will only be 7-13) into a collection and then use APEX_ITEM to generate rows in the form?
    Should I first create rows in Preferences, containing only the ITEM_ID and the USERNAME, and then use multiple row update in APEX_ITEM to generate a tabular form to update the rows?
    Any input would be greatly appreciated.
    Thanks,
    Sam

    I would like one form on one page for creating multiple rows. A tabular form would be fine.
    the page would look like
    Item 1 , Choose a Preference (LOV)
    Item 2, Choose a Preference (LOV)
    Item n, choose a Preference (LOV)
    I know that this could probably be done more easily one row at a time, but I am concerned about making it easy for the end user.
    A tabular form could be appropriate, however it seems like most of your example tabular forms, have already generated records. (ie http://htmldb.oracle.com/pls/otn/f?p=31517:170:4031429456413649::NO ).
    Would it make sense to prepare the form by inserting values into the table just before displaying the form.
    something like (in psudocode)
    select ID from ITEMS into l_items;
    INSERT INTO PREFERENCES (ITEM_ID)
    VALUES (l_items)
    I have a trigger on Preferences that inserts v('APP_USER') into the USERNAME column.
    If I did this the form could display
    select     "ITEMS"."NAME" as "NAME",
         "PREFERENCES"."PREFERENCE" as "PREFERENCE"
    from     "ITEMS" "ITEMS",
         "PREFERENCES" "PREFERENCES"
    where "PREFERENCES"."ITEM_ID"="ITEMS"."ID"
    NAME would be displayed as TEXT
    PREFERENCE would be an LOV
    USERNAME would be hidden
    Thanks for your help.
    -Sam

  • Please help with dynamic form field names in cfloop

    Hi,
    I need to create a form with day, date, month, year and time for 12 months
    Instead of coding them 12 times, I create day,date,month,year and time fileds in my form 1 time and then I use cfloop from="1" to="12" index="i" to loop these form fields 12 times.
    I gave each form field name such as: <input type="text" name="ScheduleDate_# i #" value=" "> this way each of those field will be named differently such as:
    ScheduleDate_1, ScheduleDate_2,ScheduleDate_3, ScheduleTime_1,ScheduleTime_2, etc
    I'm facing problem when this form is submitted, I think the error has something to do with the pound sign (##) when it comes to updating the back end
    I use MS SQL
    It doesn like this:
    <CFLOOP From="1" To="12" index="k">
    <CFIF Len(Trim(Form.MeetYear_#k#)) NEQ 0 AND Len(Trim(Form.MeetTime_#k#)) NEQ 0>
    <cfquery name="CreateSchedule" datasource="#DSN#">
    UPDATE TableSchedule 
    SET SchedDay = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedDay_#k##">,SchedMonth =
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedMonth_#k##">,SchedDate =
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedDate_#k##">,SchedYear =
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedYear_#k##">,SchedTime =
    <cfqueryparam cfsqltype="cf_sql_varchar" value="#form.SchedTime_#k##">
    Where SchedId = <cfqueryparam cfsqltype="cf_sql_numeric" value="#k#">  
    </cfquery>
    </CFIF>
    </CFLOOP>
    Can anyone help please?

    You can't nest hash marks. Do this instead:
    SET SchedDay = <cfqueryparam cfsqltype="cf_sql_varchar" value="#form["SchedDay_" & k]#">
    Dave Watts, CTO, Fig Leaf Software
    http://www.figleaf.com/
    http://training.figleaf.com/

  • Help with dynamic form

    Hi All,
    How can I insert all my labels items into a HBox?
    Here is my sample code:
    private function buildForm():void{
                    var numberOfColumns:Number = mainApp.acYears.length; //Multi years array
                    var formItem:FormItem = new FormItem();
                    var hBox:HBox = new HBox();
                    formItem.addChild(hBox);
                    for(var i:Number=0; i< numberOfColumns; i++) {
                        var formLabel:Label = new Label();
                        formLabel.text = mainApp.acYears.getItemAt(i);
                        formItem.addChild(formLabel);
                    loansForm.addChild(formItem);
    Thanks!
    Johnny

    Hi,
    FYI, the solutions is to add all the labels to the HBox first and then add the hBox to the form.
    Rgds
    Johnny

  • Dynamic forms and collection.

    Hello,
    In one of your postings you’ve explained that the collections won't work with dynamic forms.  The collection will only "see" the first instance of the subform.  You've provide link to the sample, but it does not longer work  :
    http://my.adobe.acrobat.com/p52549088/. 
    This sample shows how to manually encode data into barcode from a subform that repeats. Can you please provide a working link or sample? Is there any other suggestion on how to link barcodes on dynamic forms?
    Regards,

    Hello Dave,
    I can't say I've seen issue 1 before and would recommend contacting support.
    For item 2 I would suggest wrapping your 'line' of text in a subform then creating a script to use the setInstance method for that subform.
    Let's say you had a subform named "TextLine" (which contained a text field), a numeric field called "NumberOfLines" and a button called "SetLines". You would likely want to have javascript code on the SetLines button click event much like:
    TextLine.instanceManager.setInstances(NumberOfLines,rawValue);
    You will want to save this form as a Dynamic PDF before previewing and you will want to ensure that TextLine allows for more than one occurence (found under Object - Binding, Allow Subform to Repeat when you have that subform selected).
    You may also want to put in some validation against the NumberOfLines field to ensure it has a value.
    I hope that helps.

  • Dynamic forms struts

    I need to display a page with dynamic form elements. i.e I will not be aware of the form content...how many text boxes, drop downs while writing the concrete form bean.
    Can anyone let me know how to achieve this using struts.

    I'm not sure struts will work for you as you do not know what fields will be on the form until run-time.
    You may be stuck with working with the Action's request object:
    mRequest.getAttribute(mFieldName[1]);
    Where mFieldName is 1 or more form fields with the same name...
    I'm looking into this myself and will let you know if I come up with something better.

  • How to create a dynamic form with bind variables :schema & :table_name

    My application has two LOV's, one to select a schema, and the next to select a table within that schema. I then have a button which passes me to a report which displays the data in that table.schema.
    I now want to create a link to a form where I can edit the record based on the rowid of that table.schema, but it doesn't appear that I can create a dynamic form where I pass the schema.table_name and rowid. Is this possible? Can anyone advise how I can do this? The form builder only wants a fixed schema/table name.
    Thanks in advance.
    Stuart.

    Hi Stuart,
    In this sort of situation, you will need to be a bit creative.
    I would suggest a pipeline function called as if it was a report.
    Then you can pipe out the required fields.
    Since you will have a variable number of fields, you could use two of the multi row field names for your field names and values.
    Then after submit, you can create your own procedure to loop through the fields (stored for you in the Apex package) and update the table as required.
    Not very specific I'm afraid, but it should work.
    Regards
    Michael

  • Adding Controls dynamically in the Infopath/Web form with dynamic controls

    Hello,
    The client requirement is to create SharePoint solution for the below image. A web form/Info-path form will be created where user can enter the details and data will be submitted. I am looking for a solution to implement the requirements in SharePoint .
    if not possible then using customizations and SQL server.
    User can enter the Title , Overview in the form , which we can make Single line and multiple line of Text. The problem is with third , fourth and fifth fields.
    1) In third field , i.e. Qualification Summary , User can add/delete , dynamic text boxes..This can be achieved I think using repeating tables/sections in Infopath...How data will be saved in SharePoint columns as it is not fixed that how many
    columns user can enter , how columns(static) will be created in the list ??
    2) For fourth field , user will select one or many Project description title n descriptions which are there in the system..User will not write anything just select..But how many project descriptions they can select , again its not fixed..How
    we can manage it in SharePoint List OR any custom solution  ?  
    3) For fifth field , user will select one or many Awards which are there in the system.User will not write anything just select..But how many awards they can select , again its not fixed..How we can manage it in SharePoint List OR any custom
    solution  ?  
    Vipul Jain

    >Lets say , the data for user selection is stored in two separate lists
    secondary data connection is only for one list so you can get data from only single list by creating list connection. Later you can drag & drop that connection as repeating table or bind with any control so display in form. If you have mulitiple list
    then you may use lookup column or would need to create two seperate data connection.
    >Do you think its a right approach ?
    multi selection listbox is helpful if requirement is select multiple records or filter records. You can almost achieve most of the requirement but still depends on business need. Ofcource some limitation is also there.
    >I'm planning to propose a custom .net form
    Of course custom form is always better than OOTB in some cases but i always prefer OOTB solution if my requirement is being achieved by it.
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Is it possible to update multiple tables with a dynamic form?

    I have columns from two tables populating a dynamic form. I am trying to have the form update both tables on submit. I have tried both a linked transaction and a custom transaction but I am not making progress. Only the master table is being updated. Is it possible with ADDT to update two tables with a dynamic form?

    I meant
    SXMSMSTAT
    SXMSSYERR
    Thanks.

Maybe you are looking for

  • Transport request for ABAP OO Class

    Hi, I have created a class with multiple methods and saved into one TR. Now under the TR contains task and under the task contains ->Class (ABAP Objects)     ZCL_VRL_ZCFA_CLASS =>This is normal and fine. Now I have created new class with 3 methods bu

  • How to make iBooks available in iBookstore for Sri Lanka and India?

    Does anyone know how to make iBooks available for purchase in iBookstore for Sri Lanka and India?  I have tried going through iTunes Connect to add regions, but it doesn't give me the option to add any more.  Thanks

  • Configuration for tolerence group for vendor invoice.

    Hi experts, For internal controlling purposes, tolerence group for vendor  invoice posting required, high value of the invoices can be done  by authorised persons only. How to configure . J.Francis

  • Soundtrack Pro 3 training

    I'd like to get some basic training in Soundtrack Pro 3 that could get me started as a novice. I've cracked opened Soundtrack a few times and played around with it, but I really didn't know what I was doing. I know some stuff about working with sound

  • Signing into iCloud constantly

    Every time I want to send a text or an email (an any of my email accounts), I'm asked to sign into iCloud with a password. If I sign in with the correct password, it lasts until my phone screen powers down. Then the next time I want to send a text or