Newbie:how to create a page with 4 textfields and send data to MySql DB

Dear all,
i have created a page called page1 with 1 submit button named 'submitButton' and 4 textfields named:
'date'
'item'
'contact'
'phone'
I have created a MySql DB table with the schema named 'association' and table named todolist3. Fields created in the table are :
'Date' - >INTEGER->Primary
'Item' ->VARCHAR(100)
'Contact' ->VARCHAR(45)
'Phone_contact' ->INTEGER
what i want to do is to send the data from the 4 textfields to the database when i click the submit button. Below is the code i out in submit button. please kindly help as i have tested different ways but none of them works. thank you!!!
public String submitButton_action() {
try {
if ( todolist3DataProvider.canAppendRow() )
String item1=(String)item.getText();
String contact1=(String)contact.getText();
Integer phone1=(Integer)phone.getText();
Integer date1=(Integer)date.getText();
RowKey rowKey = todolist3DataProvider.appendRow();
todolist3DataProvider.setCursorRow(rowKey);
todolist3DataProvider.setValue("todolist3.Date", date1);
todolist3DataProvider.setValue("todolist3.Item",item1);
todolist3DataProvider.setValue("todolist3.Contact",contact1);
todolist3DataProvider.setValue("todolist3.Phone_contact",phone1);
} else {
error("submitButton_action() -- cannot append todolist3 record");
} catch (Exception e) {
error("Page1::submitButton_action-- something's wrong trying to append todolist3 record");
return null;
}

Hi,
I think that you have forgotten to commit changes. Modify your code to look like this:
RowKey rowKey = todolist3DataProvider.appendRow();
todolist3DataProvider.setCursorRow(rowKey);
todolist3DataProvider.setValue("todolist3.Date", date1);
todolist3DataProvider.setValue("todolist3.Item",item1);
todolist3DataProvider.setValue("todolist3.Contact",contact1);
todolist3DataProvider.setValue("todolist3.Phone_contact",phone1);
// commit your changes !!!
todolist3DataProvider.commitChanges();
} else {
// ....best regards
Grzegorz

Similar Messages

  • How to create a page with LOV and a Go Button that calls a sproc

    I'm new to Apex but not Oracle. I've done some VB, C and other programming.
    I have read the 2 Day + and worked through most of the advanced tutorials as well as the Apex 3.0 ermployee task OBE. I'm looks for an OBE or assistance in doing the following:
    I need to create a page that has a dynamic LOV that pulls CUSTOMER NAME as d, and ID as r (this I can do).
    I need a button on the page "Go". Here's the use case.
    User selects a customer from the LOV
    User presses Go
    Go invokes myschema.go_sproc and passes in LOV selected Cust ID
    myschema.go_sproc does some work and passes back a Status
    Status is displayed to the user
    Any pointers are appreciated.

    Great.
    Two last questions:
    #1 Is there a Apex Reference, like the SQL Reference, that lists all the various settings and options and their meanings, for instance on the create region page there are many different region types. Is this information centralized in one place? I don't see (or I am missing it) in the list of Apex 3.2 books.
    #2 For my use case would you use a HTML region or some other type of region?
    Thanks again.
    George

  • How to Create a Page LOV Template and a Region LOV Report Template in APEX

    Hi All,
    Thanks in advance ..
    I am new to APEX , Currently working in APEX 3.2
    Can any one please guide me How to Create a Page LOV Template and a Region LOV Report Template in APEX
    So that I can create dynamic Multi column LOV in APEX
    Cheers
    Sachin

    Sachin,
    I think you are en-quiring about 'Custom pop-up page'. See this link. You will get all required info there.
    Regards,
    Hari

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • Is it possible to create a virtual TCP port and send data to it?

    Is it possible to create a virtual TCP port and send data to it?
    My application is this:   I am reading a constant stream of waveform data from a device via a LabVIEW VI set and I need to get that streaming data to a .NET application.  I can poll a TCP port in .NET easily so is there a way I can create a virtual TCP port in LabVIEW and send the data there?

    Have a look at the example called simple data server and simple data client and see what you can get from that. I'm not really familiar with TCP myself.
    Joe.
    "NOTHING IS EVER EASY"

  • How to create a page with check boxes

    Hello friends
    I want to create a page with 5 statements and 5 checkboxes. The next page will be displayed only if all the 5 checkboxes are checked.
    Can you please let me know how to create the page (could not find any template for this!) and how to control the display of the next page through checkboxes.
    I am on version 4.7 of R/3 and EP 6.0.
    This is urgent, prompt reply would be greatly appreciated.
    thanks
    pomila

    Hello Michael
    Thanks for your prompt reply, your answer was indeed helpful.
    Just another quick question, does EP 6.0 have any template/iview which we can use or it has to be done through coding only?
    thx
    pomila

  • How to Create a Table with Merge and partitions in HANA

    Hi,
    What is the best way to create a Table with MERGE and PARTITION and UNLOAD PRIORITIES.
    Any body can you please give me some examples.
    Regards,
    Deva

    Ok,
    1) the UNLOAD PRIORITY has nothing to do with the order of data loads in your ETL process
    2) Unloading of columns will happen automatically. Don't specify anything specific for the tables, then SAP HANA will take care about it
    3) Not sure where you get your ideas from, but there is no need to manually "flush" tables or anything like that. SAP HANA will take care of memory housekeeping.
    4) Partitioning and how to specify it for tables has been largely documented. Just read up on it.
    5) Delta Merge will happen automatically, as long as you don't prevent it (e.g. by trying to outsmart the mergedog rules)
    Seriously, I get the impressions that this list of requirements is based on some hear-say and lack of actual information and experience with SAP HANA. There are a couple of extensive discussions on data loading optimization available here in SCN and on SAPHANA.COM. Please read those first.
    All this had been discussed broadly a couple of times.
    - Lars

  • How to create a chart with x and y input arrays

    I am trying to create a chart that receives chunks of data from a while loop.  I know how to create a chart in order to append new data points to those points already in the display, but a regular chart doesn't let me specify the x axis data points.  Is there a way to create a chart with x and y array inputs?
    Thanx,
    Tom

    It's called an XY Graph. If you need an XY graph to behave like a chart, look at the shipping example called XY Chart.

  • How to create a playlist with podcasts AND music?

    I created a playlist with both podcasts and music in it. The thing is when I try to shuffle it, only music plays. When I start playing podcasts, none of my music plays. How can I make them both play at the same time and shuffle on the same playlist?

    In iTunes, you created a playlist (with songs and podcasts), and then synced that playlist to the iPod?  Or you manually created a playlist on the iPod, and manually added songs and podcasts to that playlist?  It needs to be an actual playlist that is on the iPod, not simply songs and podcasts on the iPod.
    If you have a playlist on the iPod....  In shuffle mode, only songs play.  Set the iPod to play-in-order (not shuffle).  Then, select the playlist on the iPod (by selecting Music -> Playlists from the Home screen).  With the playlist selected, press Play/Pause.  The playlist plays the song and podcasts in the order shown for that playlist in iTunes.

  • How to create a page that tests and then creates a valid DB LINK connection

    The problem is that I'd like to create a page that has all the necessary fields (name, host, port, etc) to create a database link just like the one in the SQL workshop - I'd prefer to have it done this way so as to limit the users from using SQL workshop. But i'd also like the DB Link tested before created.
    I've tinkered around a bit and was able to create the database link using a page process that calls an execute immediate statement to add the database link using items in the form section, however I'm confused as to how I would test the connection before hand.

    but rather the concept of a page that reads from table (maybe a "report?") to provide a result set of data which the user can click on a result to direct to another page.You are on the right track with the idea of an initial page with a report region listing your reports as links. Not sure from the provided information if this out of the box capability will meet your actual requirement, but try the Create Page wizard > New page > Form > Form on a Table with Report as a first approximation.
    instead of creating unique individual pages for each of the 100 Oracle Reports, featuring the report's attributes (parameters, etc), what do I need to do just have one APEX page that dynamically reads from the table and builds the Region and its Items based on what's in the table?If this can't be handled using the built-in Form on a Table with Report design pattern, it sounds like it will be possible using a dynamic form generated using the [APEX_ITEM API|http://download.oracle.com/docs/cd/B28359_01/appdev.111/b32258/api.htm#BGBHDGAI] either as another report region or a PL/SQL Dynamic Content region.
    Also, any reference books that you guys recommend on the ins/outs of APEX? [Pro Oracle Application Express|http://www.amazon.co.uk/gp/reader/159059827X/ref=sib_dp_pt#reader-link], the authors of which are active voices on this forum, is a good book. The forum itself is an unbelievable resource, as is the hosted service for learning and experiment at [apex.oracle.com|http://apex.oracle.com/i/index.html].

  • How to create the document with originals and checkin that document

    I am using this 2 bapi for creating DMS ,
    BAPI_DOCUMENT_CREATE2
    BAPI_TRANSACTION_COMMIT
    BAPI_DOCUMENT_CHECKIN2
    BAPI_TRANSACTION_COMMIT
    at last we want to c in DRAO table the created doc no should be updated here.
    But it not updating.how can i update in the table..
    Please tell via code..

    How do you call BAPI_DOCUMENT_CREATE2?
    I just tried with the example given in the documentation and with a little adjustment I created a document with an original which appears in the DMS_DOC_FILES table.
      DATA: ls_doc    LIKE bapi_doc_draw2,
            ls_return LIKE bapiret2.
      DATA: lf_doctype    LIKE bapi_doc_draw2-documenttype,
            lf_docnumber  LIKE bapi_doc_draw2-documentnumber,
            lf_docpart    LIKE bapi_doc_draw2-documentpart,
            lf_docversion LIKE bapi_doc_draw2-documentversion.
      DATA: lt_files LIKE bapi_doc_files2 OCCURS 0 WITH HEADER LINE,
            lt_drat  LIKE bapi_doc_drat OCCURS 0 WITH HEADER LINE.
      ls_doc-documenttype    = 'Z01'.
      ls_doc-documentversion = '01'.
      ls_doc-documentpart    = '000'.
      ls_doc-statusextern   = 'DR'.
      ls_doc-laboratory     = '001'.
      REFRESH lt_files.
      CLEAR lt_files.
      lt_files-docfile      = 'c:\BP\test.docx'.
      APPEND lt_files.
      CLEAR lt_drat.
      REFRESH lt_drat.
      lt_drat-language    = 'EN'.
      lt_drat-description = 'Info Rec Description'.
      APPEND lt_drat.
      CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
            EXPORTING: documentdata         = ls_doc
            IMPORTING: documenttype         = lf_doctype
                       documentnumber       = lf_docnumber
                       documentpart         = lf_docpart
                       documentversion      = lf_docversion
                       return               = ls_return
           TABLES: documentdescriptions = lt_drat
                   documentfiles        = lt_files.
      IF ls_return-type CA 'EA'.
        ROLLBACK WORK.
        MESSAGE ID '26' TYPE 'I' NUMBER '000'
                WITH ls_return-message.
      ELSE.
        COMMIT WORK.
      ENDIF.
    Best Regards,
    Martin

  • How to create Base Dimensions with MaxL and Text File?

    Hi,
    Doing a scratch rebuild of a cube every month. Don't want to have a 'dummy' outline with base dimensions to copy over every build. Instead want to build from text file somehow. Thus my plan is to: 1) Delete the existing app/db 2) Create a new blank app/db 3) Create the base dimensions in the outline via text file and 4) Build entire outline via a text file. I'm stuck on #3 how to get the 'base dimensions' built via text file. I need:
    ACCOUNTS
    PERIOD
    VALUE
    VIEWS
    SCENARIO
    CUSTOM4
    YEAR
    CUSTOM3
    CUSTOM2
    ENTITY
    CUSTOM1
    I see this MaxL, but it uses a 'rules file' and I never have built a rules file to create base dims so I'm confused if it's possible or not...
    import database sample.basic dimensions
    from data_file '/data/calcdat.txt'
    using rules_file '/data/rulesfile.rul'
    on error append to '/logs/dimbuild.log';

    We rebuild our Departments and Organization from an enterprise hierarchy master each week.
    The way we implemented (what you call #3) was to not do #1 and #2, but to have a "destructive" load rule for each of these dimensions using a text file. (in the "Dimension Build Settings" for the load rule, select "Remove Unspecified" to make it destructive)
    The text file just has the dimension name (parent) and any children we needed defined in a parent/child relationship. For instance
    "Sales Departments" "0100-All Departments"
    This essentially works the same as deleting the app because the destructive load rules will drop all the blocks of data that were unspecified.
    Then we run our SQL load rule to build the rest of the dimensions from the Location Master.
    We perform a level-0 export prior to this process, then reload the level-0 data and execute all the consolidation scripts to get the data back (now in a current enterprise defined hierarchy)

  • Urgent:HOW TO CREATE A PROGRAMME WITH MENUS AND MENUITEMS IN AWT?

    hi am new to java..............and i know very less about java
    can anyone help me by sending the code for creating menu with file,edit ,view and menuitems as open,save,exit.
    and also plss help me how to get a filedialog box in the same programme when i click the open in filemenu.
    in AWT.....................plsss urgent

    sangi wrote:
    hi am new to java..............and i know very less about javaredundant and barely intelligible
    can anyone help me by sending the code for creating menu with file,edit ,view and menuitems as open,save,exit.have you tried a Swing demo? aside from the fact that this code has likely been written and published hundreds of times on the web, a simple tutorial would have shown you how to do this.
    and also plss help me how to get a filedialog box in the same programme when i click the open in filemenu.
    in AWTslow down, one thing at a time
    go do the tutorials first
    .....................plsss urgentstating your task is urgent is offensive here
    learn how to communicate lest you get flamed
    good luck

  • How to create Clipping Masks with Shapes and Text?

    Hi there! I am new to Illustrator and am currently attempting to learn it. I am creating a logo that has text and has a shape that goes through the text to make the text appear as if it has claw marks in it.
    I have two layers. The layer with the shape "claw" marks, and a layer with the text. The shape layer is currently above and the text layer is currently below. If I select both layers and click on Make Clipping Mask it has the text displayed within the little claw marks, how do I reverse that? Because when I try to change the order of the layers it doesn't clip anything?
    Thank you so much!
    Aaron

    Hi Monika,
    Sorry for taking so long to reply... This is what I am trying to accomplish. I tried following your directions above, but that only made the text invisible and I tried moving the claw layers above and below the text... and it only appeared as if the claws per se were filling up with the text color.
    Here is what I am trying to accomplish:

  • How to create a grid with arrays and booleans?

    As part of a bigger project, I'm trying to create a sub-VI which will allow me to move a "cursor" in a 3x3 array.
    There should be 2 boolean inputs, one for moving down in the array, and the other for moving to the right. Once the edge of the array has been reached, the "cursor" will start back from the beginning.
    I have a vague idea of a 2 dimensional array with LED's. Once "down" has been pressed, the LED corresponding to (0,0) will turn off, turning (0,1) on. Same goes for the "right" button. When "down" is pressed at (0,2), the LED should turn off, and LED (0,0) should turn on.
    I'm sure it has something to do with initializing arrays, but i can't seem to find the right way to do it.
    Any kind of assistance is much appreciated. Thanks!
    Solved!
    Go to Solution.

    Maybe this will help.
    Oh, I just noticed that I could have done the "Clear True" outside of the inner case structure and some other things too, but oh well - it works.
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.
    Attachments:
    grid_png.vi ‏14 KB

Maybe you are looking for