mhmpl
mhmpl

Reputation: 1043

Gather inserted text values from multiple rows in a report

I'm currently struggling with Oracle Apex. I'm trying to create an application which enables customers to place their order. Therefore I create a report which lists the available products. Furthermore the report contains a column (the SQL query for that is simply '0' as "Quantity") which displays a text box. In this text boy the customer should be able to insert the required quantity.

I've create a screenshot to make it easier to follow me: enter image description here

After the customer has fill out the form, the "Place Order" button will purchase the wished items then.

My question is now, how is it possible to read out in which text boxes did the user filled in a number and also to which product belongs it!

Upvotes: 0

Views: 400

Answers (1)

GregJarm
GregJarm

Reputation: 460

An easier solution would be to recreate the region but choose Form Region and then Tabular Form Region and then the wizard will help take care of the DML for you. But you need to use specific table columns for this to work.

To answer your question more directly - the input items defined in reports that are posted to the server can be accessed in PL/SQL as a set of "Global Arrays". These are defined as PL/SQL tables in the package apex_application with the names g_f01 through g_f50.

To be sure which of these arrays to use for the quantity text box you can look at the html of the page for the name attribute of the input tag. If it is f01 then you would be able to process the results by accessing each position or element in apex_application.g_f01.

To link the input with the table you would need some sort of key. If you use the wizard to build a Tabular Form all this headache is taken care of for you though.

Upvotes: 1

Related Questions