@Override public void processAction(ActionEvent actionEvent) throws AbortProcessingException { if (value == null) { throw new AbortProcessingException("Value has not been set"); } ELContext elContext = FacesContext.getCurrentInstance().getELContext(); Object val = value.getValue(elContext); if (addTo != null) { Collection collection = (Collection) addTo.getValue(elContext); Object uniqueValue = (unique != null) ? unique.getValue(elContext) : null; boolean checkUniqueness = (uniqueValue == null) ? true : Boolean.parseBoolean(uniqueValue.toString()); if (checkUniqueness) { if (!collection.contains(val)) { collection.add(val); } } else { collection.add(val); } } else if (removeFrom != null) { Collection collection = (Collection) removeFrom.getValue(elContext); collection.remove(val); } else { throw new IllegalArgumentException("Specify either addTo or removeFrom as collection reference"); } }
@Override public void endDocument() throws IOException { FacesContext context = FacesContext.getCurrentInstance(); PrimeRequestContext requestContext = PrimeRequestContext.getCurrentInstance(context); if (requestContext != null) { try { if (context.isValidationFailed()) { requestContext.getCallbackParams().put("validationFailed", true); } encodeCallbackParams(requestContext.getCallbackParams()); encodeScripts(requestContext); } catch (Exception e) { throw new AbortProcessingException(e); } } wrapped.endDocument(); }
throw new AbortProcessingException(e);
public void processEvent(SystemEvent event) throws AbortProcessingException { FacesContext context = FacesContext.getCurrentInstance(); try { calculateExtensionMapping(); calculateMappings(context, allResources, cssResources, imageResources); } catch (UnsupportedEncodingException e) { throw new AbortProcessingException(e); } }
public void processTreeToggle(org.richfaces.event.TreeToggleEvent actionEvent) throws AbortProcessingException { if (actionEvent == null) { throw new NullPointerException(); } FacesContext context = FacesContext.getCurrentInstance(); ELContext elContext = context.getELContext(); try { methodExpression.invoke(elContext, new Object[] { actionEvent }); } catch (Exception e) { new AbortProcessingException(e); } } }
public void processTreeToggle(org.richfaces.event.TreeToggleEvent actionEvent) throws AbortProcessingException { if (actionEvent == null) { throw new NullPointerException(); } FacesContext context = FacesContext.getCurrentInstance(); ELContext elContext = context.getELContext(); try { methodExpression.invoke(elContext, new Object[] { actionEvent }); } catch (Exception e) { new AbortProcessingException(e); } } }
public void processTreeSelectionChange(org.richfaces.event.TreeSelectionChangeEvent actionEvent) throws AbortProcessingException { if (actionEvent == null) { throw new NullPointerException(); } FacesContext context = FacesContext.getCurrentInstance(); ELContext elContext = context.getELContext(); try { methodExpression.invoke(elContext, new Object[] { actionEvent }); } catch (Exception e) { new AbortProcessingException(e); } } }
public void processTreeSelectionChange(org.richfaces.event.TreeSelectionChangeEvent actionEvent) throws AbortProcessingException { if (actionEvent == null) { throw new NullPointerException(); } FacesContext context = FacesContext.getCurrentInstance(); ELContext elContext = context.getELContext(); try { methodExpression.invoke(elContext, new Object[] { actionEvent }); } catch (Exception e) { new AbortProcessingException(e); } } }
protected UIDataTableBase findParent(AbstractCollapsibleSubTable subTable) { UIComponent parent = subTable.getParent(); while (parent != null && !(parent instanceof UIDataTableBase)) { parent = parent.getParent(); } if (parent == null) { // TODO: anton -> do we need this? throw new AbortProcessingException("UISubTable should be a child of UIDataTable or UISubTable"); } return (UIDataTableBase) parent; } }
public static void invokeMethodExpression( final FacesContext facesContext, final MethodExpression methodExpression, final FacesEvent event) { if (methodExpression != null && event != null) { try { methodExpression.invoke(facesContext.getELContext(), new Object[]{event}); } catch (final Exception e) { throw new AbortProcessingException(e); } } }
protected UIDataTableBase findParent(AbstractCollapsibleSubTable subTable) { UIComponent parent = subTable.getParent(); while (parent != null && !(parent instanceof UIDataTableBase)) { parent = parent.getParent(); } if (parent == null) { // TODO: anton -> do we need this? throw new AbortProcessingException("UISubTable should be a child of UIDataTable or UISubTable"); } return (UIDataTableBase) parent; } }
public void processAction(ActionEvent actionEvent) throws AbortProcessingException { try { Object[] params = new Object[]{actionEvent}; methodExpression.invoke(elContext(), params); } catch (Exception e) { throw new AbortProcessingException(e); } }
public void processValueChange(ValueChangeEvent event) throws AbortProcessingException { try { Object[] params = new Object[]{event}; methodExpression.invoke(elContext(), params); } catch (Exception e) { throw new AbortProcessingException(e); } }
public static void invokeMethodExpression( FacesContext facesContext, MethodExpression methodExpression, FacesEvent event) { if (methodExpression != null && event != null) { try { methodExpression.invoke(facesContext.getELContext(), new Object[]{event}); } catch (Exception e) { throw new AbortProcessingException(e); } } }
protected UIDataTableBase findParent(AbstractCollapsibleSubTable subTable) { UIComponent parent = subTable.getParent(); while (parent != null && !(parent instanceof UIDataTableBase)) { parent = parent.getParent(); } if (parent == null) { // TODO: anton -> do we need this? throw new AbortProcessingException("UISubTable should be a child of UIDataTable or UISubTable"); } return (UIDataTableBase) parent; } }
public void proxyChange(AjaxBehaviorEvent event) { UIComponent select = event.getComponent(); if (select instanceof ValueHolder) { proxyType = (String) ((ValueHolder) select).getValue(); } else { log.error("Bad component returned " + select); throw new AbortProcessingException("Bad component returned " + select); } Contexts.getEventContext().remove("setupParams"); FacesContext context = FacesContext.getCurrentInstance(); context.renderResponse(); }
public void proxyChange(AjaxBehaviorEvent event) { UIComponent select = event.getComponent(); if (select instanceof ValueHolder) { proxyType = (String) ((ValueHolder) select).getValue(); } else { log.error("Bad component returned " + select); throw new AbortProcessingException("Bad component returned " + select); } Contexts.getEventContext().remove("setupParams"); FacesContext context = FacesContext.getCurrentInstance(); context.renderResponse(); }
public void processEvent(ComponentSystemEvent event) throws AbortProcessingException { if (event instanceof PostRestoreStateEvent) { assertSame("Component did not match", this, event.getComponent()); this.postRestoreStateEventSeen = true; if (this.throwOnPostRestoreStateEvent) { this.abortProcessingException = new AbortProcessingException(); throw this.abortProcessingException; } } }
public RowHolderBase createRowHolder(FacesContext context, UIComponent component, Object[] options) { UIComponent parent = component.getParent(); while (parent != null && !(parent instanceof UIDataTableBase)) { parent = parent.getParent(); } if (parent == null) { throw new AbortProcessingException("UIColumnGroup should be a child of UIDataTable or UISubTable"); } RowHolder rowHolder = new RowHolder(context, (AbstractColumnGroup) component); rowHolder.setParentClientId(parent.getClientId(context)); return rowHolder; } }
public RowHolderBase createRowHolder(FacesContext context, UIComponent component, Object[] options) { UIComponent parent = component.getParent(); while (parent != null && !(parent instanceof UIDataTableBase)) { parent = parent.getParent(); } if (parent == null) { throw new AbortProcessingException("UIColumnGroup should be a child of UIDataTable or UISubTable"); } RowHolder rowHolder = new RowHolder(context, (AbstractColumnGroup) component); rowHolder.setParentClientId(parent.getClientId(context)); return rowHolder; } }