public boolean onBack ( ) { BasePanel parent = this . getParentScreen ( ) ; if ( parent == null ) return false ; parent . popHistory ( 1 , false ) ; // Pop command for this screen String strLastCommand = parent . popHistory ( 1 , false ) ; if ( strLastCommand != null ) // I don't back up into the browser history if the user hit the java back button. { // If that wasn't the first screen, redo pop and update the browser this time parent . pushHistory ( strLastCommand , false ) ; strLastCommand = parent . popHistory ( 1 , true ) ; } if ( ( strLastCommand == null ) || ( strLastCommand . length ( ) == 0 ) ) { if ( parent . getParentScreen ( ) != null ) if ( ! ( parent . getParentScreen ( ) instanceof FrameScreen ) ) return parent . onBack ( ) ; // ++Add++ No more to pop, display home screen (if push-down gets messed up) parent . pushHistory ( this . getScreenURL ( ) , false ) ; // This is the first screen in the stack } else this . handleCommand ( strLastCommand , this , ScreenConstants . USE_SAME_WINDOW | ScreenConstants . DONT_PUSH_TO_BROWSER ) ; // Process the last command return true ; // Handled }
Process the Back toolbar command .