Java Code Examples for javax.faces.component.UIComponent#queueEvent()

The following examples show how to use javax.faces.component.UIComponent#queueEvent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractPagerRenderer.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
@Override
public void decode(FacesContext context, UIComponent component) {
    super.decode(context, component);

    // check that this component cause the submit
    String currentClientId = component.getClientId(context);
    String hiddenValue = FacesUtil.getHiddenFieldValue(context);
    if(StringUtil.isNotEmpty(hiddenValue) && hiddenValue.startsWith(currentClientId)) {
        int pos = hiddenValue.lastIndexOf('_');
        if (pos==currentClientId.length()) {
            String idSuffix = hiddenValue.substring(pos+1);
            try {
                ExtlibPagerEvent pagerEvent = new ExtlibPagerEvent(component);

            	//>tmg:a11y
                pagerEvent.setClientId(hiddenValue);
                //<tmg:a11y
                
                if(initPagerEvent(context, component, pagerEvent, idSuffix)) {
                    component.queueEvent(pagerEvent);
                }
            } catch(Exception ex) {}
        }
    }
}
 
Example 2
Source File: PagerSizesRenderer.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
@Override
protected boolean initPagerEvent(FacesContext context, UIComponent component, PagerEvent pagerEvent, String idSuffix) {
    try {
        int nrows = Integer.parseInt(idSuffix);
        pagerEvent.setAction(UIPagerSizes.ACTION_SETROWS);
        pagerEvent.setPage(Math.min(nrows, UIPagerSizes.ALL_MAX));
        component.queueEvent(pagerEvent);
        return true;
    } catch(Exception ex) {return false;}
}
 
Example 3
Source File: PagerSizesRenderer.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
@Override
protected boolean initPagerEvent(FacesContext context, UIComponent component, PagerEvent pagerEvent, String idSuffix) {
    try {
        int nrows = Integer.parseInt(idSuffix);
        pagerEvent.setAction(UIPagerSizes.ACTION_SETROWS);
        pagerEvent.setPage(Math.min(nrows, UIPagerSizes.ALL_MAX));
        component.queueEvent(pagerEvent);
        return true;
    } catch (Exception ex) {
        return false;
    }
}