/** * See taglib documentation. */ public void apply(FaceletContext ctx, UIComponent parent) throws IOException { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); ResourceBundle bundle = null; try { String name = this.basename.getValue(ctx); ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (root != null && root.getLocale() != null) { bundle = ResourceBundle.getBundle(name, root.getLocale(), cl); } else { bundle = ResourceBundle .getBundle(name, Locale.getDefault(), cl); } } catch (Exception e) { throw new TagAttributeException(this.tag, this.basename, e); } ResourceBundleMap map = new ResourceBundleMap(bundle); FacesContext faces = ctx.getFacesContext(); faces.getExternalContext().getRequestMap().put(this.var.getValue(ctx), map); } }
/** * See taglib documentation. */ @Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); ResourceBundle bundle = null; try { String name = this.basename.getValue(ctx); ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (root != null && root.getLocale() != null) { bundle = ResourceBundle.getBundle(name, root.getLocale(), cl); } else { bundle = ResourceBundle .getBundle(name, Locale.getDefault(), cl); } } catch (Exception e) { throw new TagAttributeException(this.tag, this.basename, e); } ResourceBundleMap map = new ResourceBundleMap(bundle); FacesContext faces = ctx.getFacesContext(); faces.getExternalContext().getRequestMap().put(this.var.getValue(ctx), map); } }
/** * See taglib documentation. */ @Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); ResourceBundle bundle = null; try { String name = this.basename.getValue(ctx); ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (root != null && root.getLocale() != null) { bundle = ResourceBundle.getBundle(name, root.getLocale(), cl); } else { bundle = ResourceBundle .getBundle(name, Locale.getDefault(), cl); } } catch (Exception e) { throw new TagAttributeException(this.tag, this.basename, e); } ResourceBundleMap map = new ResourceBundleMap(bundle); FacesContext faces = ctx.getFacesContext(); faces.getExternalContext().getRequestMap().put(this.var.getValue(ctx), map); } }
/** * See taglib documentation. */ @Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); ResourceBundle bundle = null; try { String name = this.basename.getValue(ctx); ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (root != null && root.getLocale() != null) { bundle = ResourceBundle.getBundle(name, root.getLocale(), cl); } else { bundle = ResourceBundle .getBundle(name, Locale.getDefault(), cl); } } catch (Exception e) { throw new TagAttributeException(this.tag, this.basename, e); } ResourceBundleMap map = new ResourceBundleMap(bundle); FacesContext faces = ctx.getFacesContext(); faces.getExternalContext().getRequestMap().put(this.var.getValue(ctx), map); } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (ComponentHandler.isNew(parent)) { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root == null) { throw new TagException(this.tag, "UIViewRoot not available"); } ValueExpression b = null; if (this.binding != null) { b = this.binding.getValueExpression(ctx, PhaseListener.class); } PhaseListener pl = new LazyPhaseListener(this.listenerType, b); List<PhaseListener> listeners = root.getPhaseListeners(); if (!listeners.contains(pl)) { root.addPhaseListener(pl); } } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (ComponentHandler.isNew(parent)) { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root == null) { throw new TagException(this.tag, "UIViewRoot not available"); } ValueExpression b = null; if (this.binding != null) { b = this.binding.getValueExpression(ctx, PhaseListener.class); } PhaseListener pl = new LazyPhaseListener(this.listenerType, b); List<PhaseListener> listeners = root.getPhaseListeners(); if (!listeners.contains(pl)) { root.addPhaseListener(pl); } } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (ComponentHandler.isNew(parent)) { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root == null) { throw new TagException(this.tag, "UIViewRoot not available"); } ValueExpression b = null; if (this.binding != null) { b = this.binding.getValueExpression(ctx, PhaseListener.class); } PhaseListener pl = new LazyPhaseListener(this.listenerType, b); List<PhaseListener> listeners = root.getPhaseListeners(); if (!listeners.contains(pl)) { root.addPhaseListener(pl); } } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (ComponentHandler.isNew(parent)) { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root == null) { throw new TagException(this.tag, "UIViewRoot not available"); } ValueExpression b = null; if (this.binding != null) { b = this.binding.getValueExpression(ctx, PhaseListener.class); } PhaseListener pl = new LazyPhaseListener(this.listenerType, b); List<PhaseListener> listeners = root.getPhaseListeners(); if (!listeners.contains(pl)) { root.addPhaseListener(pl); } } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (parent != null) { try { ELText nt = this.txt.apply(ctx.getExpressionFactory(), ctx); UIComponent c = new UIText(this.alias, nt); String uid; UIComponent ancestorNamingContainer = parent.getNamingContainer(); if (null != ancestorNamingContainer && ancestorNamingContainer instanceof UniqueIdVendor) { uid = ((UniqueIdVendor) ancestorNamingContainer).createUniqueId(ctx.getFacesContext(), null); } else { uid = ComponentSupport.getViewRoot(ctx, parent).createUniqueId(); } c.setId(uid); this.addComponent(ctx, parent, c); } catch (Exception e) { throw new ELException(this.alias + ": "+ e.getMessage(), e.getCause()); } } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (parent != null) { try { ELText nt = this.txt.apply(ctx.getExpressionFactory(), ctx); UIComponent c = new UIText(this.alias, nt); String uid; UIComponent ancestorNamingContainer = parent.getNamingContainer(); if (null != ancestorNamingContainer && ancestorNamingContainer instanceof UniqueIdVendor) { uid = ((UniqueIdVendor) ancestorNamingContainer).createUniqueId(ctx.getFacesContext(), null); } else { uid = ComponentSupport.getViewRoot(ctx, parent).createUniqueId(); } c.setId(uid); this.addComponent(ctx, parent, c); } catch (Exception e) { throw new ELException(this.alias + ": "+ e.getMessage(), e.getCause()); } } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (parent != null) { try { ELText nt = this.txt.apply(ctx.getExpressionFactory(), ctx); UIComponent c = new UIText(this.alias, nt); String uid; UIComponent ancestorNamingContainer = parent.getNamingContainer(); if (null != ancestorNamingContainer && ancestorNamingContainer instanceof UniqueIdVendor) { uid = ((UniqueIdVendor) ancestorNamingContainer).createUniqueId(ctx.getFacesContext(), null); } else { uid = ComponentSupport.getViewRoot(ctx, parent).createUniqueId(); } c.setId(uid); this.addComponent(ctx, parent, c); } catch (Exception e) { throw new ELException(this.alias + ": "+ e.getMessage(), e.getCause()); } } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (parent != null) { try { ELText nt = this.txt.apply(ctx.getExpressionFactory(), ctx); UIComponent c = new UIText(this.alias, nt); String uid; UIComponent ancestorNamingContainer = parent.getNamingContainer(); if (null != ancestorNamingContainer && ancestorNamingContainer instanceof UniqueIdVendor) { uid = ((UniqueIdVendor) ancestorNamingContainer).createUniqueId(ctx.getFacesContext(), null); } else { uid = ComponentSupport.getViewRoot(ctx, parent).createUniqueId(); } c.setId(uid); this.addComponent(ctx, parent, c); } catch (Exception e) { throw new ELException(this.alias + ": "+ e.getMessage(), e.getCause()); } } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (parent != null) { UIComponent c = new UILiteralText(this.txtString); String uid; UIComponent ancestorNamingContainer = parent.getNamingContainer(); if (null != ancestorNamingContainer && ancestorNamingContainer instanceof UniqueIdVendor) { uid = ((UniqueIdVendor) ancestorNamingContainer).createUniqueId(ctx.getFacesContext(), null); } else { uid = ComponentSupport.getViewRoot(ctx, parent).createUniqueId(); } c.setId(uid); this.addComponent(ctx, parent, c); } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (parent != null) { UIComponent c = new UILiteralText(this.txtString); String uid; UIComponent ancestorNamingContainer = parent.getNamingContainer(); if (null != ancestorNamingContainer && ancestorNamingContainer instanceof UniqueIdVendor) { uid = ((UniqueIdVendor) ancestorNamingContainer).createUniqueId(ctx.getFacesContext(), null); } else { uid = ComponentSupport.getViewRoot(ctx, parent).createUniqueId(); } c.setId(uid); this.addComponent(ctx, parent, c); } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (parent != null) { UIComponent c = new UILiteralText(this.txtString); String uid; UIComponent ancestorNamingContainer = parent.getNamingContainer(); if (null != ancestorNamingContainer && ancestorNamingContainer instanceof UniqueIdVendor) { uid = ((UniqueIdVendor) ancestorNamingContainer).createUniqueId(ctx.getFacesContext(), null); } else { uid = ComponentSupport.getViewRoot(ctx, parent).createUniqueId(); } c.setId(uid); this.addComponent(ctx, parent, c); } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { if (parent != null) { UIComponent c = new UILiteralText(this.txtString); String uid; UIComponent ancestorNamingContainer = parent.getNamingContainer(); if (null != ancestorNamingContainer && ancestorNamingContainer instanceof UniqueIdVendor) { uid = ((UniqueIdVendor) ancestorNamingContainer).createUniqueId(ctx.getFacesContext(), null); } else { uid = ComponentSupport.getViewRoot(ctx, parent).createUniqueId(); } c.setId(uid); this.addComponent(ctx, parent, c); } }
protected String createUniqueId(FaceletContext ctx, UIComponent parent, String id) { String uniqueId = null; if (this.id != null && !(this.id.isLiteral() && IterationIdManager.registerLiteralId(ctx, this.id.getValue()))) { uniqueId = this.id.getValue(ctx); } else { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root != null) { String uid; IdMapper mapper = IdMapper.getMapper(ctx.getFacesContext()); String mid = ((mapper != null) ? mapper.getAliasedId(id) : id); UIComponent ancestorNamingContainer = parent .getNamingContainer(); if (null != ancestorNamingContainer && ancestorNamingContainer instanceof UniqueIdVendor) { uid = ((UniqueIdVendor) ancestorNamingContainer) .createUniqueId(ctx.getFacesContext(), mid); } else { uid = root.createUniqueId(ctx.getFacesContext(), mid); } uniqueId = uid; } } return uniqueId; }
c.setId(this.id.getValue(ctx)); } else { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root != null) { String uid;
c.setId(this.id.getValue(ctx)); } else { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root != null) { String uid;
c.setId(this.id.getValue(ctx)); } else { UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent); if (root != null) { String uid;