Index.jsp Sample

This topic inludes the source code for the Index.jsp Sample.

Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui/radioButtons/

Sample Source Code


01 <%@ page language="java" contentType="text/html;charset=UTF-8"%>
02 <%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
03 <%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
04 <%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%>
05 <netui:html>
06     <head>
07         <title>
08             index.jsp
09         </title>
10     </head>
11     <body>
12         <jsp:include page="/resources/jsp/header.jsp"/>
13         <p><b>RadioButtonGroup Tag Sample</b></p>
14         
15         <blockquote>
16         <p>The following radiobutton options are generated from a java.util.HashMap object
17         that exists on the Controller file.  Because each entry in the HashMap includes two Strings,
18         the generated radiobuttons have different display texts and underlying values.
19         <p><netui:form action="processData">
20         <netui:radioButtonGroup
21             optionsDataSource="{pageFlow.hashMap}"
22             dataSource="{actionForm.selection}" />
23         <netui:button value="Submit" />
24         </netui:form>
25         
26         <hr>
27         
28         <p>The following radiobutton options are generated from a String[] object
29         that exists on the Controller file.  But each element of the String[] object
30         includes only one String, the generated radiobuttons 
31         do *not* have different display texts and underlying values.
32         <p><netui:form action="processData">
33         <netui:radioButtonGroup
34             optionsDataSource="{pageFlow.strArr}"
35             dataSource="{actionForm.selection}"/>
36         <netui:button value="Submit" />
37         </netui:form>
38 
39         <hr>
40 
41         <p>The following radiobutton options are statically generated from a
42         a set of &lt;netui:radionButtonOption> tags.
43         <p><netui:form action="processData">
44         <netui:radioButtonGroup 
45             dataSource="{actionForm.selection}">
46             <netui:radioButtonOption value="value1">Display Text 1</netui:radioButtonOption><br>
47             <netui:radioButtonOption value="value2">Display Text 2</netui:radioButtonOption><br>
48             <netui:radioButtonOption value="value3">Display Text 3</netui:radioButtonOption><br>
49         </netui:radioButtonGroup>    
50         <netui:button value="Submit" />
51         </netui:form>
52 
53         </blockquote>
54         
55         <hr>
56         <netui:anchor href="/WebApp/tagSamples/tagSamplesController.jpf">Return to Tag Samples</netui:anchor>
57     </body>
58 </netui:html>