public int fieldChanged ( boolean bDisplayOption , int moveMode ) { int iScreenNo = ( int ) ( ( NumberField ) m_owner ) . getValue ( ) ; if ( ( iScreenNo == - 1 ) || ( iScreenNo == m_iCurrentScreenNo ) ) return DBConstants . NORMAL_RETURN ; ScreenLocation screenLocation = null ; // First, find the current sub-screen this . setCurrentSubScreen ( null ) ; // Make your best guess as to the old sub-screen // Display wait cursor BaseAppletReference applet = null ; if ( m_screenParent . getTask ( ) instanceof BaseAppletReference ) applet = ( BaseAppletReference ) m_screenParent . getTask ( ) ; Object oldCursor = null ; if ( applet != null ) oldCursor = applet . setStatus ( DBConstants . WAIT , applet , null ) ; ScreenField sField = m_screenParent . getSField ( m_iScreenSeq ) ; if ( ( sField != null ) && ( sField instanceof BaseScreen ) ) { // First, get rid of the old screen screenLocation = sField . getScreenLocation ( ) ; m_screenParent = sField . getParentScreen ( ) ; sField . free ( ) ; sField = null ; if ( m_screenParent == null ) if ( this . getOwner ( ) . getComponent ( 0 ) instanceof ScreenField ) // Always m_screenParent = ( ( ScreenField ) this . getOwner ( ) . getComponent ( 0 ) ) . getParentScreen ( ) ; } if ( screenLocation == null ) screenLocation = m_screenParent . getNextLocation ( ScreenConstants . FLUSH_LEFT , ScreenConstants . FILL_REMAINDER ) ; sField = this . getSubScreen ( m_screenParent , screenLocation , null , iScreenNo ) ; if ( applet != null ) applet . setStatus ( 0 , applet , oldCursor ) ; if ( sField == null ) m_iCurrentScreenNo = - 1 ; else m_iCurrentScreenNo = iScreenNo ; return DBConstants . NORMAL_RETURN ; }
The Field has Changed . Get the value of this listener s field and setup the new sub - screen .