Search code examples
jsfdatatableicefacesdouble-click

Icefaces RowSelector double-click


I have a small problem with double-click handling with icefaces.

There are two methods of doing it, it seems.

SelectionListener => you know if it is a double click or not with the fired ClickActionEvent but you cannot navigate (open a new "details" page on a row double-click)

ClickAction => navigation OK, how do you know if it is a doulbe-click or not ?

What is the best way of doing what i want to achieve ? Say i have a list of persons, double click on a person should open a details page of that person.


Solution

  • You can use rowSelector tag which has attribute clickListener.

    When a row is clicked ClickActionEvent is called & you can determine in backing bean, if its double-clicked or not by ClickActionEvent.isDblClick().

    For navigation, in backing bean action event

    FacesContext context = PersistentFacesState.getInstance().getFacesContext();
    NavigationHandler handler = context.getApplication().getNavigationHandler();
    handler.handleNavigation(context, fromAction, outcome);
    

    Can also try

    FacesContext.getCurrentInstance().getExternalContext().redirect(url);