2 Replies Latest reply: Dec 14, 2012 8:56 AM by 849481 RSS

    InputLOV LaunchPopup Event Tab Out

    898691
      Dear all,

      When I press 'Tab' or 'Enter' in the InputLOV, it will trigger the 'LaunchPopupEvent' but if I press '->' (right key), it will not trigger the 'LaunchPopupEvent'. Is there any way to suppress the 'LaunchPopupEvent' when pressing 'Tab' or 'Enter' key in the InputLOV field?
      I need to keep the LaunchPopupListerner method since I need it for the customize popup when user click on the 'search' key. Thanks a lot.

      Regards,
      Andrew
        • 1. Re: InputLOV LaunchPopup Event Tab Out
          849481
          I really hope you found a solution but didn't care to post it.
          If you do have it, please share because i have the same problem, and probably all other developers who are wondering why the popup is at all triggered on tab action in the first place

          regards
          • 2. Re: InputLOV LaunchPopup Event Tab Out
            849481
            Ok... this is my "brilliant" solution (thank you, ADF, for making do stuff like this ... so very often)

            <code>
            public class LifeCycleListener implements PhaseListener {
            @Override
            public void beforePhase(PhaseEvent phaseEvent) {

            if(phaseEvent.getPhaseId() == PhaseId.APPLY_REQUEST_VALUES){
            String actionId = phaseEvent.getFacesContext().getExternalContext().
            getRequestParameterMap().get("event");
            String event = phaseEvent.getFacesContext().getExternalContext().
            getRequestParameterMap().get("event."+actionId);
            if(event!=null){
            if(event.contains("<k v=\"action\"><s>tab</s></k><k v=\"type\"><s>lovInternal</s></k>")){
            System.out.println("skipping everything ... this event is useless showing popup on tab in inputComboLOV and btw applies values with no validation and breaks everything keeping invalid values applied to the model(displ attr inputvalue in the viewobject) as well");
            FacesContext.getCurrentInstance().renderResponse();
            }
            }

            }

            }
            }
            </code>