/** * <p class="changed_added_2_0">Return whether or not the view * parameters should be encoded into the target url.</p> * * @return <code>true</code> if the view parameters should be encoded in the url, <code>false</code> otherwise. * @since 2.0 */ public boolean isIncludeViewParams() { return (Boolean) getStateHelper().eval(PropertyKeys.includeViewParams, false); }
/** * <p>Create a new {@link UIOutcomeTarget} instance with default property * values.</p> */ public UIOutcomeTarget() { super(); setRendererType("javax.faces.Link"); }
@Override protected Object getValue(UIComponent component) { return ((UIOutcomeTarget) component).getValue(); }
public static String getOutcomeTargetHref( FacesContext facesContext, UIOutcomeTarget component) throws IOException { String outcome = component.getOutcome(); outcome = ((outcome == null) ? STR_EMPTY : outcome.trim()); facesContext, component.getChildren(), true, false); for (UIParameter param : validParams) { String name = param.getName(); String href = viewHandler.getBookmarkableURL(facesContext, navigationCase.getToViewId(facesContext), parameters, navigationCase.isIncludeViewParams() || component.isIncludeViewParams()); String fragment = (String) component.getAttributes().get("fragment"); if (fragment != null) { fragment = fragment.trim();
protected boolean isIncludeViewParams(UIComponent component, NavigationCase navcase) { return (((UIOutcomeTarget) component).isIncludeViewParams() || navcase.isIncludeViewParams()); }
/** * Invoke the {@link NavigationHandler} preemptively to resolve a {@link NavigationCase} for the outcome declared on the * {@link UIOutcomeTarget} component. The current view id is used as the from-view-id when matching navigation cases and the from-action * is assumed to be null. * * @param context the {@link FacesContext} for the current request * @param component the target {@link UIComponent} * * @return the NavigationCase represeting the outcome target */ protected NavigationCase getNavigationCase(final FacesContext context, final UIComponent component) { NavigationHandler navHandler = context.getApplication().getNavigationHandler(); if (!(navHandler instanceof ConfigurableNavigationHandler)) { log.warn("jsf.outcome.target.invalid.navigationhandler.type Componente:" + component.getId()); return null; } String outcome = ((UIOutcomeTarget) component).getOutcome(); if (outcome == null) { outcome = context.getViewRoot().getViewId(); // QUESTION should we avoid the call to getNavigationCase() and instead instantiate one explicitly? // String viewId = context.getViewRoot().getViewId(); // return new NavigationCase(viewId, null, null, null, viewId, false, false); } NavigationCase navCase = ((ConfigurableNavigationHandler) navHandler).getNavigationCase(context, null, outcome); if (navCase == null) { log.warn("jsf.outcometarget.navigation.case.not.resolved Componente:" + component.getId()); } return navCase; }
output.getAttributes().put(END_LINK_OUTCOME_AS_SPAN, Boolean.TRUE); writer.startElement(HTML.SPAN_ELEM, output); if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext())) Object value = output.getValue();
@JSFProperty public String getOutcome() { String outcome = (String) getStateHelper().eval(PropertyKeys.outcome); if(outcome == null && isInView()) //default to the view id { return getFacesContext().getViewRoot().getViewId(); } return outcome; }
paramComponent.setName(hdivParameter); paramComponent.setValue(stateParam); component.getChildren().add(paramComponent);
public static String getOutcomeTargetHref( FacesContext facesContext, UIOutcomeTarget component) throws IOException { String outcome = component.getOutcome(); outcome = (outcome == null) ? facesContext.getViewRoot().getViewId() : outcome; outcome = ((outcome == null) ? STR_EMPTY : outcome.trim()); if (component.getChildCount() > 0) facesContext, component.getChildren(), true, false); for (UIParameter param : validParams) { String name = param.getName(); String href = viewHandler.getBookmarkableURL(facesContext, navigationCase.getToViewId(facesContext), parameters, navigationCase.isIncludeViewParams() || component.isIncludeViewParams()); String fragment = (String) component.getAttributes().get("fragment"); if (fragment != null) { fragment = fragment.trim();
protected boolean isIncludeViewParams(UIComponent component, NavigationCase navcase) { return (((UIOutcomeTarget) component).isIncludeViewParams() || navcase.isIncludeViewParams()); }
String outcome = ((UIOutcomeTarget) component).getOutcome(); if (outcome == null) { outcome = context.getViewRoot().getViewId();
output.getAttributes().put(END_LINK_OUTCOME_AS_SPAN, Boolean.TRUE); writer.startElement(HTML.SPAN_ELEM, output); if (output instanceof ClientBehaviorHolder && JavascriptUtils.isJavascriptAllowed(facesContext.getExternalContext())) Object value = output.getValue();
/** * <p class="changed_added_2_2">Return whether or not the client window * should be encoded into the target url.</p> * * @return <code>true</code> if the client window should NOT be encoded in the url, <code>false</code> otherwise. * @since 2.0 */ public boolean isDisableClientWindow() { return (Boolean) getStateHelper().eval(PropertyKeys.disableClientWindow, false); }
public static String getOutcomeTargetHref(FacesContext facesContext, UIOutcomeTarget component) throws IOException String outcome = component.getOutcome(); outcome = (outcome == null) ? facesContext.getViewRoot().getViewId() : outcome; String toFlowDocumentId = (String) component.getAttributes().get( JSFAttr.TO_FLOW_DOCUMENT_ID_ATTR); if (component.getChildCount() > 0) facesContext, component.getChildren(), true, false); if (validParams.size() > 0) boolean disableClientWindow = component.isDisableClientWindow(); ClientWindow clientWindow = facesContext.getExternalContext().getClientWindow(); String href; href = viewHandler.getBookmarkableURL(facesContext, navigationCase.getToViewId(facesContext), parameters, navigationCase.isIncludeViewParams() || component.isIncludeViewParams()); String fragment = (String) component.getAttributes().get("fragment"); if (fragment != null)
/** * <p>Create a new {@link UIOutcomeTarget} instance with default property * values.</p> */ public UIOutcomeTarget() { super(); setRendererType("javax.faces.Link"); }
@Override protected Object getValue(UIComponent component) { return ((UIOutcomeTarget) component).getValue(); }
protected boolean isIncludeViewParams(UIComponent component, NavigationCase navcase) { return (((UIOutcomeTarget) component).isIncludeViewParams() || navcase.isIncludeViewParams()); }
String outcome = ((UIOutcomeTarget) component).getOutcome(); if (outcome == null) { outcome = context.getViewRoot().getViewId();
/** * <p class="changed_added_2_2">Return whether or not the client window * should be encoded into the target url.</p> * * @return <code>true</code> if the client window should NOT be encoded in the url, <code>false</code> otherwise. * @since 2.0 */ public boolean isDisableClientWindow() { return (Boolean) getStateHelper().eval(PropertyKeys.disableClientWindow, false); }