@ -771,13 +771,19 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            Area  a  =  p . getAreas ( ) . get ( 0 ) ; 
            Area  a  =  p . getAreas ( ) . get ( 0 ) ; 
 
			
		
	
		
		
			
				
					
					            showArea ( a ) ; 
            showArea ( a ) ; 
 
			
		
	
		
		
			
				
					
					            if ( a . getRiscos ( ) . size ( )  >  0 ) 
 
			
		
	
		
		
			
				
					
					            { 
 
			
		
	
		
		
			
				
					
					                Risco  r  =  a . getRiscos ( ) . get ( 0 ) ; 
                Risco  r  =  a . getRiscos ( ) . get ( 0 ) ; 
 
			
		
	
		
		
			
				
					
					                showRisco ( r ) ; 
                showRisco ( r ) ; 
 
			
		
	
		
		
			
				
					
					                //showValores(r);
 
                //showValores(r);
 
 
			
		
	
		
		
			
				
					
					            if ( r . getValores ( ) . size ( )  >  0 ) 
                ////if(r.getValores().size() > 0)
 
 
			
				
				
			
		
	
		
		
			
				
					
					            { 
                ////{
 
 
			
				
				
			
		
	
		
		
			
				
					
					                showValor ( r . getValores ( ) . get ( 0 ) ) ; 
//                    showValor(r.getValores().get(0));
  
			
				
				
			
		
	
		
		
			
				
					
					                showResponsavel ( r . getValores ( ) . get ( 0 ) ) ;             
                    showValor ( r ) ;                     
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					//                    showResponsavel(r.getValores().get(0));          
  
			
		
	
		
		
			
				
					
					                    showResponsavel ( r ) ;                                 
 
			
		
	
		
		
			
				
					
					                ////}
 
 
			
		
	
		
		
			
				
					
					                
 
			
		
	
		
		
			
				
					
					            } 
            } 
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        showPreviousValidacoes ( p ) ; 
        showPreviousValidacoes ( p ) ; 
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -863,14 +869,16 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					            pg . getChildren ( ) . add ( st ) ;             
            pg . getChildren ( ) . add ( st ) ;             
 
			
		
	
		
		
			
				
					
					            gridValor . getChildren ( ) . add ( pg ) ;     
            gridValor . getChildren ( ) . add ( pg ) ;     
 
			
		
	
		
		
			
				
					
					            
            
 
			
		
	
		
		
			
				
					
					            showMedidas ( v ) ; 
            showMedidas ( r ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					        }         
        }         
 
			
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					    
    
 
			
		
	
		
		
			
				
					
					    private  void  showValor ( Valor  v ) 
