ICEfaces
  1. ICEfaces
  2. ICE-1123

requestFocus() not Working with Appear Effect

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 1.6DR#1, 1.6
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)

      Description

      I have added Appear/Fade effects to the login popup for icefaces.org (See bug
      #1084 for details). The following method is used to open the login popup and
      request focus on the first inputText component.

          public void openLogin(ActionEvent ae) {
              openLogin("ui");
              HtmlInputText toFocus = findUserNameField(ae.getComponent().getParent
      ());
              if (toFocus != null) {
                  toFocus.requestFocus();
              }
          }

      I have checked to make sure this method is getting the appropriate inputText
      component and calling requestFocus() on the component - it is. The initial
      firing of the effect appears to be blocking the focus being set on the
      component. If you hit the login link a second time, the component will gain
      focus.

        Activity

        Hide
        Brad Kroeger added a comment -

        This was fixed in Revision #13239

        We added a FocusEffect class:

        public class FocusEffect extends Effect {

        @Override
        public String getFunctionName()

        { return "Ice.Focus.setFocus"; }

        }

        VisitorBean's buildEffect() method had the following added:

        loginPopupEffect.setSequence("a");
        loginPopupEffect.setSequenceId(1);
        inputEffect = new FocusEffect();
        inputEffect.setSequence("a");
        inputEffect.setSequenceId(2);

        The new effect is applied to the appropriate inputText component.

        The previous code finding the component through it's id was removed.

        This is ready to be closed

        Show
        Brad Kroeger added a comment - This was fixed in Revision #13239 We added a FocusEffect class: public class FocusEffect extends Effect { @Override public String getFunctionName() { return "Ice.Focus.setFocus"; } } VisitorBean's buildEffect() method had the following added: loginPopupEffect.setSequence("a"); loginPopupEffect.setSequenceId(1); inputEffect = new FocusEffect(); inputEffect.setSequence("a"); inputEffect.setSequenceId(2); The new effect is applied to the appropriate inputText component. The previous code finding the component through it's id was removed. This is ready to be closed
        Hide
        Rob Mayhew added a comment -

        Closed.

        Show
        Rob Mayhew added a comment - Closed.
        Hide
        Ken Fyten added a comment -

        Need to revise component TLD docs to add this effect.

        Show
        Ken Fyten added a comment - Need to revise component TLD docs to add this effect.

          People

          • Assignee:
            Unassigned
            Reporter:
            Brad Kroeger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: