advertisement
javaboutique
Search Tips
Articles  |   Tutorials  |   Reviews  |   Tools  |   by Category  |   by Date  |   by Name  |   Submit  |   Source  |   Forums  |  
javaboutique
Browse DevX


Partners & Affiliates











advertisement

Tutorials : NetBeans Visual Web Pack: Learning by Example :

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:
  1. "Select a category:"
  2. "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:
  • Select a Table component from the Palette window and drop it on the scene (set Top/Left CSS parameters to 288px/24px).
  • Go into the Runtime window and expand the JDBC node for the MYSTORE database and the Table node (you should see two tables CATEGORIES and PRODUCTS.
  • Drag the PRODUCTS table exactly over the table title from the scene and release it. Repeat this step until the PRODUCTS table columns are listed in the header of the Table component. At the end, the Outline window should show a productsRowSet node under the SessionBean1> node.
  • Right-click on the productsRowSet in the Outline window, just under the SessionBean1.
  • Select the Edit SQL Statement from the popup menu.
  • In the table that contains the PRODUCTS columns, right-click on the CATEGORYID row.
  • Select Add Query Criteria from the popup menu.
  • In the Add Query Criteria window, select the Parameter radio button and click OK.
  • Return to Design mode by closing the current window.
  • Using Ctrl and a mouse-click, select the drop down list and the columns from the table, as shown below in Figure 3.

  • Figure 3: Your Newly Added Components

  • Select an item and right-click. Select Configure Virtual Forms from the popup menu.
  • Press the New button.
  • Type virtualProducts in the Name column and check Yes in the Participate column. Click Apply and OK.
  • Click on the scene to deselect the selected items.
  • Right-click on the Table component and select the Table Layout item from the popup menu.
  • In the Table Layout window, Columns tab, select New.
  • Type SELECTED in the Header text field.
  • In the Component Type text field, select Checkbox.
  • Select the PRODUCTS.PRODUCTIMAGE item.
  • In the Component Type text field, select Image and click Apply.
  • In the Options tab, mark the Show Select All Rows and Show Deselect All Rows checkboxes.
  • Type PRODUCTS in the Title text field. Click Apply and OK.
Home / Articles / NetBeans Visual Web Pack: Learning by Example / 1 / 2 / 3 / Next Page

How to Add Java Applets to Your Site

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.

 Microsoft Visual Studio 2010 Showcase
 Avaya Developer Showcase
 MSDN Spotlight
 PHP for Windows Showcase
XML error: undefined entity at line 39
advertisement
Receive Articles via our XML/RSS feed
Receive Articles via our XML/RSS feed

JavaBytes
Internet Cyclone
This powerful, easy-to-use, internet optimizer is for Windows 95, 98, ME, NT, 2000 and XP. It's designed to automatically optimize your Windows settings, boosting your Internet connection up to 200%.

Windows 7: From Beta to Final Code in One Year
Google Shows Off Chrome OS, Releases Source
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?
Fedora 12 Takes Aim at Linux Networking
Top Supercomputer Nearly Doubles in Speed
Fedora 12 Linux Tackles Virtualization
Apple Gives iPhone Developers App Status Tracker
Novell Sets OpenSUSE 11.2 Free

Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Exploring HTML 5's Audio/Video Multimedia Support
Overriding Virtual Functions? Use C++0x Attributes to Avoid Bugs.
Understanding the Cloud Computing Security Vulnerabilities
Cisco and IBM Target a Greener World
Upgrade to Visual Studio 2010 with the Ultimate Offer

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs