Stephen Walsh
Stephen Walsh

Reputation: 835

How to use text field items to add a row to a table in Oracle Apex?

I'm looking to be able to add a new row to a table by having a few text field items to input the value for each column of the new row in the table. Example:

If I have a table called Persons with the following columns: Name, Hometown and Job.

Then on a page in my Apex application I have text field items for Name, Hometown and Job with a submit button. The user should be able to enter a value into the three text fields, then click submit and it should create a new row in the Persons table with the three values in each column.

I know editing tables can be done in Apex with a tabular form but it would suit my application if it could be done this way, any help is greatly appreciated.

Upvotes: 0

Views: 3470

Answers (1)

Tom
Tom

Reputation: 7028

Stephen: I'm not going to write a big answer to this. The best way to learn things is by simply doing and experiencing them.
You say you're fairly new to Apex, and that is great.
However, take some time to get familiar with some common practices in Apex. The thing you're asking for is just one of those things: a report with a detail screen.

  • Take the 2-day developer guide. Especially as a beginner, this is a really basic tutorial but it still introduces some of the basic concepts.
  • Sign up for a workspace on apex.oracle.com (alternatively, you may also have access to this locally). By default this workspace will hold the sample database database application created by Oracle. This whole application is made so that you can learn from it. For example, when running the application you can go to the "Customers" tab. You will notice this is a report and has an edit link, which takes you to a form page where you can edit the record. A create button on the report page will also take you to that page, only with empty values. After applying changes you are redirected back to the report page, which will have the new/edited record.
  • This workspace also has the packaged applications (4.2 and up only). These also are good learning tools for you to see how certain solutions have been implemented. Installing one will install it in your workspace, allowing you to see what is under the hood.

Eventually, you should be able to create this fairly easily by just creating a new page and choosing a form. Apex will offer you the choice of creating a form + report, which will take you through the wizard screens for both and link them up.
If you still have some problems or can't work it out from there, we're still here to help with that.

Upvotes: 3

Related Questions