0

JSF Component Bulamak

Posted by Gökhan Şahin on Jun 26, 2012 in JSF, Java, Web

private UIComponent findComponent(UIComponent c, String id) {
if (id.equals(c.getId())) {
return c;
}
Iterator kids = c.getFacetsAndChildren();
while (kids.hasNext()) {
UIComponent found = findComponent(kids.next(), id);
if (found != null) {
return found;
}
}
return null;
}

Root ‘u bulup bulmak istediğmiz componentin idsini veriyoruz.

UIComponent root = facesContext.getViewRoot();
UIInput codeComponent = (UIInput)findComponent(root, "ComponentID");

Tags: ,

 
0

JSF Current Component ‘i almak

Posted by Gökhan Şahin on Jun 26, 2012 in JSF, Java, Web

javax.faces.component.UIComponent component = javax.faces.component.UIComponent.getCurrentComponent(FacesContext.getCurrentInstance());

 
0

JSF Kod Tarafından java script çalıştırmak.

Posted by Gökhan Şahin on Jun 26, 2012 in JSF, Java, Web

RequestContext context = RequestContext.getCurrentInstance();
context.execute(“alert(‘hi’)”);
context.execute(“mydialog.hide()”);

Copyright © 2019 Gökhan Şahin All rights reserved. Theme by Laptop Geek.