|
|
|
|
@ -31,10 +31,10 @@ import db.providers.PlanosDataProvider;
|
|
|
|
|
import db.providers.UtilizadoresDataProvider;
|
|
|
|
|
import global.Global;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Iterator;
|
|
|
|
|
import java.util.LinkedList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.ListIterator;
|
|
|
|
|
import java.util.Vector;
|
|
|
|
|
@ -1463,58 +1463,122 @@ public class EditarPlano extends AbstractPageBean
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static final int MAX_PAGES_PER_LINE = 20;
|
|
|
|
|
|
|
|
|
|
private void setPagination()
|
|
|
|
|
{
|
|
|
|
|
StaticText st = null;
|
|
|
|
|
|
|
|
|
|
Class[] argtypes = new Class[ 1 ];
|
|
|
|
|
argtypes[ 0 ] = ActionEvent.class;
|
|
|
|
|
MethodExpression me = ( MethodExpression ) this.getApplication().getExpressionFactory().createMethodExpression(
|
|
|
|
|
getFacesContext().getELContext(), "#{EditarPlano.paginacao_actionListener}", null, argtypes );
|
|
|
|
|
|
|
|
|
|
if(grpPagination.getChildCount() > 0)
|
|
|
|
|
if ( gridPagination.getChildCount() > 0 )
|
|
|
|
|
{
|
|
|
|
|
grpPagination.getChildren().clear();
|
|
|
|
|
gridPagination.getChildren().clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PanelGroup group = new PanelGroup();
|
|
|
|
|
|
|
|
|
|
Pagination pagination = getSessionBean1().getPagination();
|
|
|
|
|
Vector< Pagina > paginas = pagination.getPaginas();
|
|
|
|
|
for(Pagina pagina : paginas)
|
|
|
|
|
|
|
|
|
|
for ( int p = 0; p < paginas.size(); p++ )
|
|
|
|
|
{
|
|
|
|
|
Pagina pagina = paginas.get( p );
|
|
|
|
|
|
|
|
|
|
if ( p > 0 && p % MAX_PAGES_PER_LINE == 0 )
|
|
|
|
|
{
|
|
|
|
|
gridPagination.getChildren().add( group );
|
|
|
|
|
group = new PanelGroup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( pagina.isPrevious() )
|
|
|
|
|
{
|
|
|
|
|
pagina.addActionListener( new MethodExpressionActionListener( me ) );
|
|
|
|
|
grpPagination.getChildren().add(pagina);
|
|
|
|
|
group.getChildren().add( pagina );
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape( false );
|
|
|
|
|
st.setText( " " );
|
|
|
|
|
grpPagination.getChildren().add(st);
|
|
|
|
|
group.getChildren().add( st );
|
|
|
|
|
}
|
|
|
|
|
else if ( pagina.isNext() )
|
|
|
|
|
{
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape( false );
|
|
|
|
|
st.setText( " " );
|
|
|
|
|
grpPagination.getChildren().add(st);
|
|
|
|
|
group.getChildren().add( st );
|
|
|
|
|
pagina.addActionListener( new MethodExpressionActionListener( me ) );
|
|
|
|
|
grpPagination.getChildren().add(pagina);
|
|
|
|
|
group.getChildren().add( pagina );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pagina.addActionListener( new MethodExpressionActionListener( me ) );
|
|
|
|
|
grpPagination.getChildren().add(pagina);
|
|
|
|
|
group.getChildren().add( pagina );
|
|
|
|
|
if ( pagina.getPage_nr().intValue() < pagination.totalPaginas() )
|
|
|
|
|
{
|
|
|
|
|
st = new StaticText();
|
|
|
|
|
st.setEscape( false );
|
|
|
|
|
st.setText( " | " );
|
|
|
|
|
grpPagination.getChildren().add(st);
|
|
|
|
|
group.getChildren().add( st );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gridPagination.getChildren().add( group );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// private void setPagination()
|
|
|
|
|
// {
|
|
|
|
|
// StaticText st = null;
|
|
|
|
|
//
|
|
|
|
|
// Class[] argtypes = new Class[1];
|
|
|
|
|
// argtypes[0] = ActionEvent.class;
|
|
|
|
|
// MethodExpression me = (MethodExpression)this.getApplication().getExpressionFactory().createMethodExpression(
|
|
|
|
|
// getFacesContext().getELContext(), "#{EditarPlano.paginacao_actionListener}", null,argtypes);
|
|
|
|
|
//
|
|
|
|
|
// if(grpPagination.getChildCount() > 0)
|
|
|
|
|
// {
|
|
|
|
|
// grpPagination.getChildren().clear();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// Pagination pagination = getSessionBean1().getPagination();
|
|
|
|
|
// Vector<Pagina> paginas = pagination.getPaginas();
|
|
|
|
|
// for(Pagina pagina : paginas)
|
|
|
|
|
// {
|
|
|
|
|
// if ( pagina.isPrevious() )
|
|
|
|
|
// {
|
|
|
|
|
// pagina.addActionListener( new MethodExpressionActionListener( me ) );
|
|
|
|
|
// grpPagination.getChildren().add( pagina );
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape( false );
|
|
|
|
|
// st.setText( " " );
|
|
|
|
|
// grpPagination.getChildren().add( st );
|
|
|
|
|
// }
|
|
|
|
|
// else if ( pagina.isNext() )
|
|
|
|
|
// {
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape( false );
|
|
|
|
|
// st.setText( " " );
|
|
|
|
|
// grpPagination.getChildren().add( st );
|
|
|
|
|
// pagina.addActionListener( new MethodExpressionActionListener( me ) );
|
|
|
|
|
// grpPagination.getChildren().add( pagina );
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
// pagina.addActionListener( new MethodExpressionActionListener( me ) );
|
|
|
|
|
// grpPagination.getChildren().add( pagina );
|
|
|
|
|
// if ( pagina.getPage_nr().intValue() < pagination.totalPaginas() )
|
|
|
|
|
// {
|
|
|
|
|
// st = new StaticText();
|
|
|
|
|
// st.setEscape( false );
|
|
|
|
|
// st.setText( " | " );
|
|
|
|
|
// grpPagination.getChildren().add( st );
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
public String butGravarPlano_action()
|
|
|
|
|
{
|
|
|
|
|
String page = null;
|
|
|
|
|
|