|
|
|
@ -2,13 +2,11 @@
|
|
|
|
* To change this template, choose Tools | Templates
|
|
|
|
* To change this template, choose Tools | Templates
|
|
|
|
* and open the template in the editor.
|
|
|
|
* and open the template in the editor.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
package viewhandler;
|
|
|
|
package viewhandler;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.Locale;
|
|
|
|
import java.util.Locale;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import javax.el.ValueExpression;
|
|
|
|
|
|
|
|
import javax.faces.FacesException;
|
|
|
|
import javax.faces.FacesException;
|
|
|
|
import javax.faces.application.ViewHandler;
|
|
|
|
import javax.faces.application.ViewHandler;
|
|
|
|
import javax.faces.component.UIViewRoot;
|
|
|
|
import javax.faces.component.UIViewRoot;
|
|
|
|
@ -18,58 +16,77 @@ import javax.faces.context.FacesContext;
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author lluis
|
|
|
|
* @author lluis
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class CustomViewHandler extends ViewHandler{
|
|
|
|
public class CustomViewHandler extends ViewHandler
|
|
|
|
protected ViewHandler baseViewHandler;
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected ViewHandler baseViewHandler;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public CustomViewHandler( ViewHandler viewHandler )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
super();
|
|
|
|
|
|
|
|
this.baseViewHandler = viewHandler;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public CustomViewHandler(ViewHandler viewHandler) {
|
|
|
|
@Override
|
|
|
|
super();
|
|
|
|
public Locale calculateLocale( FacesContext facesContext )
|
|
|
|
this.baseViewHandler = viewHandler;
|
|
|
|
{
|
|
|
|
}
|
|
|
|
return baseViewHandler.calculateLocale( facesContext );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Locale calculateLocale(FacesContext facesContext) {
|
|
|
|
@Override
|
|
|
|
return baseViewHandler.calculateLocale(facesContext);
|
|
|
|
public String calculateRenderKitId( FacesContext facesContext )
|
|
|
|
}
|
|
|
|
{
|
|
|
|
|
|
|
|
return baseViewHandler.calculateRenderKitId( facesContext );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String calculateRenderKitId(FacesContext facesContext) {
|
|
|
|
@Override
|
|
|
|
return baseViewHandler.calculateRenderKitId(facesContext);
|
|
|
|
public UIViewRoot createView( FacesContext facesContext, String arg1 )
|
|
|
|
}
|
|
|
|
{
|
|
|
|
|
|
|
|
setPostback( facesContext, false );
|
|
|
|
|
|
|
|
return baseViewHandler.createView( facesContext, arg1 );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public UIViewRoot createView(FacesContext facesContext, String arg1) {
|
|
|
|
@Override
|
|
|
|
setPostback(facesContext, false);
|
|
|
|
public String getActionURL( FacesContext facesContext, String arg1 )
|
|
|
|
return baseViewHandler.createView(facesContext, arg1);
|
|
|
|
{
|
|
|
|
}
|
|
|
|
return baseViewHandler.getActionURL( facesContext, arg1 );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getActionURL(FacesContext facesContext, String arg1) {
|
|
|
|
@Override
|
|
|
|
return baseViewHandler.getActionURL(facesContext, arg1);
|
|
|
|
public String getResourceURL( FacesContext facesContext, String arg1 )
|
|
|
|
}
|
|
|
|
{
|
|
|
|
|
|
|
|
return baseViewHandler.getResourceURL( facesContext, arg1 );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getResourceURL(FacesContext facesContext, String arg1) {
|
|
|
|
@Override
|
|
|
|
return baseViewHandler.getResourceURL(facesContext, arg1);
|
|
|
|
public void renderView( FacesContext facesContext, UIViewRoot arg1 ) throws IOException, FacesException
|
|
|
|
}
|
|
|
|
{
|
|
|
|
|
|
|
|
baseViewHandler.renderView( facesContext, arg1 );
|
|
|
|
|
|
|
|
|
|
|
|
public void renderView(FacesContext facesContext, UIViewRoot arg1) throws IOException, FacesException {
|
|
|
|
}
|
|
|
|
baseViewHandler.renderView(facesContext, arg1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public UIViewRoot restoreView(FacesContext facesContext, String arg1) {
|
|
|
|
@Override
|
|
|
|
setPostback(facesContext, true);
|
|
|
|
public UIViewRoot restoreView( FacesContext facesContext, String arg1 )
|
|
|
|
return baseViewHandler.restoreView(facesContext, arg1);
|
|
|
|
{
|
|
|
|
}
|
|
|
|
setPostback( facesContext, true );
|
|
|
|
|
|
|
|
return baseViewHandler.restoreView( facesContext, arg1 );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void writeState(FacesContext facesContext) throws IOException {
|
|
|
|
@Override
|
|
|
|
baseViewHandler.writeState(facesContext);
|
|
|
|
public void writeState( FacesContext facesContext ) throws IOException
|
|
|
|
}
|
|
|
|
{
|
|
|
|
|
|
|
|
baseViewHandler.writeState( facesContext );
|
|
|
|
public Map getRequestScope(FacesContext facesContext) {
|
|
|
|
}
|
|
|
|
//return (Map)facesContext.getApplication().createValueBinding(?#{requestScope}?).getValue(facesContext);
|
|
|
|
|
|
|
|
//return (Map)facesContext.getApplication().
|
|
|
|
|
|
|
|
return (Map) facesContext.getApplication().getExpressionFactory().createValueExpression(facesContext.getELContext(), "#{requestScope}", Map.class).getValue(facesContext.getELContext());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setPostback(FacesContext facesContext, boolean value) {
|
|
|
|
|
|
|
|
getRequestScope(facesContext).put("ispostback", new Boolean(value));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Map getRequestScope( FacesContext facesContext )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//return (Map)facesContext.getApplication().createValueBinding(?#{requestScope}?).getValue(facesContext);
|
|
|
|
|
|
|
|
//return (Map)facesContext.getApplication().
|
|
|
|
|
|
|
|
return ( Map ) facesContext.getApplication().getExpressionFactory().createValueExpression( facesContext.getELContext(), "#{requestScope}", Map.class ).getValue( facesContext.getELContext() );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setPostback( FacesContext facesContext, boolean value )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
getRequestScope( facesContext ).put( "ispostback", new Boolean( value ) );
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|