5 Replies Latest reply: Oct 12, 2012 12:35 AM by Sai Yeluri RSS

    Popup getting closed automatically for case of typing in input field.

    939547
      I have a input date field, where if I change any value, on the valuechangeListener I am invoking a warning popup asking me to confirm my change with two buttons Yes and No. Also I have a header level Submit button.
      Now if I type the date in the input date field and without doing tab out, I directly click on Submit button, then the warning popup comes for a moment and it goes away automatically without we clicking anything on it, and the pointer is going to Submit button action listener directly. So, basically whatever I am doing inside the action Listener for Yes or No button of the warning popup is not happening as the popup is just opening and getting closed automatically.
        • 1. Re: Popup getting closed automatically for case of typing in input field.
          raghav1212
          share the piece of code you are using to trigger onkeychange for the input field some times this issue occurs due to the order of components how you are using as well as the form element.
          • 2. Re: Popup getting closed automatically for case of typing in input field.
            939547
            On value change listener of my input field, am calling a managedbean method qualAreaEvalDateUpdate:
            <af:inputDate value="#{row.bindings.EvaluationDueDate.inputValue}"
            label="#{bindings.QualifInitQualAreaVO.hints.EvaluationDueDate.label}"
            id="id1"
            valueChangeListener="#{pageFlowScope.QualificationEditManagedBean.qualAreaEvalDateUpdate}"
            autoSubmit="true">

            And inside qualAreaEvalDateUpdate method, the following code is there:-
            valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());
            PatternsPublicUtil.invokePopup(this.getQualifInitOverviewBackingBean().getQaEvalDateChangePopup(),null);

            And the poup which it is calling is written in the same page where that input field is there.
            Let me know if you need any more input.
            • 3. Re: Popup getting closed automatically for case of typing in input field.
              Arunkumar Ramamoorthy-Oracle
              Did you try adding a dialog inside the popup and set it as modal and see if it works fine after that?

              -Arun
              • 4. Re: Popup getting closed automatically for case of typing in input field.
                Subramanian Meyyappan
                I have a input date field, where if I change any value, on the valuechangeListener I am invoking a warning popup asking >me to confirm my change with two buttons Yes and No. Also I have a header level Submit button.
                ok
                Now if I type the date in the input date field and without doing tab out, I directly click on Submit button, then the >warning popup comes for a moment and it goes away automatically without we clicking anything on it, and the pointer >is going to Submit button action listener directly
                if dont use tab out means. valuechange listener never fires as far as i know.

                from the last point of post.yes you are right. if you want retains error as long it fix by user means.
                write your validation in EO method. say as validateeo it retains your error until resolve by user.
                say as example while at the time of committing or submit the record.
                • 5. Re: Popup getting closed automatically for case of typing in input field.
                  Sai Yeluri
                  I had similar issue that pop up close immediately after showing warning message for a moment.

                  Please follow below steps to resolve this issue.
                  1)Change the AutoCancel to disabled.
                  2)Keep your submit button in a toolbar .
                  3)Since AutoCancel is disabled , write a code to close popup at appropriate places.

                  Good Luck
                  --Sai Yeluri.