Pages

Wednesday, November 13, 2013

InputListOfValues - Control custom popup launch

I went through the code of ADF Faces Demo-inputListOfValues -
1. It has customPopup in searchFacet.
2. A custom PopuplaunchListener .

If you write someValue in inputField and tab out, customPopupLaunch Listener gets called. It checks if the entered value is complete then popup Launch is cancelled using below code.

event.setLaunchPopup(false); 

Small addition to above requirement : You write the complete value and click lov icon. Popup gets launched... But what if you want to block the popup launch on click of lov icon when complete value is entered.

Thanks to Oracle Forum.. where I got the answer.
https://forums.oracle.com/thread/2598020

All you need to do is short-circuit the JSF Life cycle.

FacesContext.getCurrentInstance().responseComplete();

Enjoy.