Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8120738

When requesting focus on a focusproperty changed listener, javafx gives focus to two different controls

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: fx2.0.2
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
    • Environment:

      Windows 8
      jre 7
      javafx 2

      Description

          private void fillPerson()
      {
          try
          {
              this.selectedPerson=new PersonController().getOne(NuInt.safeParse((this.txtIdPerson.getText())));
              if(this.selectedPerson.getId()!=0)
              {
                  this.txtPersonName.setText(this.selectedPerson.getName());
                  this.txtZoneName.setText(this.selectedPerson.getZona().getName());
                  this.txtCompanyName.setText(this.selectedPerson.getCompany().getName());
              }
              else
              {
                  this.txtPersonName.setText("");
                  this.txtZoneName.setText("");
                  this.txtCompanyName.setText("");
                  this.txtIdPerson.requestFocus(); <------------------------------------------------------------------------ This produces the dual focus
              }

          }

          private class FocusListener implements ChangeListener<Boolean>
      {
          private TripFrmController trip;
          public FocusListener(TripFrmController Trip)
          {
              this.trip=trip;
          }


          @Override
          public void changed(ObservableValue<? extends Boolean> ov, Boolean prevVal, Boolean newVal)
          {
              if (!newVal)
              {
                  this.trip.fillPerson();
              }
          }

      }

      This code makes two TextField controls get focus at the same time.
      Screenshot of the result:
      http://i.stack.imgur.com/RszF9.png

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                miflemi Mick Fleming (Inactive)
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: