ObjectListDataProvider Tutorial

This is a tutorial for using the ObjectListDataProvider in a Visual Web Project. A ObjectListDataProvider is useful if the underlaying data is from a datasource not supported by NetBeans. Some samples for such datasources are a JPA or hibernate connection, other legacy systems such SAP or Lotus Notes and files in various formats. In this tutorial we use a text file with customer records as datasource for our application. Creating the project In the first step you create a normal VWP project named OldpSample: Address POJO For data storage we use a simple POJO object. Right click the oldpsample package[…]

Read more

Fill a treeview programmatically

You must build a collection of TreeNode objects and add this collection to the TreeView control. Each TreeNode object has several properties to set up the visual appearance and functionality. Important TreeNode properties expanded – Shows this node expaned with children ext – Title text of the node target – Target browser window toolTip – Tooltip text to display url – Hyperlink to navigate to action – Name of method to call if user selects this node actionListenerExpression – Expression for action listener method. Adding icon to TreeNode To add a icon to the TreeNode you must first create a[…]

Read more

ICEFaces installation for NetBeans IDE

ICEFaces is a Java Server Faces component library. To integrate ICEFaces into the NetBeans IDE and the Visual Web Pack the following steps are necessary. Download of ICEFaces components The following downloads from the ICEFaces website are needed: ICEfaces-<version>-libs-NetBeans.zip ICEfaces-NetBeans-IDE-<version>.zip ICEfaces-<version>-complib-NetBeans.zip Installation of ICEFaces runtime library Unpack the file ICEfaces-<version>-libs-NetBeans.zip and import the included com-icesoft-ide-netbeans-libs-module.nbm module with the NetBeans Update Manager. Installation of ICEFaces IDE integration Unpack the file ICEfaces-NetBeans-IDE-<version>.zip and install the module com-icesoft-faces-vwp-ide.nbm. This module must also be installed with the NetBeans Update Manager. Installation of ICEFaces component library Unpack file icefaces-webui.complib from ICEfaces-<version>-complib-NetBeans.zip and copy it to[…]

Read more

Using Jasper Reports with Visual Web Pack

This tutorial illustrates the use of Jasper Reports with a Visual Web Pack application. Register Jasper Reports library Use the NetBeans Library Manager to create a library for the Jasper Reports class libraries. You need at least the following files from the distribution: dist/jasperreports-<version>.jar lib/commons-beanutils-1.7.jar lib/commons-collections-2.1.jar lib/commons-digester-1.7.jar lib/commons-logging-1.0.2.jar lib/itext-1.3.1.jar Register Jasper Reports image servlet The image servlet is needed if you want html rendered reports (also without any graphical elements, because report placeholders uses images from this servlet). So you must register it in the web.xml configuration file. You can use the NetBeans web.xml editor to do so. Servlet name[…]

Read more

Center VWP components

There isn’t any standard function in the Visual Web Pack to center components on the page. You can only use absolute or flow layout. If you want center your components horizontally or vertically, you need CSS. This is done with the style setting of your component. position: absolute; left: 50%; top: 50%; This setting would center the left upper corner of your component on the page, but not the whole component. To center the whole component you must adjust the margins. The margins can be negative, so substract the half of the vertical and horizontal size from the corresponding margin.[…]

Read more