private List<ActionLink> getActionLinks(UIComponent component) { List<ActionLink> links = new ArrayList<ActionLink>(); List<UIComponent> children = component.getChildren(); for (Object child : children) { if (child instanceof HtmlOutputLink) { HtmlOutputLink link = (HtmlOutputLink) child; boolean rendered = link.isRendered(); if (rendered) { List<UIComponent> linkChildren = link.getChildren(); String name = null; String action = null; Object value = link.getValue(); if (value != null) { action = value.toString(); } if (linkChildren != null && !linkChildren.isEmpty()) { Object linkChild = linkChildren.get(0); name = linkChild.toString(); } if (name != null && !name.equals("") && action != null && !action.equals("")) { links.add(new ActionLink(name, action)); } } } } return links; }
private List<ActionLink> getActionLinks(UIComponent component) { List<ActionLink> links = new ArrayList<>(); List<UIComponent> children = component.getChildren(); for (Object child : children) { if (child instanceof HtmlOutputLink) { HtmlOutputLink link = (HtmlOutputLink) child; boolean rendered = link.isRendered(); if (rendered) { List<UIComponent> linkChildren = link.getChildren(); String name = null; String action = null; Object value = link.getValue(); if (value != null) { action = value.toString(); } if (linkChildren != null && !linkChildren.isEmpty()) { Object linkChild = linkChildren.get(0); name = linkChild.toString(); } if (name != null && !name.equals("") && action != null && !action.equals("")) { links.add(new ActionLink(name, action)); } } } } return links; }
protected String buildHref(FacesContext context, HtmlOutputLink htmlOutputLink, String encoding) throws IOException { UrlBuilder urlBuilder = new UrlBuilder(); urlBuilder.setBase(ValueHolderUtil.getValueForRender(context, htmlOutputLink)); for (Iterator it = htmlOutputLink.getChildren().iterator(); it .hasNext();) { UIComponent child = (UIComponent) it.next(); if (child instanceof UIParameter) { UIParameter parameter = (UIParameter) child; urlBuilder.add( URLEncoder.encode(parameter.getName(), encoding), URLEncoder.encode(toBlankIfNull(parameter.getValue()), encoding)); } } if (WindowIdUtil.isNewWindowTarget(htmlOutputLink.getTarget())) { urlBuilder.add(WindowIdUtil.NEWWINDOW, JsfConstants.TRUE); } return context.getExternalContext().encodeResourceURL( urlBuilder.build()); }
final HtmlOutputLink link = (HtmlOutputLink) component; final List<UIComponent> children = link.getChildren(); if (children != null) { return exportValue(context, children.get(0));
urlBuilder.setBase(base); urlBuilder.setParameterDelimiter("&"); for (Iterator it = htmlOutputLink.getChildren().iterator(); it .hasNext();) { UIComponent child = (UIComponent) it.next(); urlBuilder.setBase(sufiixedBase); urlBuilder.setParameterDelimiter("&"); for (Iterator it = htmlOutputLink.getChildren().iterator(); it .hasNext();) { UIComponent child = (UIComponent) it.next();
for (UIComponent comp : component.getChildren()) { if (comp instanceof UIParameter) { UIParameter param = (UIParameter) comp; component.getChildren().add(paramComponent);
HtmlOutputLink anchor = new HtmlOutputLink(); anchor.setValue(link); anchor.getChildren().add(text);