Adding the WVP Components to the Application
Return to the Projects window. You're going to place the first VWP components on the scene and implement their functionalities.
Label
- Go to the Palette window, select the
Label component and place it on the scene.
- In place of the Label text, type "My Store Administration Console."
- From the Properties window, select the
style property for this label (the Properties window is below the Palette window).
- In the left panel of the opened window, make sure that the Use Value radio button and the Font option are selected.
- Modify the text size to 24px.
- Select the Position option.
- In the Top and Left CSS properties, select a value of 10px. Then click OK.
Using above technique, you're going to place two more Label components on the scene:
- "Select a category:"
- "The products from this category are:"
The Top and Left CSS properties for the first are set to 10px and 60px and for the second one are set to 24px and 264px. They are both 12px.
Message Group
This component will report any possible errors directly to the web browser. From the Palette window, select a Message Group component and place it on the scene at 120px (Top) and 888px (Left).
Drop Down List
You also need to configure a data provider for this component:
- Select a drop down list component from the Palette window and drop it on the scene (set the Top/Left CSS parameters to 80px/10px).
- Go into the Runtime window and expand the
jdbc node in the MYSTORE database and the Table node. This should reveal two tables: CATEGORIES and PRODUCTS).
- Using your mouse, drag the
CATEGORIES table from the scene to exactly over the drop down list and release the mouse it. Repeat this step until the drop down list first item is "abc." When you see the "abc" text in the drop down list, you must have a categoriesRowSet node under the SessionBean1 node, in the Outline window.
- Right-click on the drop down list and use AutoSubmit to change the option in the popup menu to Configure Virtual Forms (choosing an option from the drop down list automatically submits the page to the server).
- In the Configure Virtual Forms window, press the New button.
- In the
Name column type virtualCategory text and mark Yes at the Participate and Submit columns. Then click Apply and OK.
| Author's Note: Virtual forms are a very elegant way to avoid unnecessary validations. To view your current virtual forms in the Design window, click on the Show Virtual Forms icon (to the right of the Design/JSP/Java buttons). |
Table
The Table VWP component is another component for which you have to set a data provider:
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.
|