Populating a form with data from Array

I have results from a query getting passed back as an array
object. Is there an easy to assigned to values of the array to
objects within a form container. Currently, i am doing
mytext_txt.text = $myArray[0]["text1"]
If there are like 40 objects in a form, its seem kinds of
repetitive
Any ideas would be awesome. How would using a model help in
this case? Can you bing results to a model?
Thanks

I use XML and receive it into an Object - pretty convenient
because you get proper properties rather than just positions.
I'm not sure I exactly understand your example - do you have
'records' as elements in the array, and each 'record' is an object
with named properties? or do you have an array in which each
position relates to a single property.
Assuming the latter, a possible way to do this is to create a
.as class file with all the properties you want in the same order
as you have them in the array. Define a constructor that accepts
your array as input. Then loop through the properties and assign
them from your array:
function MyModelClass(myArray:Array){
var i:uint = 0;
for (var property:String in this)
this[property] = myArray[i++];
I haven't tried this, but should work.
If the array is an array of objects, just do this:
[Bindable]
var myObject:Object;
myObject = $myArray[0];
Then in your mxml,
<mx:Text id="mytext_txt" text="{myObject.text1}"/>
Another option is to write some script that follows the
container hierarchy, and for each control in the hierarchy, inspect
the id (or name if you prefer), and check
if ($myArray[0].hasOwnProperty(whatever.id))
(whatever as Text).text = $myArray[0][whatever.id];
hope something there makes sense.

Similar Messages

  • Prepopulating PDF Fillable Forms with data from XML files

    How can I get a PDF fillable form to open pre-populated with data from an XML file automatically? I've been using Adobe Standard 9.0 and am willing to upgrade in a modest fashion if necessary. I am aware of the Navigation method > Forms > Manage Form Data > Import Data. This works fine, however, my users are not smart enough to do tis much clicking and selecting. Is there an automated way to have this XML data merged into the PDF file on the fly. These files will reside on an internal local area network and will be operated on local PC's that will probably have Acrobat Reader ONLY. I have been told that the only way to accomplish this is through Java Scripting. I would prefer to do this the 'old fashioned' way of command line switches, but that does not appear to be an option. Does anyone have a sample Javascript that would accomplish what I am trying to achieve. Any help would be greatly appreciated.

    Hi Sharon
    The easiest way is:
    - Open your PDF form within Acrobat
    - From the File menu, import the XML form data into the form
    - From the File menu, use Save As... to save the file with a new name.
    The new PDF will be identical to the original one, but will have the data embedded in it. Voila.
    If you want the same form to pre-populate with different XML files depending on the circumstances, or if you're generating the XML on the fly, then things get more complicated. (And more expensive.) As your consultant said, LiveCycle Forms is one option, but it is expensive (actually even more than 10K). There are other options, including Cold Fusion, custom servlets, etc.
    Howard
    http://www.avoka.com

  • Prepopulating PDF forms with data from XML file

    How can I get a PDF form to open pre-populated with data from an XML file automatically? I've been using Adobe LifeCycle Designer 8.0 and there doesn't seem to be a way to do it. The closest I came was to use the ImportData method, but that only lets you specify a data file if the form is signed (certified), which these aren't and don't need to be because we're using them on an internal company web page. ImportData works if there is no file name, but then the user has to navigate to and select the correct file, which we can't rely on our users to do.
    I've researched this problem for days on this and other websites and haven't found an answer (one Adobe advisor suggested purchasing LifeCycle Forms, which is not an option because it's a $10,000 software package and the company wouldn't authorize a purchase that steep). We will buy a less-expensive option if there is one. We'll even hire a consultant if we can find one to who can design a supportable solution. All suggestions will be much appreciated.

    Hi Sharon
    The easiest way is:
    - Open your PDF form within Acrobat
    - From the File menu, import the XML form data into the form
    - From the File menu, use Save As... to save the file with a new name.
    The new PDF will be identical to the original one, but will have the data embedded in it. Voila.
    If you want the same form to pre-populate with different XML files depending on the circumstances, or if you're generating the XML on the fly, then things get more complicated. (And more expensive.) As your consultant said, LiveCycle Forms is one option, but it is expensive (actually even more than 10K). There are other options, including Cold Fusion, custom servlets, etc.
    Howard
    http://www.avoka.com

  • How can I pre-populate a web app input form with data from a webform in the CRM?

    Scenario:
    A customer fills a registration webform. The customers data is stored in BC CRM as usual. This step provides a lead to marketing unit and the team makes a follow up. Upon completion of internal processes. The workflow initiated by this customer filling the registration form is approved.
    Th user is sent a 3rd-party notification with a url to enable the user complete the registration process by entering the information into a web app.
    The Issue:
    The client is requesting that he doesn't want the the customer to re-enter some of the  information that  has been captured in the registration form again since it will be laborious for the user to do this. He wants the system to store this customer data already in the CRM and pre-fill the web app form so that the user just submit the data, so that the item can be in the appropriate web app as web app item.
    Question: Is this possible? Can this be achieved via js. How should I go about it.
    Your assistance will be appreciated.
    Thanks.

    For each option you would need to only have a custom text field for that item. This is where the otpion for each gets populated with javasript.
    Each option is your own html that is a select with options as web app items. A list layout of your web app items is just a select with text and value of that item.
    Your tricky thing is to setup the matrix of rules to define what shows and when. You can do that with data source association between web apps if it is a 1-1 relationship but if it is 1 to many you need to form script matrix to define what happens on each change.
    It depends on the details but thats the core of it.

  • How to populate Adobe LiveCycle Designer generated  PDF Forms with data from Database in Windows app

    Hi
    I have a PDF template designed in Adobe LiveCycle Designer. This template has form fields which needs to be filled with data programmatically. I am using windows application in C#.Net 2005 in which I want to retrieve data from database and merge this data into PDF form in respective fields.
    How this can be achieved?
    I searched a lot & I found that we can process the XDP file generated from PDF to acheive this. I created the XDP file out of the PDF template created in designer. But I don't know how to merge data from database into that XDP file in respective fields and again convert this XDP file back to PDF programmatically. Can anybody help me ? This is urgent.
    Thanks in advance.
    Sambhaji

    Please ignore the above code.<br />The following one is correct one.<br />using System;<br />using System.Data;<br />using System.Configuration;<br />using System.Web;<br />using System.Web.Security;<br />using System.Web.UI;<br />using System.Web.UI.WebControls;<br />using System.Web.UI.WebControls.WebParts;<br />using System.Web.UI.HtmlControls;<br />using System.Text;<br />public partial class _Default : System.Web.UI.Page <br />{<br />    protected void Page_Load(object sender, EventArgs e)<br />    {<br />        Response.ContentType = "application/vnd.adobe.xdp+xml";<br />        StringBuilder responseString = new StringBuilder();<br />        responseString.Append("<?xml version='1.0' encoding='UTF-8'?>");<br />        responseString.Append("<?xfa generator='AdobeLiveCycleDesigner_V8.0' APIVersion='2.5.6290.0'?>");<br />        responseString.Append("<xdp:xdp xmlns:xdp='http://ns.adobe.com/xdp/'>");<br />        responseString.Append("<xfa:datasets xmlns:xfa='http://www.xfa.org/schema/xfa-data/1.0/'>");<br />        responseString.Append("<xfa:data>");<br /><br />        responseString.Append("<form1>");<br />        responseString.Append("<TextField1>Homer</TextField1>");<br />        responseString.Append("<TextField2>Simpson</TextField2>");<br />        responseString.Append("<field name ='DropDownList1'>");<br />        responseString.Append("<items save='1'>");<br />        responseString.Append("<text>1</text>");<br />        responseString.Append("<text>2</text>");<br />        responseString.Append("<text>3</text>");<br />        responseString.Append("</items>");<br />        responseString.Append("</field>");<br /><br />        responseString.Append("</form1>");<br /><br />        responseString.Append("</xfa:data>");<br />        responseString.Append("</xfa:datasets>");<br />        responseString.Append("<pdf  href='C:\\Test.pdf' xmlns='http://ns.adobe.com/xdp/pdf/' />");<br />        responseString.Append("</xdp:xdp>");<br /><br />        Response.Write(responseString);<br />        Response.Flush();<br />        Response.End();<br />    }<br />}

  • Save form with data from a field

    Hi,
    Is there an option to save the form with the data from one of the fields?
    Example:
    form field "Name", user enters Will William.
    Can I use this to autmatically save the form in the end as "Will William" and choose the save location?
    Thanks

    That's possible, but it requires privileged JavaScript code. This means code that's either in a folder-level JavaScript file or in a certified document that is trusted to execute privileged JavaScript. For more information, see the following tutorial: http://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript

  • Populating InDesign templates with data from Excel or XML?

    I have a client who does a weekly catalogue for computer parts. It’s very detailed and extremely time consuming, and we are looking at moving it to an automated InDesign workflow to save time and money in production. Once imported into InDesign, the resulting file can be exported as a formatted XML document to a webpage for auto formatting.
    I know you can import XML directly into InDesign and vice versa. I have created some categories and tables in Excel and exported this as an .xml document. When I import that document into the View > Structure panel, it displays a whole list of attributes but not the actual text I was after.
    Any help much appreciated. I’m using InDesign CS4 and doing some research on google at the moment.

    Hi CDesign2,
    If I understood you correctly, you are either trying to
    View your xml data in Adobe LiveCycle form to redit the form???
    View your xml data in Adobe acrobat pro
    Or wishing to collate updated(new) data into adobe (lifecycle) tracker and view the data set
    I suspect points 2, 3 may be the case.
    My experience with migrating excel data back to adobe is this.
    If you created the original form with adobe, you have the option of distributing the form (file/form distribution..)
    to recipients list (could include form creator).
    This allows adobe to generate a distribution and form response file and therefore able to track returned forms either as pdf (preferably) or excel/xml converted back to pdf after saving it.
    For Point 2 above,assuming your original data set were created using an adobe form you previously saved, open your original form in acrobat pro, go to menu/forms/manage form data/import data (usually as xml). It automatically repopulates the form.
    OR
    To view returned forms as a set, go to menu/forms/compile returned forms and this will bring up a window that
    requires you
    -to browse and locate your response file (essentially defining the index form),which is opened into the top row
    -then find and add each new completed form into a list in the second row.
    You then click ok and all returned forms are opened in a tracker window...
    I just realised I am talking about liveCycle ES version8 and this forum refers to pre ES!
    I am not sure if this helps but I hope it answers some of your questions.

  • Populating a table with data from javascript

    I have a CFC that returns (via ajax) an array with a length anywhere from 1 to n. I need to display the contents of that array on a webpage in a table (one row per array element). Since I do not know the length of the array, what would be the best way to render the table? My first thought was to build the table inside a string variable and then use jQuery's html() method. I also considered using ColdFusion to format the table in the CFC and pass that back to the ajax call. Either way seems very tedious. Was wondering if there is a better way.

    Design Patterns can help when you are faced with a decision like this. Take the Model-View-Controller pattern, more commonly known as MVC. It tells us that the server should restrict itself to business logic, hence to business code. An example of business code is a CFC that returns data in the form of an array.
    To display the data as a table requires presentation logic and presentation tools. That responsibility usually falls on the client. The browser is typically the client equipped to render the data in visual form.
    You could, for example, get the CFC to return an array in the default JSON format. The client could then use jQuery to convert the JSON array into a table. A quick search on the web produced the following jQuery tools: datatables, jqGrid and jsonTable.

  • Problem populating html form fields with data from database.

    I'm using a straight forward piece of code to populate a form with data from a database, to create and 'edit record' page. The code is as follows;
    TO RETREVE THE DATA FROM THE DATABASE;
         $query = "SELECT * FROM $table WHERE newsletter_id = '$newsletter_id'" ;
         mysql_select_db($database) ;
         $result = mysql_query($query, $connect);
         $numRows = mysql_num_rows($result);
         $dbnewsletter_title = mysql_result($result,$i,'newsletter_title');
    TO POPULATE THE FORM FEILD;
    <tr>
              <td width="140"><p class="admin">Newsletter title</p></td>
              <td><input name="newsletter_title" type="text" <? print "value=$dbnewsletter_title";}?> /></td>
            </tr>
    However, when I view the page, the string shows in the text feild, but seems to be split at the point of the first space. So basically only the first word of the string shows in the text field. If I try to print '$dbnewsletter_title' outside of the table, the string is shown in full as it should be.
    Does anyone know what is causing this problem?
    Many Thanks

    Put the value in quotes:
    <?php print "value='$dbnewsletter_title'"; ?>

  • Make readonly pdf with data from forms

    Hi there,
    I really appriciate any help on this issue...
    I am not able to make read only file with data from the fillable pdf forms.
    Requirement is my client need some form where they can enter some data and make a read only file from those forms and send them to their clients.
    So I made fillable form in acrobat and send them, they will use reader to fill up the form but I dont know how to save those file with data so it will become just a document.
    is there any way ?
    Thanks....
    -M.

    I am soory I am slow...
    I made form file in acrobat... but after that my client is going to use reader and enter data to this forms and saves it. and then my client is going to send them to their customers.
    So I shall use reader code and make all fields read only right ?
    In this case I have to make a button and run this code on submit ?
    Thanks.
    -M.

  • Pdf form for data from another form with data, xml or pdf, tables not expanding

    Sir,
    I am using Adobe Acrobat 9 Pro and LifeCylce to do these forms. I have made several subforms for a Risk Assessment for the mission they fly. I have also made up another form with tables that would connect with each subform data. This form also will give me and others a % of the values received from the data to help us with seeing problem area towards Safety.
    I am able to connect the data to the form from the Risk Forms but when I go and add another group of data it over writes the data that was already in the data collection form. The tables are dynamic and able to expand with the generated data but when I compile several Risk Forms, xml. data into one single data group, the receiving tables will not except this data. To compile the data I am in Acrobat and using the form-manage form data-merge data to spreadsheet than enter as a report that is xml. Still not working. I also tried to save the form, with data already in the tables, and then opened it again and add data to it, it will over write the existing data in the form. This form does work great with the generated data in LiveCycle.
    Any suggestions???

    Thanks Paul
    Did as you said and for each subform binding tab made sure I have "Repeat subform for each data item" checkbox and still no change when I add the data.
    I even tried to combine the xml data and that file just has the main page and not the data pages. just another problem that is happening.
    Any other suggestions on this expanding tables and receive single forms one at a time.
    Bill

  • Writing data from array to file

    May i know how to write string from a array into a file.
    I have use string tokenizer to extract every line from a file using readline and use stringtokenizer to spilt the line using tab delimiter for processing.
    But if i want to write data from array to file with tab as a delimiter and how to go to the next line. How do i do that. Below is the task and i have state a simple example on a array i have and the file output that i want.
    Pls advice.. Thanks
    eg of a array
    array[0] = Data
    array[1] = One
    array[2] = Data
    array[3] = Two
    array[4] = Final
    array[5] = Data
    From the above array, i want to write to a file so that it will appear something as below
    Eg textfile.txt
    Data One
    Data Two
    Final Data
    PLs attached a simple code as a example as i am only begining to start useing the IO feature in java. Thanks

    Really thanks for your help,
    but u are mentioning that i have already know the number of countters in advance , that is to say the 2 * counters.
    But is there a way to solve this problem which i mean if i dun know the number of predefined counters. Maybe i should say, there is more than 2 counters and in another situation, the counters will only be defined during runtime. Actually the solution u give will work nicely with 2 counters. but wat if the counter is more than 4, i wll have to concatenate the string a lot of time. so is there any solution around this problem. That why i am wandering if tere is any solution to write to the file when the counters can be only determined in runtime
    Pls advice on the above with a code samples if possible.

  • Can I use Visual Basic to covert form user data from multiple .pdf files to a single .csv file?

    Can I use Visual Basic to covert form user data from multiple .pdf files to a single .csv file?  If so, how?

    You can automate Acrobat using IAC (InterApplication Communications), as documented in the Acrobat SDK. Your program could loop through a collection of PDFs, load them in Acrobat, extract the form data from each, and generate a CSV file that contains the data.
    Acrobat can also do this with its "Merge Data Files into Spreadsheet" function, but this is a manual process.

  • Convert Adobe Form (with data) to Microsoft Word Document

    Adobe Acrobat 8.0 Standard
    Windows XP Professional SP2
    Microsoft Word 2003 SP3
    I am attempting to convert an Adobe PDF Form (with data included) to a Microsoft Word document.
    When I use the menu to attempt this, I get a Word document containing only the form fields.
    I want to be able to grab all the text from the document, as these forms were used to fill in information for Job Descriptions, and I want to submit the text to job boards (without having to retype anything).
    What are my options for obtaining this information?

    Bill:
    Thank you for all of your help. I do not have the program in front of me, so I don't have a means of independently verifying this, until I go see the user tomorrow when he returns to the office ...
    Just to confirm, a fillable PDF is different from a standard PDF, as it stores the form fields in a special way, likewise, the data is stored in a special way. This is actually a quite useful feature, for compiling data, if you use the form multiple times.
    A standard export of a fillable PDF exports only the fields.
    To get the data, I would have to choose to save form data.
    To get the fields and the data, I have to print it using a PDF printer to create a new PDF document. Once I create this new PDF document, I can then export to Word as desired.
    If I want ONLY form fields: (one-step process)
    Export > Microsoft Word > %filename%.DOC
    If I want ONLY form data:(one-step process)
    File > Save FORM DATA > FDF file format > %filename%.FDF
    If I want both the form and the data: (two-step process)
    File > Print to PDF > Save as %filename%.PDF
    Open %filename%.PDF > Export > Word Document
    Is this the process? Pardon my confusion, but I am a newbie, and I do not have the program to test with.
    Thanks for your help, kind sir.

  • Actionable Task form with data as an email in Human task implementation.

    Hi All,
    In one scenario in my project, I need to design an actionable task form with data as an email, and this email can be sent to specific users to actions ( like updating, approval, rejection etc). The users should be able to edit the data in email only ( not needed to login in BPM work-list). Please let me know if it is possible to design such task forms and how to push and receive data in email from user.
    Thanks,
    rps

    Hi, Check this below links,
    Send external email from within ABAP program.
    http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
    Sending mail with attachment.
    http://www.sap-img.com/abap/sending-email-with-attachment.htm
    Regards,
    Joan

Maybe you are looking for