开发技术:调查您的应用程序需求
添加时间: 2008-4-23 22:54:45 作者: Oracle指导 阅读次数:24 来源: http://www.d9soft.com
2. For Create List of Values, select From Scratch and click Next.
3. Enter a value for Name, such as response options 1 through 5; select the Dynamic option; and click Next.
4. Enter the SQL query in Listing 2 into the page.
Code Listing 2: List of values query
select 1 display_value, 1 return_value from dual union all
select 2 display_value, 2 return_value from dual union all
select 3 display_value, 3 return_value from dual union all
select 4 display_value, 4 return_value from dual union all
select 5 display_value, 5 return_value from dual
order by display_value
5. Click Create List of Values.
Add answers to the region. Now you need to add the answers to the region.
1. In the Items section of the page 1 definition screen, click the Add icon.
2. Click Create multiple items at the bottom of this screen.
3. In the Create Items in Region list, select the new HTML region: Oracle Application Express Workshop Survey ....
4. Enter eight items named P1_A1 through P1_A8.
5. Change the item Label field to the case-sensitive string &P1_Qn.—where n is the number of the current answer. (Note the period at the end of these values.)
6. For the type of each item, select Radio Group.
7. Click Create Multiple Items.
8. In the Items section of the page 1 definition screen, under Items, for each of the new Radio Group items, click the name—P1_An,—and in the Edit page, in the List of Values section, select the name you gave the list of values you created (such as response options 1 through 5), and enter 5 for Columns.
Add a process. Now add a process to populate the P1_Qn question items with the values of the first eight questions.
1. In the Processes section of the Page Processing section on the page 1 definition screen, click the Add icon.
2. Select PL/SQL, and click Next. 3. Enter a name.
4. For Point, select On Load-Before Header.
5. Click Next.
6. Copy and paste the following into the text box:
for
:P1_Q8 := c1.question; end if; end loop;
and click Next.7. Click Next, and finally click Create Process. Add validation. Now add validation to ensure that everyone who takes the survey answers all of the questions. 1. In the Validations section of the page 1 definition screen, click the Add icon.2. Click Create Multiple, not null validations at the bottom of this screen.3. Select the eight answer items (P1_A1 through P1_A8), and click Create Not Null Validation. Add a Next button. Add a button called Next to the HTML region.
1. In the Buttons section of the page 1 definition screen, click the Add icon.
2. Select the Oracle Application Express Workshop Survey region, and click Next.
3. Select the Create a button in a region position, and click Next.
4. Click the brown [Next] link to enter Next as the Name and Label, and click the Next button.
5. Click Next.
6. For Position, select Bottom of Region, and click Next.
7. For Branch to Page, click the pop-up-list icon, select 2 Workshop Survey cont., and click Create Button.
Build Page 2
Now build page 2 to include the final two questions and their answers.
Create a region. Navigate to the definition screen for page 2, by entering 2 into the Page field and clicking on Go. On page 2, use the same instructions and region name you used to create the region in page 1.
Add questions to the region. Follow the instructions you used to create the questions on page 1. Name these page 2 questions P2_Q9 and P2_Q10.
Add answers to the region. Follow most of the instructions you used to create the answers on page 1. Name these page 2 answers P2_A9 and P2_A10, label the answers &P2_Q9. and &P2_Q10., and select Textarea for the Type attribute of these answers.
Add a PL/SQL process. Follow the instructions you used earlier to add a PL/SQL process to page 1 to add the following to a PL/SQL process in page 2:
for c1 in ( select *
from survey_questions
where id >= 9 order by id)
loop
if c1.id = 9 then
:P2_Q9 := c1.question;
else
:P2_Q10 := c1.question;
end if;
end loop;
Next Steps
LEARN more about Oracle Application Express
DOWNLOAD
Oracle Database 10g
Oracle Application Express
sample application code
Add a Submit button. Add a Submit button to page 2 following the same the instructions you used earlier to add a Next button to page 1. When adding this button, name and label it Submit and, when prompted, set its branch target to page 3.
开发技术:调查您的应用程序需求(2) 第 [1] [2] [3] 下一页
上一篇文章: 开发技术:关于变量、移动以及含义 下一篇文章: dbv能用来检查日志文件吗

