Saving Form Data From GUI

I have a GUI which aims to save client's details (Name, Address and Phone No) for an estate agency. There are two types of client: Buyers and Sellers and am trying to get the clients details saved into the appropriate class depending on which client type was selected on the JFrame. I have two packages:
*uwePropertiesDomain
*uwePropertiesUInterface
uwePropertiesDomain contains the following classes:
*Buyer
*Seller
uwePropertiesUInterface contains the following class:
*uwePropertiesUI
I have written the following code for the submit button on the JFrame:
private void submitButtonActionPerformed(java.awt.event.ActionEvent evt)
    if (evt.getSource() == submitButton)
        if (((String)clientTypeBox.getSelectedItem()).equals("Buyer"))
            uwePropertiesDomain.Buyer buyer = new uwePropertiesDomain.Buyer();
            //String[] clientInfo;
            buyer.save(new String[]{nameField.getText() , addressField.getText(), phoneField.getText()});
        else
            uwePropertiesDomain.Seller seller = new uwePropertiesDomain.Seller();
            //String[] clientInfo;
            seller.save(new String[]{nameField.getText() , addressField.getText(), phoneField.getText()});
    } And the following in Buyer/Seller classes:
String[] clientInfo;    
public void save(String[] args)
   this.clientInfo = args;
}This all compiles, however, where is the data saved to? How would I go about searching for a client using their name?