//    private void showValor(Valor v)
  
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					    private  void  showValor ( Risco  r )     
 
			
		
	
		
		
			
				
					
					    { 
    { 
 
			
		
	
		
		
			
				
					
					        //Valor v = r.getValores().get(0);
 
        //Valor v = r.getValores().get(0);
 
 
			
		
	
		
		
			
				
					
					        getSessionBean1 ( ) . setCurrentValor ( v ) ; 
//        getSessionBean1().setCurrentValor(v);
  
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					        getSessionBean1 ( ) . setCurrentRisco ( r ) ;         
 
			
		
	
		
		
			
				
					
					        HtmlPanelGrid  grd  =  new  HtmlPanelGrid ( ) ; 
        HtmlPanelGrid  grd  =  new  HtmlPanelGrid ( ) ; 
 
			
		
	
		
		
			
				
					
					        grd . setColumns ( 1 ) ; 
        grd . setColumns ( 1 ) ; 
 
			
		
	
		
		
			
				
					
					        grd . setColumnClasses ( "gridColLeft" ) ; 
        grd . setColumnClasses ( "gridColLeft" ) ; 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -893,24 +901,24 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        pg . getChildren ( ) . add ( st ) ; 
        pg . getChildren ( ) . add ( st ) ; 
 
			
		
	
		
		
			
				
					
					        st  =  new  StaticText ( ) ; 
        st  =  new  StaticText ( ) ; 
 
			
		
	
		
		
			
				
					
					        st . setEscape ( false ) ; 
        st . setEscape ( false ) ; 
 
			
		
	
		
		
			
				
					
					        if ( v . getValor ( )  = =  null ) 
        if ( r . getValor ( )  = =  null ) 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            st . setText ( " - " ) ; 
            st . setText ( " - " ) ; 
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        else 
        else 
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            st . setText ( v . getValor ( ) . toString ( ) ) ;            
            st . setText ( r . getValor ( ) . toString ( ) ) ;            
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					 
 
 
			
		
	
		
		
			
				
					
					        pg . getChildren ( ) . add ( st ) ;             
        pg . getChildren ( ) . add ( st ) ;             
 
			
		
	
		
		
			
				
					
					        gridValor . getChildren ( ) . add ( pg ) ;     
        gridValor . getChildren ( ) . add ( pg ) ;     
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					        showMedidas ( v ) ;         
        showMedidas ( r ) ;         
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					    
    
 
			
		
	
		
		
			
				
					
					    private  void  showMedidas ( Valor v  ) 
    private  void  showMedidas ( Risco r  ) 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					    { 
    { 
 
			
		
	
		
		
			
				
					
					        List < Medida >  medidas  =  v . getMedidas ( ) ; 
        List < Medida >  medidas  =  r . getMedidas ( ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					        
        
 
			
		
	
		
		
			
				
					
					        for ( Medida  m  :  medidas ) 
        for ( Medida  m  :  medidas ) 
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -976,7 +984,8 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					    
    
 
			
		
	
		
		
			
				
					
					    private  void  showResponsavel ( Valor  v ) 
//    private void showResponsavel(Valor v)
  
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					    private  void  showResponsavel ( Risco  r )     
 
			
		
	
		
		
			
				
					
					    { 
    { 
 
			
		
	
		
		
			
				
					
					        Utilizador  u  =  getSessionBean1 ( ) . getCurrentUser ( ) ; 
        Utilizador  u  =  getSessionBean1 ( ) . getCurrentUser ( ) ; 
 
			
		
	
		
		
			
				
					
					        gridResponsavel  =  new  HtmlPanelGrid ( ) ; 
        gridResponsavel  =  new  HtmlPanelGrid ( ) ; 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -998,14 +1007,14 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					            txtResponsavelExecucao  =  new  TextField ( ) ; 
            txtResponsavelExecucao  =  new  TextField ( ) ; 
 
			
		
	
		
		
			
				
					
					            txtResponsavelExecucao . setId ( "txtResponsavel" ) ; 
            txtResponsavelExecucao . setId ( "txtResponsavel" ) ; 
 
			
		
	
		
		
			
				
					
					            txtResponsavelExecucao . setColumns ( 100 ) ; 
            txtResponsavelExecucao . setColumns ( 100 ) ; 
 
			
		
	
		
		
			
				
					
					            txtResponsavelExecucao . setText ( v . getResponsavel_execucao ( ) ) ; 
            txtResponsavelExecucao . setText ( r . getResponsavel_execucao ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            pg . getChildren ( ) . add ( txtResponsavelExecucao ) ;             
            pg . getChildren ( ) . add ( txtResponsavelExecucao ) ;             
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        else 
        else 
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            st  =  new  StaticText ( ) ; 
            st  =  new  StaticText ( ) ; 
 
			
		
	
		
		
			
				
					
					            st . setEscape ( false ) ; 
            st . setEscape ( false ) ; 
 
			
		
	
		
		
			
				
					
					            st . setText ( v . getResponsavel_execucao ( ) ) ; 
            st . setText ( r . getResponsavel_execucao ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            pg . getChildren ( ) . add ( st ) ;                         
            pg . getChildren ( ) . add ( st ) ;                         
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        gridResponsavel . getChildren ( ) . add ( pg ) ; 
        gridResponsavel . getChildren ( ) . add ( pg ) ; 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1021,14 +1030,14 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					            txtRecursos  =  new  TextArea ( ) ; 
            txtRecursos  =  new  TextArea ( ) ; 
 
			
		
	
		
		
			
				
					
					            txtRecursos . setId ( "txtRecursos" ) ; 
            txtRecursos . setId ( "txtRecursos" ) ; 
 
			
		
	
		
		
			
				
					
					            txtRecursos . setColumns ( 200 ) ; 
            txtRecursos . setColumns ( 200 ) ; 
 
			
		
	
		
		
			
				
					
					            txtRecursos . setText ( v . getRecursos_necessarios ( ) ) ; 
            txtRecursos . setText ( r . getRecursos_necessarios ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            gridResponsavel . getChildren ( ) . add ( txtRecursos ) ;             
            gridResponsavel . getChildren ( ) . add ( txtRecursos ) ;             
 
			
		
	
		
		
			
				
					
					        }         
        }         
 
			
		
	
		
		
			
				
					
					        else 
        else 
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            st  =  new  StaticText ( ) ; 
            st  =  new  StaticText ( ) ; 
 
			
		
	
		
		
			
				
					
					            st . setEscape ( false ) ; 
            st . setEscape ( false ) ; 
 
			
		
	
		
		
			
				
					
					            st . setText ( v . getRecursos_necessarios ( ) ) ; 
            st . setText ( r . getRecursos_necessarios ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            //gridResponsavel.getChildren().add(st);                        
 
            //gridResponsavel.getChildren().add(st);                        
 
 
			
		
	
		
		
			
				
					
					            pg . getChildren ( ) . add ( st ) ;                                     
            pg . getChildren ( ) . add ( st ) ;                                     
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1049,7 +1058,7 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					            dtInicio . setId ( "dtInicio" ) ; 
            dtInicio . setId ( "dtInicio" ) ; 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					            dtInicio . setDateFormatPattern ( "dd-MM-yyyy" ) ; 
            dtInicio . setDateFormatPattern ( "dd-MM-yyyy" ) ; 
 
			
		
	
		
		
			
				
					
					            dtInicio . setValue ( v . getData_inicio ( ) ) ; 
            dtInicio . setValue ( r . getData_inicio ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            java . util . GregorianCalendar  gcalendar  =  new  java . util . GregorianCalendar ( ) ; 
            java . util . GregorianCalendar  gcalendar  =  new  java . util . GregorianCalendar ( ) ; 
 
			
		
	
		
		
			
				
					
					            gcalendar . set ( 2000 , 1 , 1 ) ; 
            gcalendar . set ( 2000 , 1 , 1 ) ; 
 
			
		
	
		
		
			
				
					
					            dtInicio . setMinDate ( gcalendar . getTime ( ) ) ; 
            dtInicio . setMinDate ( gcalendar . getTime ( ) ) ; 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1057,12 +1066,12 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        }   
        }   
 
			
		
	
		
		
			
				
					
					        else 
        else 
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            if ( v . getData_inicio ( )  ! =  null ) 
            if ( r . getData_inicio ( )  ! =  null ) 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            { 
            { 
 
			
		
	
		
		
			
				
					
					                st  =  new  StaticText ( ) ; 
                st  =  new  StaticText ( ) ; 
 
			
		
	
		
		
			
				
					
					                st . setEscape ( false ) ; 
                st . setEscape ( false ) ; 
 
			
		
	
		
		
			
				
					
					                SimpleDateFormat  formatter  =  new  SimpleDateFormat ( "dd/MM/yyyy" ) ; 
                SimpleDateFormat  formatter  =  new  SimpleDateFormat ( "dd/MM/yyyy" ) ; 
 
			
		
	
		
		
			
				
					
					                String  data_str  =  formatter . format ( v . getData_inicio ( ) ) ; 
                String  data_str  =  formatter . format ( r . getData_inicio ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					                st . setText ( data_str ) ; 
                st . setText ( data_str ) ; 
 
			
		
	
		
		
			
				
					
					                grd . getChildren ( ) . add ( st ) ;              
                grd . getChildren ( ) . add ( st ) ;              
 
			
		
	
		
		
			
				
					
					            } 
            } 
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -1089,17 +1098,17 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					            java . util . GregorianCalendar  gcalendar1  =  new  java . util . GregorianCalendar ( ) ; 
            java . util . GregorianCalendar  gcalendar1  =  new  java . util . GregorianCalendar ( ) ; 
 
			
		
	
		
		
			
				
					
					            gcalendar1 . set ( 2099 , 1 , 1 ) ; 
            gcalendar1 . set ( 2099 , 1 , 1 ) ; 
 
			
		
	
		
		
			
				
					
					            dtFim . setMaxDate ( gcalendar1 . getTime ( ) ) ;                 
            dtFim . setMaxDate ( gcalendar1 . getTime ( ) ) ;                 
 
			
		
	
		
		
			
				
					
					            dtFim . setValue ( v . getData_fim ( ) ) ;         
            dtFim . setValue ( r . getData_fim ( ) ) ;         
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            grd . getChildren ( ) . add ( dtFim ) ;                             
            grd . getChildren ( ) . add ( dtFim ) ;                             
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        else 
        else 
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            if ( v . getData_fim ( )  ! =  null ) 
            if ( r . getData_fim ( )  ! =  null ) 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            { 
            { 
 
			
		
	
		
		
			
				
					
					                st  =  new  StaticText ( ) ; 
                st  =  new  StaticText ( ) ; 
 
			
		
	
		
		
			
				
					
					                st . setEscape ( false ) ; 
                st . setEscape ( false ) ; 
 
			
		
	
		
		
			
				
					
					                SimpleDateFormat  formatter  =  new  SimpleDateFormat ( "dd/MM/yyyy" ) ; 
                SimpleDateFormat  formatter  =  new  SimpleDateFormat ( "dd/MM/yyyy" ) ; 
 
			
		
	
		
		
			
				
					
					                String  data_str  =  formatter . format ( v . getData_fim ( ) ) ; 
                String  data_str  =  formatter . format ( r . getData_fim ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					                st . setText ( data_str ) ; 
                st . setText ( data_str ) ; 
 
			
		
	
		
		
			
				
					
					                grd . getChildren ( ) . add ( st ) ;                                          
                grd . getChildren ( ) . add ( st ) ;                                          
 
			
		
	
		
		
			
				
					
					            } 
            } 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1109,9 +1118,9 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        
        
 
			
		
	
		
		
			
				
					
					        if ( u . getTipo ( ) . intValue ( )  ! =  Global . DIRECTOR_LOJA ) 
        if ( u . getTipo ( ) . intValue ( )  ! =  Global . DIRECTOR_LOJA ) 
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            if ( v . getParecer_dl ( )  ! =  null ) 
            if ( r . getParecer_dl ( )  ! =  null ) 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            { 
            { 
 
			
		
	
		
		
			
				
					
					                if ( v . getParecer_dl ( ) . trim ( ) . length ( )  >  0 ) 
                if ( r . getParecer_dl ( ) . trim ( ) . length ( )  >  0 ) 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					                { 
                { 
 
			
		
	
		
		
			
				
					
					                    pg  =  new  PanelGroup ( ) ; 
                    pg  =  new  PanelGroup ( ) ; 
 
			
		
	
		
		
			
				
					
					                    st  =  new  StaticText ( ) ; 
                    st  =  new  StaticText ( ) ; 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1133,7 +1142,7 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					//                    {
 //                    {
  
			
		
	
		
		
			
				
					
					                        st  =  new  StaticText ( ) ; 
                        st  =  new  StaticText ( ) ; 
 
			
		
	
		
		
			
				
					
					                        st . setEscape ( false ) ; 
                        st . setEscape ( false ) ; 
 
			
		
	
		
		
			
				
					
					                        st . setText ( v . getParecer_dl ( ) ) ; 
                        st . setText ( r . getParecer_dl ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					                        //gridResponsavel.getChildren().add(st);                                    
 
                        //gridResponsavel.getChildren().add(st);                                    
 
 
			
		
	
		
		
			
				
					
					                        pg . getChildren ( ) . add ( st ) ;                                                 
                        pg . getChildren ( ) . add ( st ) ;                                                 
 
			
		
	
		
		
			
				
					
					//                    }                
 //                    }                
  
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1153,7 +1162,7 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					            txtParecerDl  =  new  TextArea ( ) ; 
            txtParecerDl  =  new  TextArea ( ) ; 
 
			
		
	
		
		
			
				
					
					            txtParecerDl . setId ( "txtParecerDl" ) ; 
            txtParecerDl . setId ( "txtParecerDl" ) ; 
 
			
		
	
		
		
			
				
					
					            txtParecerDl . setColumns ( 200 ) ; 
            txtParecerDl . setColumns ( 200 ) ; 
 
			
		
	
		
		
			
				
					
					            txtParecerDl . setText ( v . getParecer_dl ( ) ) ; 
            txtParecerDl . setText ( r . getParecer_dl ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            gridResponsavel . getChildren ( ) . add ( txtParecerDl ) ;                         
            gridResponsavel . getChildren ( ) . add ( txtParecerDl ) ;                         
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        
        
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1161,9 +1170,9 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					        if ( u . getTipo ( ) . intValue ( )  ! =  Global . DIRECTOR_NACIONAL_SEGURANCA )        
        if ( u . getTipo ( ) . intValue ( )  ! =  Global . DIRECTOR_NACIONAL_SEGURANCA )        
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            if ( v . getParecer_dns ( )  ! =  null ) 
            if ( r . getParecer_dns ( )  ! =  null ) 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            { 
            { 
 
			
		
	
		
		
			
				
					
					                if ( v . getParecer_dns ( ) . trim ( ) . length ( )  >  0 ) 
                if ( r . getParecer_dns ( ) . trim ( ) . length ( )  >  0 ) 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					                { 
                { 
 
			
		
	
		
		
			
				
					
					                    pg  =  new  PanelGroup ( ) ; 
                    pg  =  new  PanelGroup ( ) ; 
 
			
		
	
		
		
			
				
					
					                    st  =  new  StaticText ( ) ; 
                    st  =  new  StaticText ( ) ; 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1185,7 +1194,7 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					//                    {
 //                    {
  
			
		
	
		
		
			
				
					
					                        st  =  new  StaticText ( ) ; 
                        st  =  new  StaticText ( ) ; 
 
			
		
	
		
		
			
				
					
					                        st . setEscape ( false ) ; 
                        st . setEscape ( false ) ; 
 
			
		
	
		
		
			
				
					
					                        st . setText ( v . getParecer_dns ( ) ) ; 
                        st . setText ( r . getParecer_dns ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					                        //gridResponsavel.getChildren().add(st);                                                
 
                        //gridResponsavel.getChildren().add(st);                                                
 
 
			
		
	
		
		
			
				
					
					                        pg . getChildren ( ) . add ( st ) ;                                                             
                        pg . getChildren ( ) . add ( st ) ;                                                             
 
			
		
	
		
		
			
				
					
					//                    }                    
 //                    }                    
  
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1206,7 +1215,7 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					            txtParecerDns  =  new  TextArea ( ) ; 
            txtParecerDns  =  new  TextArea ( ) ; 
 
			
		
	
		
		
			
				
					
					            txtParecerDns . setId ( "txtParecerDns" ) ; 
            txtParecerDns . setId ( "txtParecerDns" ) ; 
 
			
		
	
		
		
			
				
					
					            txtParecerDns . setColumns ( 200 ) ; 
            txtParecerDns . setColumns ( 200 ) ; 
 
			
		
	
		
		
			
				
					
					            txtParecerDns . setText ( v . getParecer_dns ( ) ) ; 
            txtParecerDns . setText ( r . getParecer_dns ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            gridResponsavel . getChildren ( ) . add ( txtParecerDns ) ;                         
            gridResponsavel . getChildren ( ) . add ( txtParecerDns ) ;                         
 
			
		
	
		
		
			
				
					
					            
            
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1214,9 +1223,9 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        //Verificacao SIPRP
 
        //Verificacao SIPRP
 
 
			
		
	
		
		
			
				
					
					        if ( u . getTipo ( ) . intValue ( )  ! =  Global . TECNICO_HS )         
        if ( u . getTipo ( ) . intValue ( )  ! =  Global . TECNICO_HS )         
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            if ( v . getVerificacao_siprp ( )  ! =  null ) 
            if ( r . getVerificacao_siprp ( )  ! =  null ) 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            { 
            { 
 
			
		
	
		
		
			
				
					
					                if ( v . getVerificacao_siprp ( ) . trim ( ) . length ( )  >  0 ) 
                if ( r . getVerificacao_siprp ( ) . trim ( ) . length ( )  >  0 ) 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					                {   
                {   
 
			
		
	
		
		
			
				
					
					                    pg  =  new  PanelGroup ( ) ; 
                    pg  =  new  PanelGroup ( ) ; 
 
			
		
	
		
		
			
				
					
					                    st  =  new  StaticText ( ) ; 
                    st  =  new  StaticText ( ) ; 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1238,7 +1247,7 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					//                    {
 //                    {
  
			
		
	
		
		
			
				
					
					                        st  =  new  StaticText ( ) ; 
                        st  =  new  StaticText ( ) ; 
 
			
		
	
		
		
			
				
					
					                        st . setEscape ( false ) ; 
                        st . setEscape ( false ) ; 
 
			
		
	
		
		
			
				
					
					                        st . setText ( v . getVerificacao_siprp ( ) ) ; 
                        st . setText ( r . getVerificacao_siprp ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					                        //gridResponsavel.getChildren().add(st);                                                
 
                        //gridResponsavel.getChildren().add(st);                                                
 
 
			
		
	
		
		
			
				
					
					                        pg . getChildren ( ) . add ( st ) ;                                                             
                        pg . getChildren ( ) . add ( st ) ;                                                             
 
			
		
	
		
		
			
				
					
					//                    }                                
 //                    }                                
  
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1259,7 +1268,7 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					            txtVerificacaoSiprp  =  new  TextArea ( ) ; 
            txtVerificacaoSiprp  =  new  TextArea ( ) ; 
 
			
		
	
		
		
			
				
					
					            txtVerificacaoSiprp . setId ( "txtVerificacaoSiprp" ) ; 
            txtVerificacaoSiprp . setId ( "txtVerificacaoSiprp" ) ; 
 
			
		
	
		
		
			
				
					
					            txtVerificacaoSiprp . setColumns ( 200 ) ; 
            txtVerificacaoSiprp . setColumns ( 200 ) ; 
 
			
		
	
		
		
			
				
					
					            txtVerificacaoSiprp . setText ( v . getVerificacao_siprp ( ) ) ; 
            txtVerificacaoSiprp . setText ( r . getVerificacao_siprp ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            gridResponsavel . getChildren ( ) . add ( txtVerificacaoSiprp ) ;                         
            gridResponsavel . getChildren ( ) . add ( txtVerificacaoSiprp ) ;                         
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        
        
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -1476,18 +1485,30 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        pdp . updatePlano ( p ) ; 
        pdp . updatePlano ( p ) ; 
 
			
		
	
		
		
			
				
					
					        
        
 
			
		
	
		
		
			
				
					
					        Valor  curValor  =  getSessionBean1 ( ) . getCurrentValor ( ) ; 
        //Valor curValor = getSessionBean1().getCurrentValor();
 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					        Risco  curValor  =  getSessionBean1 ( ) . getCurrentRisco ( ) ;         
 
			
		
	
		
		
			
				
					
					        curValor  =  fillValorFields ( curValor ) ; 
        curValor  =  fillValorFields ( curValor ) ; 
 
			
		
	
		
		
			
				
					
					        getSessionBean1 ( ) . getValoresHash ( ) . remove ( curValor . getId ( ) ) ; 
//        getSessionBean1().getValoresHash().remove(curValor.getId());
  
			
				
				
			
		
	
		
		
			
				
					
					        getSessionBean1 ( ) . getValoresHash ( ) . put ( curValor . getId ( ) ,  curValor ) ;         
//        getSessionBean1().getValoresHash().put(curValor.getId(), curValor);   
  
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					        getSessionBean1 ( ) . getRiscosHash ( ) . remove ( curValor . getId ( ) ) ; 
 
			
		
	
		
		
			
				
					
					        getSessionBean1 ( ) . getRiscosHash ( ) . put ( curValor . getId ( ) ,  curValor ) ;          
 
			
		
	
		
		
			
				
					
					        
 
			
		
	
		
		
			
				
					
					//        HashMap<Integer, Valor> valores = getSessionBean1().getValoresHash();
  
			
		
	
		
		
			
				
					
					//        Iterator<Integer> iter = valores.keySet().iterator();
  
			
		
	
		
		
			
				
					
					//        while(iter.hasNext())
  
			
		
	
		
		
			
				
					
					//        {
  
			
		
	
		
		
			
				
					
					//            Integer id = iter.next();
  
			
		
	
		
		
			
				
					
					//            Valor v = valores.get(id);
  
			
		
	
		
		
			
				
					
					//            pdp.updateValor(v);
  
			
		
	
		
		
			
				
					
					//        }
  
			
		
	
		
		
			
				
					
					        
        
 
			
		
	
		
		
			
				
					
					        HashMap < Integer ,  Valor >  valores  =  getSessionBean1 ( ) . getValoresHash ( ) ; 
        HashMap < Integer ,  Risco >  valores  =  getSessionBean1 ( ) . get Risco sHash( ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					        Iterator < Integer >  iter  =  valores . keySet ( ) . iterator ( ) ; 
        Iterator < Integer >  iter  =  valores . keySet ( ) . iterator ( ) ; 
 
			
		
	
		
		
			
				
					
					        while ( iter . hasNext ( ) ) 
        while ( iter . hasNext ( ) ) 
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            Integer  id  =  iter . next ( ) ; 
            Integer  id  =  iter . next ( ) ; 
 
			
		
	
		
		
			
				
					
					            Valor  v  =  valores . get ( id ) ; 
            Risco r   =  valores . get ( id ) ; 
 
			
				
				
			
		
	
		
		
			
				
					
					            pdp . updateValor ( v ) ; 
            pdp . update Risco( r  ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					        }         
        }         
 
			
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -1576,19 +1597,25 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					//            r = fillRiscoFields(r);
 //            r = fillRiscoFields(r);
  
			
		
	
		
		
			
				
					
					//            pdp.updateRisco(r);
 //            pdp.updateRisco(r);
  
			
		
	
		
		
			
				
					
					            
            
 
			
		
	
		
		
			
				
					
					            Valor  v  =  getSessionBean1 ( ) . getCurrentValor ( ) ; 
            //Valor v = getSessionBean1().getCurrentValor();
 
 
			
				
				
			
		
	
		
		
			
				
					
					            v  =  fillValorFields ( v ) ; 
            Risco  r  =  getSessionBean1 ( ) . getCurrentRisco ( ) ;             
 
			
				
				
			
		
	
		
		
			
				
					
					            pdp . updateValor ( v ) ; 
            r  =  fillValorFields ( r ) ; 
 
			
				
				
			
		
	
		
		
			
				
					
					            getSessionBean1 ( ) . getValoresHash ( ) . remove ( v . getId ( ) ) ; 
            //pdp.updateValor(r);
 
 
			
				
				
			
		
	
		
		
			
				
					
					            getSessionBean1 ( ) . getValoresHash ( ) . put ( v . getId ( ) ,  v ) ; 
            pdp . updateRisco ( r ) ;             
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					//            getSessionBean1().getValoresHash().remove(r.getId());
  
			
		
	
		
		
			
				
					
					//            getSessionBean1().getValoresHash().put(r.getId(), r);
  
			
		
	
		
		
			
				
					
					            getSessionBean1 ( ) . getRiscosHash ( ) . remove ( r . getId ( ) ) ; 
 
			
		
	
		
		
			
				
					
					            getSessionBean1 ( ) . getRiscosHash ( ) . put ( r . getId ( ) ,  r ) ;             
 
			
		
	
		
		
			
				
					
					            
            
 
			
		
	
		
		
			
				
					
					            Pagination  pagination  =  getSessionBean1 ( ) . getPagination ( ) ; 
            Pagination  pagination  =  getSessionBean1 ( ) . getPagination ( ) ; 
 
			
		
	
		
		
			
				
					
					            
            
 
			
		
	
		
		
			
				
					
					            ////r = pagination.nextRisco();
 
            ////r = pagination.nextRisco();
 
 
			
		
	
		
		
			
				
					
					            v  =  pagination . nextValor ( ) ; 
            r  =  pagination . nextValor ( ) ; 
 
			
				
				
			
		
	
		
		
			
				
					
					            Risco  r  =  getSessionBean1 ( ) . getRiscosHash ( ) . get ( v . getRisco_id ( ) ) ; 
            //Risco r = getSessionBean1().getRiscosHash().get(r.getId());
 
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					            ///////r = getSessionBean1().getRiscosHash().get(r.getId());            
 
 
			
		
	
		
		
			
				
					
					            Area  a  =  getSessionBean1 ( ) . getAreasHash ( ) . get ( r . getArea_id ( ) ) ; 
            Area  a  =  getSessionBean1 ( ) . getAreasHash ( ) . get ( r . getArea_id ( ) ) ; 
 
			
		
	
		
		
			
				
					
					            if ( v  ! =  null ) 
            //if(v != null)
 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            if ( r  ! =  null )                 
 
			
		
	
		
		
			
				
					
					            { 
            { 
 
			
		
	
		
		
			
				
					
					                //gridPlano = (HtmlPanelGrid) gridLayout.findComponent("form1:gridPlano");
 
                //gridPlano = (HtmlPanelGrid) gridLayout.findComponent("form1:gridPlano");
 
 
			
		
	
		
		
			
				
					
					                gridArea  =  ( HtmlPanelGrid )  gridPlano . findComponent ( "form1:gridArea" ) ; 
                gridArea  =  ( HtmlPanelGrid )  gridPlano . findComponent ( "form1:gridArea" ) ; 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1598,8 +1625,8 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					                }         
                }         
 
			
		
	
		
		
			
				
					
					                showArea ( a ) ; 
                showArea ( a ) ; 
 
			
		
	
		
		
			
				
					
					                showRisco ( r ) ; 
                showRisco ( r ) ; 
 
			
		
	
		
		
			
				
					
					                showValor ( v ) ;   
                showValor ( r ) ;   
 
			
				
				
			
		
	
		
		
			
				
					
					                showResponsavel ( v ) ;                     
                showResponsavel ( r ) ;                     
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					            }             
            }             
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        catch ( Exception  ex ) 
        catch ( Exception  ex ) 
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -1656,7 +1683,8 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					    
    
 
			
		
	
		
		
			
				
					
					    private  Valor  fillValorFields ( Valor  v ) 
//    private Valor fillValorFields(Valor v)
  
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					    private  Risco  fillValorFields ( Risco  r )     
 
			
		
	
		
		
			
				
					
					    { 
    { 
 
			
		
	
		
		
			
				
					
					        //gridPlano = (HtmlPanelGrid) gridLayout.findComponent("form1:gridPlano");        
 
        //gridPlano = (HtmlPanelGrid) gridLayout.findComponent("form1:gridPlano");        
 
 
			
		
	
		
		
			
				
					
					        gridArea  =  ( HtmlPanelGrid )  gridPlano . findComponent ( "form1:gridArea" ) ;         
        gridArea  =  ( HtmlPanelGrid )  gridPlano . findComponent ( "form1:gridArea" ) ;         
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1667,7 +1695,7 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            if ( txtResponsavel . getText ( )  ! =  null ) 
            if ( txtResponsavel . getText ( )  ! =  null ) 
 
			
		
	
		
		
			
				
					
					            { 
            { 
 
			
		
	
		
		
			
				
					
					                v . setResponsavel_execucao ( ( String )  txtResponsavel . getText ( ) ) ; 
                r . setResponsavel_execucao ( ( String )  txtResponsavel . getText ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            } 
            } 
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        
        
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1676,20 +1704,20 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            if ( txtRecursos . getText ( )  ! =  null ) 
            if ( txtRecursos . getText ( )  ! =  null ) 
 
			
		
	
		
		
			
				
					
					            { 
            { 
 
			
		
	
		
		
			
				
					
					                v . setRecursos_necessarios ( ( String )  txtRecursos . getText ( ) ) ; 
                r . setRecursos_necessarios ( ( String )  txtRecursos . getText ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            }             
            }             
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        
        
 
			
		
	
		
		
			
				
					
					        Calendar  dtInicio  =  ( Calendar )  gridResponsavel . findComponent ( "form1:dtInicio:" ) ; 
        Calendar  dtInicio  =  ( Calendar )  gridResponsavel . findComponent ( "form1:dtInicio:" ) ; 
 
			
		
	
		
		
			
				
					
					        if ( dtInicio  ! =  null ) 
        if ( dtInicio  ! =  null ) 
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            v . setData_inicio ( dtInicio . getSelectedDate ( ) ) ; 
            r . setData_inicio ( dtInicio . getSelectedDate ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        
        
 
			
		
	
		
		
			
				
					
					        Calendar  dtFim  =  ( Calendar )  gridResponsavel . findComponent ( "form1:dtFim" ) ; 
        Calendar  dtFim  =  ( Calendar )  gridResponsavel . findComponent ( "form1:dtFim" ) ; 
 
			
		
	
		
		
			
				
					
					        if ( dtFim  ! =  null ) 
        if ( dtFim  ! =  null ) 
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            v . setData_fim ( dtFim . getSelectedDate ( ) ) ;             
            r . setData_fim ( dtFim . getSelectedDate ( ) ) ;             
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					        }   
        }   
 
			
		
	
		
		
			
				
					
					        
        
 
			
		
	
		
		
			
				
					
					        TextArea  txtParecerDl  =  ( TextArea )  gridResponsavel . findComponent ( "form1:txtParecerDl" ) ; 
        TextArea  txtParecerDl  =  ( TextArea )  gridResponsavel . findComponent ( "form1:txtParecerDl" ) ; 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1697,7 +1725,7 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            if ( txtParecerDl . getText ( )  ! =  null ) 
            if ( txtParecerDl . getText ( )  ! =  null ) 
 
			
		
	
		
		
			
				
					
					            { 
            { 
 
			
		
	
		
		
			
				
					
					                v . setParecer_dl ( ( String )  txtParecerDl . getText ( ) ) ; 
                r . setParecer_dl ( ( String )  txtParecerDl . getText ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            }             
            }             
 
			
		
	
		
		
			
				
					
					        }     
        }     
 
			
		
	
		
		
			
				
					
					        
        
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1706,7 +1734,7 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            if ( txtParecerDns . getText ( )  ! =  null ) 
            if ( txtParecerDns . getText ( )  ! =  null ) 
 
			
		
	
		
		
			
				
					
					            { 
            { 
 
			
		
	
		
		
			
				
					
					                v . setParecer_dns ( ( String )  txtParecerDns . getText ( ) ) ; 
                r . setParecer_dns ( ( String )  txtParecerDns . getText ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            }             
            }             
 
			
		
	
		
		
			
				
					
					        }                 
        }                 
 
			
		
	
		
		
			
				
					
					        
        
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1715,11 +1743,11 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            if ( txtVerificacaoSiprp . getText ( )  ! =  null ) 
            if ( txtVerificacaoSiprp . getText ( )  ! =  null ) 
 
			
		
	
		
		
			
				
					
					            { 
            { 
 
			
		
	
		
		
			
				
					
					                v . setVerificacao_siprp ( ( String )  txtVerificacaoSiprp . getText ( ) ) ; 
                r . setVerificacao_siprp ( ( String )  txtVerificacaoSiprp . getText ( ) ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            }             
            }             
 
			
		
	
		
		
			
				
					
					        }                         
        }                         
 
			
		
	
		
		
			
				
					
					        
        
 
			
		
	
		
		
			
				
					
					        return  v ; 
        return  r ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    public  String  butEnviar_action ( )  { 
    public  String  butEnviar_action ( )  { 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -1729,10 +1757,11 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					        if ( planoValidationOk ( p ) ) 
        if ( planoValidationOk ( p ) ) 
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            Valor  curValor  =  getSessionBean1 ( ) . getCurrentValor ( ) ; 
            //Valor curValor = getSessionBean1().getCurrentValor();
 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            Risco  curValor  =  getSessionBean1 ( ) . getCurrentRisco ( ) ; 
 
			
		
	
		
		
			
				
					
					            curValor  =  fillValorFields ( curValor ) ; 
            curValor  =  fillValorFields ( curValor ) ; 
 
			
		
	
		
		
			
				
					
					            getSessionBean1 ( ) . get Valore sHash( ) . remove ( curValor . getId ( ) ) ; 
            getSessionBean1 ( ) . get Risco sHash( ) . remove ( curValor . getId ( ) ) ; 
 
			
				
				
			
		
	
		
		
			
				
					
					            getSessionBean1 ( ) . get Valore sHash( ) . put ( curValor . getId ( ) ,  curValor ) ;         
            getSessionBean1 ( ) . get Risco sHash( ) . put ( curValor . getId ( ) ,  curValor ) ;         
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					            if ( ! checkCamposObrigatorios ( ) ) 
            if ( ! checkCamposObrigatorios ( ) ) 
 
			
		
	
		
		
			
				
					
					            { 
            { 
 
			
		
	
		
		
			
				
					
					                getSessionBean1 ( ) . setMsg ( "Faltam preencher alguns riscos/valor. Por favor preencha todos os campos antes de prosseguir" ) ; 
                getSessionBean1 ( ) . setMsg ( "Faltam preencher alguns riscos/valor. Por favor preencha todos os campos antes de prosseguir" ) ; 
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -2262,26 +2291,31 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					    
    
 
			
		
	
		
		
			
				
					
					    private  void  fillValoresHash ( PlanoActuacao  p ) 
    private  void  fillValoresHash ( PlanoActuacao  p ) 
 
			
		
	
		
		
			
				
					
					    { 
    { 
 
			
		
	
		
		
			
				
					
					        HashMap < Integer ,  Valor >  valoresHash  =  new  HashMap < Integer ,  Valor > ( ) ; 
        //HashMap<Integer, Valor> valoresHash = new HashMap<Integer, Valor>();
 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					        HashMap < Integer ,  Risco >  riscosHash  =  new  HashMap < Integer ,  Risco > ( ) ;         
 
			
		
	
		
		
			
				
					
					        for ( Area  a  :  p . getAreas ( ) ) 
        for ( Area  a  :  p . getAreas ( ) ) 
 
			
		
	
		
		
			
				
					
					        { 
        { 
 
			
		
	
		
		
			
				
					
					            for ( Risco  r  :  a . getRiscos ( ) ) 
            for ( Risco  r  :  a . getRiscos ( ) ) 
 
			
		
	
		
		
			
				
					
					            { 
            { 
 
			
		
	
		
		
			
				
					
					                for ( Valor  v  :  r . getValores ( ) ) 
//                for(Valor v : r.getValores())
  
			
				
				
			
		
	
		
		
			
				
					
					                { 
//                {
  
			
				
				
			
		
	
		
		
			
				
					
					                    valoresHash . put ( v . getId ( ) ,  v ) ; 
//                    valoresHash.put(v.getId(), v);
  
			
				
				
			
		
	
		
		
			
				
					
					                } 
//                }
  
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					                riscosHash . put ( r . getId ( ) ,  r ) ; 
 
			
		
	
		
		
			
				
					
					            } 
            } 
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
		
		
			
				
					
					        getSessionBean1 ( ) . setValoresHash ( valoresHash ) ; 
        //getSessionBean1().setValoresHash(valoresHash);
 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					        getSessionBean1 ( ) . setRiscosHash ( riscosHash ) ;         
 
			
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					    
    
 
			
		
	
		
		
			
				
					
					    public  void  paginacao_actionListener ( ActionEvent  e ) 
    public  void  paginacao_actionListener ( ActionEvent  e ) 
 
			
		
	
		
		
			
				
					
					    { 
    { 
 
			
		
	
		
		
			
				
					
					        Valor curValor  =  getSessionBean1 ( ) . getCurrentValor  ( ) ; 
        Risco curValor  =  getSessionBean1 ( ) . getCurrentRisco  ( ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					        curValor  =  fillValorFields ( curValor ) ; 
        curValor  =  fillValorFields ( curValor ) ; 
 
			
		
	
		
		
			
				
					
					        getSessionBean1 ( ) . getValoresHash ( ) . remove ( curValor . getId ( ) ) ; 
//        getSessionBean1().getValoresHash().remove(curValor.getId());
  
			
				
				
			
		
	
		
		
			
				
					
					        getSessionBean1 ( ) . getValoresHash ( ) . put ( curValor . getId ( ) ,  curValor ) ; 
//        getSessionBean1().getValoresHash().put(curValor.getId(), curValor);
  
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					        getSessionBean1 ( ) . getRiscosHash ( ) . remove ( curValor . getId ( ) ) ; 
 
			
		
	
		
		
			
				
					
					        getSessionBean1 ( ) . getRiscosHash ( ) . put ( curValor . getId ( ) ,  curValor ) ;         
 
			
		
	
		
		
			
				
					
					        //gridPlano = (HtmlPanelGrid) gridLayout.findComponent("form1:gridPlano");
 
        //gridPlano = (HtmlPanelGrid) gridLayout.findComponent("form1:gridPlano");
 
 
			
		
	
		
		
			
				
					
					        gridArea  =  ( HtmlPanelGrid )  gridPlano . findComponent ( "form1:gridArea" ) ; 
        gridArea  =  ( HtmlPanelGrid )  gridPlano . findComponent ( "form1:gridArea" ) ; 
 
			
		
	
		
		
			
				
					
					        if ( gridArea . getChildren ( )  ! =  null ) 
        if ( gridArea . getChildren ( )  ! =  null ) 
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -2290,16 +2324,19 @@ public class EditarPlano extends AbstractPageBean {
 
			
		
	
		
		
			
				
					
					        }         
        }         
 
			
		
	
		
		
			
				
					
					        Pagina  pagina  =  ( Pagina )  e . getSource ( ) ;         
        Pagina  pagina  =  ( Pagina )  e . getSource ( ) ;         
 
			
		
	
		
		
			
				
					
					        Pagination  pagination  =  getSessionBean1 ( ) . getPagination ( ) ; 
        Pagination  pagination  =  getSessionBean1 ( ) . getPagination ( ) ; 
 
			
		
	
		
		
			
				
					
					        Valor  v  =  pagination . getValor ( pagina ) ;   
//        Valor v = pagination.getValor(pagina);  
  
			
				
				
			
		
	
		
		
			
				
					
					        v  =  getSessionBean1 ( ) . getValoresHash ( ) . get ( v . getId ( ) ) ; 
//        v = getSessionBean1().getValoresHash().get(v.getId());
  
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					        Risco  r  =  pagination . getValor ( pagina ) ;   
 
			
		
	
		
		
			
				
					
					        r  =  getSessionBean1 ( ) . getRiscosHash ( ) . get ( r . getId ( ) ) ; 
 
			
		
	
		
		
			
				
					
					        
 
			
		
	
		
		
			
				
					
					        //Risco r = getSessionBean1().getRiscosHash().get(v.getRisco_id());
 
        //Risco r = getSessionBean1().getRiscosHash().get(v.getRisco_id());
 
 
			
		
	
		
		
			
				
					
					        Risco  r  =  getSessionBean1 ( ) . getRiscosHash ( ) . get ( v . getRisco_id ( ) ) ;         
        /////////Risco r = getSessionBean1().getRiscosHash().get(v.getRisco_id());        
 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					        //Risco r = pagination.getRisco(pagina);
 
        //Risco r = pagination.getRisco(pagina);
 
 
			
		
	
		
		
			
				
					
					        Area  a  =  getSessionBean1 ( ) . getAreasHash ( ) . get (  r . getArea_id ( )  ) ;  
        Area  a  =  getSessionBean1 ( ) . getAreasHash ( ) . get (  r . getArea_id ( )  ) ;  
 
			
		
	
		
		
			
				
					
					        showArea ( a ) ; 
        showArea ( a ) ; 
 
			
		
	
		
		
			
				
					
					        showRisco ( r ) ; 
        showRisco ( r ) ; 
 
			
		
	
		
		
			
				
					
					        showValor ( v ) ;   
        showValor ( r ) ;   
 
			
				
				
			
		
	
		
		
			
				
					
					        showResponsavel ( v ) ;         
        showResponsavel ( r ) ;         
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    public  String  butCancelar_action ( )  { 
    public  String  butCancelar_action ( )  {