Thursday, January 31, 2008

colspan

To get a column to the left of the row we use colspan. For alignment valign is used.

For example we have a row with three columns in a JSP Page. Let’s say we don’t have any value for 1st and 2nd column. To place the data in 3rd column we use colspan attribute.

<td class="rmt-readOnlyData" valign="top" colspan="2" >

Sunday, January 20, 2008

How to freeze/lock the table header

We often face reqirement where header should be locked and should not scroll when the data is scrolling. For that purpose we use the following style attribute in the tr section to get the heading part locked

<tr style="position:relative;top: expression(this.offsetParent.scrollTop-2);" valign="top">

How to enable enter key for searching purpose.

We have a drop-down box for selecting the search criteria and a textbox for entering the search value. we have a "search" button besides the textbox for searching the related values.

Now we need to enable the enter key (Keyboard) functionality for search purpose.

JSP Code:

<html:text name="ABCForm" size="30" property="searchCriteriaText" onkeypress="normalSearchEnter(event);" />

JS Code:

function normalSearchEnter(oEvent) {
if ((oEvent.keyCode && oEvent.keyCode==13) (oEvent.which && oEvent.which==13)) {
normalSearch(); // Call the usual function that will be invoked when search button is clicked
}
}

Thursday, January 03, 2008

FAQ

Tutorial - One