In your class, define a List such as ArrayList (easier than an array--you don't need to know the number of objects ahead of time).
List buyerList = new ArrayList();
List sellerList = new ArrayList();Then, in submitButtonActionPerformed, say:
uwePropertiesDomain.Buyer buyer = new uwePropertiesDomain.Buyer();
buyer.save(new String[]{nameField.getText() , addressField.getText(), phoneField.getText()});
buyerList.add(buyer); // ADD THISAnd similar for seller.
You may want a Buyer constructor that takes those three values, instead of having to call "save" separately.
Now, you'll have a list of buyers and sellers, and you can perform searches on them (look up Comparable, redefining .equals/.hashCode, Comparator, etc.).

Similar Messages

  • Send form data from Coldfusion to ASP

    I need to send form data from CF to ASP.
    I submit a CF page and validate it on my end with another CF
    page, which then needs to post the results to an asp page on
    another site. The post has to be sent via SSL and I don't need to
    and cannot receive any status message back from the remote ASP
    site. Any suggestions would be greatly appreciated. I was thinking
    some type of cfhttp, but I am not very familiar with its usage.
    Thanks!

    It doesn't matter what type of page you are sending to as
    long as it can handle the data that is sent. Either a form or
    cfhttp will work.

  • How we can populate the form data from 2D barcode

    Hi All,
    Can anyone tell me how we can populate the form data from 2D barcode, will this can be done through script(javascript)?.
    Thanks & Regards,
    Faisal Afzal

    I was hoping someone could put me in the right direction here. I am basically doing the same . I am decodeing the information stored in a 2D Bar code and sending this information to an XML file, then I am trying to combine that xml file with a blank PDF template but the process is failing beacuse there are some additional tag fields the XML data from the  Decode->Extract XML process.
    The XML file from the decode process gives the structure below..notice therer some extra tags (lines 2- 4)
    <?xml version="1.0" encoding="UTF-8"?>
    <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">
    <xfa:datasets>
    <xfa:data>
    <form1>
    The XML structure that is expected by the PDF template is as follows
    <?xml version="1.0" encoding="UTF-8"?>
    <form1>
    So the xml output of the Decode barcode + Extract XML process has three extra lines of tag. Is there a way I could use a process within liveCycle to clean out those three lines in real-time before sending the xml to be recombined with the PDF template.
    Thanks

  • Is their way to prevent a form data from being lost when a validation fails

    Is their way to prevent a form data from being lost when a validation fails?

    So I would use APEX_COLLECTION (there is some information in APEX documentation).
    Read all data you need to keep after submit and save them to your collection. Then, if validation fails, show report with data not from base, but from your collection. You have to create process, which creates collection, and you need to modify your report definition to get data not only from DB but also from collection.
    If you have any questions feel free to ask.
    Regards,
    Przemek
    Edited by: Przemek on 2009-01-10 17:47

  • Saving the data from an interactive adobe form

    Hi Gurus,
    I want to know how to upload the data from an interactive form (i.e the data sent by a person via email or URL.It is in XML format)  into the SAP database.
    Thanks,
    Raj

    Hi Vaibhav,
          I have designed an the interactive form which works both online and offline.In offline scenario when i am uploading the form the data form fields which has cardinality 1:1 are being fetched but how wil i fetch the data for the node of cardinality 0:n. i have used the code :
    node = document->find_from_name( name = 'attr' ).
    attr = node->get_value( ).
    attr is the attribute name of some node named node_info.
    When i use this code it fetched only the first line of the table i.e only the first value.
    How will i fetch the values for rest of the rows.Can u please guide me on this
    will reward points for sure.
    Thanks and Regards,
    srividya.

  • Saving the data from two info path forms in to a single list in share point 2010

    Hi ,
    I have two  info path forms are in share point page FM 1 and FM 2.
    In FM 1 I am getting data from lists by using drop down and casket drop down  and FM 2 i need to enter manually after entering
    i want to save both forms information(FM 1 & FM 2 ) in to a single list of  share point 2010
     If any knows the solution please reply me  
    Thanking You,
    Arun Darly

    Hi,
    Based on your description, my understanding is that you want to save the data from two info path forms in to a single list in share point 2010.
    We can't save the data from two info path forms in to a single list, but we can
    save the data from two info path forms in to a single library.
    Open the  FM 1 and FM 2 in Infopath(you have save it Locally once).
    Publish the FM 1 and FM 2 as content types named FM 1 and FM 2.
    Add the content types FM 1 and FM 2 into a document library, Then you can save the data
    from two info path forms in to a single library.
    Best Regards,
    Lisa Chen
    Lisa Chen
    TechNet Community Support

  • How to copy form data from one pdf to another?

    Hi,
    I have created a pdf, added form data to it. Saved the form data as a fdf file - all good.
    I've updated the document and saved as a new pdf and would like to load the fdf data into it.
    So I select tools - forms - more forms options, and press the "import" function  - it goes grey and nothing happens.
    If I re-open the document the import function remains greyed out.
    I can find no way to import this data.... any ideas?
    I've tried going into form edit mode - adding a new field.  The import option is no longer greyed out so I click it and can select the fdf file hit open and ... the dialogue disappears and nothing happens.
    Is my Acrobat XI 11.0.07 badly installed - or what?

    You need to learn about the different types of PDFs. PDF/ A is an archive format that does not allow changes. PDF/X is used for graphics exchange
    For forms I would use only the PDF with a target version. Do not use the Optimizer feature.
    Forms always become larger due to the need to include the font for the various form fields. You might have to review the type fonts used by the form fields and one standard font as much a possible.
    It is possible to use the FDF file to move field values from one PDF to another.
    If you are trying to replace the underlying content and keep the form fields, use the replace pages.

  • PC users can't save PDF form data from form created on Mac

    I'm trying to create a PDF form for a client that will be accessing the form on a PC. However, when the client opens the form, a message appears saying that any data filled in the form cannot be saved and the document must be printed. If the client tries to "Save As" a message appears saying the form will be saved without the data. This defeats the whole purpose of using PDF forms.
    What can I do to allow my client to save data in the form? When I check the permissions on my end, there is no security and no restrictions.
    Developer environment:
    Acrobat 9 Pro
    OSX Snow Leopard
    Client environment:
    Windows 7
    Acrobat Pro X

    Thanks for the quick response, Karl.
    The client downloaded the trial version of Pro X, to verify that the form works before buying. Would the trial version impose restrictions?
    The client does not want to store data on a server. He wants the form to function as a template that he can save-as to customize. The completed forms will be shown on the computer as a part of a presentation, sometimes without Internet access.
    I tried using the Advanced > Extend Form Features options to enable to ability to save form data, but when I tested the PDF on my PC (Vista, latest version of Reader) I got an error message along the lines of "this document has been modified from previous version, please get a copy of the original" and all form fields are gone.
    I'm currently downloading the trial of Pro X so I can test the PDF.
    I am also using a Javascript to allow the client to place photos in the document. This is achieved using a button with a Javascript attached to it: event.target.buttonImportIcon();
    This works correctly in my environment, but could it be screwing up the file as it's opened on a PC?

  • Automatically Saving Form Data

    Hello,
    I'm looking for a way to automatically save the user input in background while the user is filling forms. I've had cases where the user is filling out large forms and when they accidentally closes the browser without "submitting the form", navigate away from the web page or the browser crashes only to find that all their data is lost. I've noticed if you submit the page without saving the data is cached/saved. I would think a technique to submit the page without the window refresh could work but not sure how that would function in APEX. Does anyone have any suggestions?
    thanks!
    Randy

    You have to work with javascript to do this.
    Register an onchange event to each input field and use an Ajax call to a plsql procedure that saves the item value in session state.
    Use this call:
    APEX_UTIL.SET_SESSION_STATE (
    p_name IN VARCHAR2 DEFAULT NULL,
    p_value IN VARCHAR2 DEFAULT NULL);
    Create an application process (on demand) that uses this call to save the item value, and call the application process using the url syntax with an Ajax call.
    I prefer using Jquery (See Jquery.com) to do such things, but you can use the Apex library function htmldb_Get to do this too.
    Will this work for you?
    Regards Guido

  • Javascript for exporting form-data from spawned pages in csv-table

    Hello,
    I need your help with a problem concerning acrobat.
    I created a form. The user can spawn new pages from a template.
    The fields have the format Pn.templatename.fieldname, for example: P0.form.kosten1
    The user fills the form, saves the file and sends it to me.
    Now I have to get a CSV- or Excel-Table from this Data.
    The Export-Function doesn't work, because of the different fieldnames.
    Does Javascript work?
    Perhaps I can create a 2-dimensional array and then write it to a csv-file??
    Has anyone a good Idea?
    Thank you for helping.
    Many greetings,
    Thomas

    The only way I've found to do this is to open the form in Acrobat, click Forms, mouse over Manage Form Data, then click Export Data. Your only options are to save as .xml or .xdp. I saved my data as .xml. I was then able to import the .xml file into excel by clicking Data, mousing over xml, clicking Import... and browsing to the Acrobat generated .xml file. I know this is convoluted but it's the only way I've found to get the data into a spreadsheet. Acrobat exports the data as filename_data.xml, i.e. a form named contacts will export it's data as contacts_data.xml. Be aware, I've only tested this on a form that had a table in it and nothing else. If your table is part of a form with other fields in it I have no idea how the other data will look after exporting.

  • Saving array data from a waveform chart

    I am using a CRIO 9004 and a 9237 bridge module to measure some strains from strain gauges. I've got one timed loop that reads the DMA FIFO and puts the arrays of values (16 data points, 4 per channel) into a queue. In the consumer timed  loop a For loop scales the binary data, auto indexes it into arrays, then the arrays are merged into a 2D array for the four channels  displayed on a waveform chart . Everytime the consumer loop runs it indexes 4 data points (per channel) yet the waveform chart plots them in a consecutive manner and doesn't overwrite the previous four. If I convert the arrays to waveform arrays I don't see anything on the waveform chart.
    If I pass the 2D array of data to a array indicator inside or outside the consumer loop I get only 16 data points. I want to save the information that appears on the waveform chart  after the consumer loop but because I'm not using waveform data type I can't use the write waveforms to file vi. The waveform chart history buffer has been set to 195360.
    Idealy we will run the four channels for 120 seconds charting the data and saving the data. The minimum data rate is 1613kS/s (403 per channel) The data can be saved after the loops have finished gathering and processing or while they are running. I noticed when I tried to write to TDMS it slowed the consumer down. Same thing if I use a shift register with the volume of data.
    I suspect I'm not sending data to the chart in the correct manner ( usualy takes two attempts to "clear chart" using shortcut menu).  I'm not too familiar with timed loops /producer consumer loops  and just tried to put something together based on examples.
    I've attached my host vi and front panel screenshot.

    Hope they appear attached this time.
    Attachments:
    Basic DMA (Host).vi ‏444 KB
    screenshot2.jpg ‏113 KB

  • Passing form data from html page to JSP page

    Hi,
    I have a simple HTML page with a form on it that sends the information to a JSP page that stores the form data in a JSP session. I created a simple form that asks for the user's name, sends it to the JSP page, stores that in a session, then sends it to another JSP page which displays the name. This worked fine.
    However, I added another input box to my form that asks for the user's age to do the same steps as outlined above. This does not work, and I'm not sure why. Here's the code from my HTML page:
    <form method=post action="savename.jsp">
    What's your name?
    <input type=text name=username size=20 />
    <p />
    What's your age?
    <input type=text name=age size=20 />
    <p />
    <input type=submit />Here's the code from my JSP page, savename.jsp (later on in the JSP page it links to another page, but that is not relevant):
    <%
    String name = request.getParameter("username");
    String age = request.getParamater("age");
    session.setAttribute("theName", name);
    session.setAttribute("theAge", age);
    %>Finally, here is the error message from Tomcat 6.0.9:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 3 in the jsp file: /savename.jsp
    The method getParamater(String) is undefined for the type HttpServletRequest
    1: <%
    2: String name = request.getParameter("username");
    3: String age = request.getParamater("age");
    4: session.setAttribute("theName", name);
    5: session.setAttribute("theAge", age);
    6: %>
    Stacktrace:
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)I do not understand the error, as it works fine when I simply try to retrieve "theName", but breaks when I try to retrieve both.
    What is it I am missing here?
    Thanks,
    Dan

    Ummm.... you misspelled "parameter" the second time
    you tried to use it.......
    That is incredibly embarrassing. Sorry if I made anyone think it was something more serious. Holy mackerel, I think it's time for me to read over my code much more carefully before posting about a problem.
    Thanks for the help DrClap.

  • Best practice: Saving form data

    Hello,
    I'm new to the JSP technology.
    To get some experience I built my own little shoutbox "application" where you can insert your name and a message and if you click on "submit" your message appears at the top of the page. Older messages also appear below the new message.
    For this, I created a little JavaBean which handles the entered name and the message. I called this class "Message".
    To read the messages out of the database I created another class (MessageHandler) which returns an ArrayList of objects from the Message class.
    I don't know if I'm doing this the right way, but I use this MessageHandler as a JavaBean so that I can do this:
    <jsp:useBean id="handler" scope="session" class="net.stiefels.myshoutbox.MessageHandler"/>
    <jsp:setProperty name="handler" property="limitMessages" value="2"/>
    <c:forEach items="${handler.messages}" var="msg">
         ${msg.text}<br/>
    </c:forEach>The next step is, "how to save new data?".
    With my current experience in JSP I found this possibility:
    Save the form data in a "Message"-Bean and use a MessageHandler method (e.g. setNewMessage) to save the data in the database. The code would then look like this:
    <jsp:useBean class="net.stiefels.myshoutbox.MessageHandler" id="handler" scope="session"/>
    <jsp:useBean class="net.stiefels.myshoutbox.Message" id="newMessage" scope="page"/>
    <jsp:setProperty name="newMessage" property="*"/>  // save form data
    <jsp:setProperty name="handler" property="newMessage" value="${newMessage}"/>  // save Message-Bean in databaseMy question now is if this way is the normal procedure to save form input in a database?
    If not, which way would be a better one?
    Thanks a lot!
    Simon

    I never use that approach
    Simple pages
    When I submit I have a servlet or Struts action that does the insert and then redirects/forwards to the submitting JSP , this JSP will then requery DB.
    More complex
    Always start with Struts and store all information on the Struts actionform.

  • Copying Appraisal Form data from Old to New..

    Hi,
    My client has been using an Appraisal template since last year and all the users keyed in their data already.Then they wanted some minor changes in the existing Appraisal form.We have created a New Template.
    Now my Client wants to Copy all the old forms data to New Form.They are not interested to ask the users again to Key in all the data.Then want to copy the old form data to new.Is it possible to copy the Old Form data into NewForm ?
    Is there any std way to download & the upload the records?
    I tried to Record(SHDB) the App_create Trnx,But it's not recording the Textarea Subscreens.
    Im using SAP4.7 and HR Extension 2.00 and using HAP_DOCUMENT BSP Application in my Portal.
    Rgds,
    Jothi.P

    my complaining has nothing to do with you disturbing. I think its the heat in India, still not used to it
    In later releases it will be the same. Our design is just this way. You can't copy appraisals, and you can't change released templates. Those are conciously made design decisions which I still stand to.
    From a business point of view it just needs a different approach. Your current situation is not an exception. Here is how I have seen other multinational companies with a global roll-out handle it.
    They setup the appraisal process for a year, say for 2005. They start gathering the suggestions/complaints from employees/management and start discussing internally on the possible changes in the process. Then they implement a new template and make this available for the new round in 2006. The old template they put in "in history".
    So, they stick to the process they have initiated and start with an approved template with the new round. This then does not disrupt the current process, avoids "bad" quick fixes and gives HR the time to test the new process.
    For now, try to create the "copy" report but I would also inform the client that the above process would be the better one on the long run.
    Also from an employee and manager point of view it makes more sense as the process they started doesn't change without them knowing what or why.
    Regards and Groetjes,
    Maurice

  • Print / Export form data from Visual Composer

    Hello everybody,
    I want to print data from a visual composer form (export to PDF and print afterwards is another option). I am using CE 7.1 EHP1.
    Is there any tutorial for that?
    I only found this one [Exporting Data|https://wiki.sdn.sap.com/wiki/display/VC/Exportingdatafrom+VC]. But this is not the right one for me. Printing from a table is no problem, but I want to print data from several forms.
    How can I export the data to an adobe interactive form?
    Thanks ahead

    Hello Bernd,
    Unfortinatelly, there is no way to Export and Print from the Form View Interactor (This is ALV feature, not VC and they support only the Table Interactor)
    From the VC side, you can add the Button to the Form View Toolbar with the Print Action, but in this case, the whole application will be printed
    Best Regards,
    Luba

Maybe you are looking for

  • Why i can not synchronous transmission in my ipod touch?

    after i used others ID download the date my touch did not synchronous transmission,how can i do?thank you.

  • Contract item not appearing in Shopping cart sourcing

    Hi Team, I created a contract from External Catalog that has  Description and Product Category, but no product ID for the item selected. Now, I created a Shopping cart from the same catalog. I need this Contract to appear in the Sourcing area of the

  • How to pick the wage type (repeat structure) in pa0008 infotype and Pa0014.

    Hi all.      Iam writing code we pick the data from Pa0008-lgart Pa0008-brt01.     these two field are repeat structure.    here iam given code what we writen. select pernr           lgart           betrg             from pa0014             into tabl

  • Viewing lock

    I want to use CATBLOCK.SQL in PL/SQL to display locking information. now, I'm in C:\oraclexe\app\oracle\product\10.2.0\server\BIN but CATBLOCK.SQL and UTLLOCKT.SQL are in C:\oraclexe\app\oracle\product\10.2.0\server\RDBMS\ADMIN I use "HO cd" to chang

  • Authorization Quotation based on status

    Hello, we would like to control based on the status of an quotation if the quote can be deleted or the status be modified. (e.g. if status = approved, the quote should not be deleted) Second we would like to restrict the status of a quote to be chang