JSF Data Scroller Pagination Information

in this post I will speak about Displaying JSF Data Scroller Pagination Information.

by default data table and data scroller JSF component  have no direct way to display the pagination information

for example: displaying information about the current displayed records (31 - 40 From 96)

this can be done simply by doing the following steps:



JSF Datatable datascroller Search result navigation to first page

­the problem in brief is that if you navigate using the datascroller to any page for example page number 5

and you enter a search  criteria and pressed on the search button the result is returned and the datatable is updated but the datascroller keeeps standing at page 5 which may not contain any data because¬≠ your search result may not have enough data to be splitted on 5 pages so you want behaviour like after pressing search your datascroller will be set to page number 1 and this can be done as follows:



Problem wit JSF (Myfaces) t:inputFileUpload

If you are facing problem of the kind that some files get uploaded and some other files not.

for the first time you will off course debug the attachment handler action method of your command Button that is associated with the t:inputFileUpload and you will notice a strange behavioure that for the fiels that is uploaded successfully the action method (responsible for manipulating the uploaded file) get invoked as expected, but for those files that not uploaded and more over may destory your other form data, this method not invoked.

{JSF, JavaScript} controlling invocation order

{JSF, JavaScript} controlling invocation order

I put JSF and JavaScript in a set as the order in the set is not important, and in this post I will speak about the four types of invocation in JSF web application which are:

  1. JavaScript Call.
  2. JSF Call.
  3. JavaScript call, followed by JSF call.
  4. JSF call, followed by JavaScript call.

I will give a simple illustration of the usage of each one of the above a long with how you can achieve it.

Custom JSF Validator

How to Create your custom validator?
suppose that we want to create custome validator that applies some Arithmatic Operation on two fields.

1. Create the ComparisonValidator.2- Create the ComparisonValidatorTag. 3- Create the Validator.tld 4- Register the validator in the faces-config.xml 5- Now in the jsp page you can use it as following:

1. Create the ComparisonValidator.

package com.aliabdelaziz;

* @author aabdelaziz

Powered by Drupal - Design by artinet