code: public boolean onLogin()
      {
          SStaticString sfStaticField = null;
          String strUserName = null;
          String strPassword = null;
          for (int i = 0; i < this.getSFieldCount(); i++)
          {
              ScreenField sField = this.getSField(i);
              if (sfStaticField == null)
                  if (sField instanceof SStaticString)
                      sfStaticField = (SStaticString)sField;
              if (sField.getConverter() != null)
                  if (DBParams.USER_NAME.equalsIgnoreCase(sField.getConverter().getFieldName()))
                      strUserName = sField.getConverter().getField().toString();
              if (sField.getConverter() != null)
                  if (DBParams.PASSWORD.equalsIgnoreCase(sField.getConverter().getFieldName()))
                      strPassword = sField.getConverter().getField().toString();
          }
          if (strUserName == null)
              return false;
          
          App application = this.getTask().getApplication();
          int iErrorCode = application.login(this.getTask(), strUserName, strPassword, this.getProperty(DBParams.DOMAIN));
          
          if (iErrorCode == DBConstants.NORMAL_RETURN)
          {
              String strLastCommand = null;
              BasePanel parent = this.getParentScreen();
              int iUseSameWindow = ScreenConstants.USE_SAME_WINDOW | ScreenConstants.PUSH_TO_BROWSER;
              if (parent != null)
              {
                  strLastCommand = parent.popHistory(1, false);
                  iUseSameWindow = ScreenConstants.USE_SAME_WINDOW | ScreenConstants.DONT_PUSH_TO_BROWSER;
              }
              else
                  strLastCommand = this.getScreenURL();
              
              this.handleCommand(strLastCommand, this, iUseSameWindow);     // Process the last command
          }
          else
          {
              String strError = this.getTask().getLastError(iErrorCode);
              if (strError != null)
                  if (sfStaticField != null)
                      sfStaticField.setString(strError);
              try {
                  Thread.sleep(3000);     // Wait 3 seconds if bad password
              } catch (InterruptedException ex) {
                  ex.printStackTrace();   // Never
              }
          }
  
          return (iErrorCode == DBConstants.NORMAL_RETURN);    // Handled
      }
docs: Process the "Login" toolbar command.
  @return true if successful.