Products Downloads


French version


 

 

To create a list that uses an Adelia JavaBean, using the Websphere Studio assistants:

 

1.      Using Adelia to create a JavaBean with a list as a parameter.

2.     Create a blank new JSP page.

This page must have the ".jsp" extension. In our example, this page is called "listcust.jsp".

 

 

 

3.     Build the page in HTML only, placing a single row in the table that will be dynamically filled.

Position the cursor in one of the cells, then run the menu option: Insert/Dynamic elements/Display properties.
Then click Browse to retrieve the object property that you want to display in the current cell of the table.

 

 

 

Repeat this procedure for each cell in the table in which you want to display data from the Bean.

 

4.     Next, specify that the second row of the table must be repeated:

In the table attributes, check the Loop option on the second tab, then browse the list and retrieve the name of the list that you want to dynamically loop. Then specify which ranges are to be repeated. (In our example, only the second row is repeated).

 

 

Validate the operation, then click on the editor's HTML source code tab.

Locate the following instruction:

<%

Manager.refresh ( FLSTCL );

%>

 

Check that the name set as a parameter matches the name entered in the JavaBean declaration:

<jsp:useBean class= "com.hardis.training.FLSTCL" id= " fLSTCL "></jsp:useBean>

 

5.    All that remains is to publish the page and test it. Everything should work if the system has been correctly configured.

 

6.    If you want to dynamically create a hypertext link on each row of the table (as for the customer code in our example), you must place the mouse pointer over the icon in the relevant cell, then insert a link by clicking the right mouse button.

 

 

The link is specified by the URL field.

Click the Edit button to display a window that lets you declare the necessary http parameters. One of these parameters can be dynamic, i.e. based on a property of the Adelia bean.

The resulting link will have the following appearance:

http://domain/detailcust.jsp?CODECLI=C0050&CODACTION=DETAIL

 

 

 

↑ Top of page

  • Aucune étiquette