A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
JSF
Author
how to find component via code?
nimo frey
Ranch Hand
Joined: Jun 28, 2008
Posts: 580
posted
Feb 04, 2009 03:22:13
0
I have something like this and want to find a component via code;
public void find() { FacesContext facesContext = FacesContext.getCurrentInstance(); UIComponent component = ???? HtmlDataTable myDT = (HtmlDataTable ) component.findComponent(":form:myDataTableID"); }
You see, it does not work. What is missing?
(I do not want to use binding-property)
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
Feb 04, 2009 05:06:39
0
findComponent() is a method of
UIViewRoot
.
Code depot of a Java EE / JSF developer
|
JSF / Eclipse / Tomcat kickoff tutorial
|
DAO kickoff tutorial
|
I ♥ Unicode
nimo frey
Ranch Hand
Joined: Jun 28, 2008
Posts: 580
posted
Feb 04, 2009 05:23:36
0
oh okay, now it works, thanks!
UIViewRoot
view = context.getViewRoot();
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: how to find component via code?
Similar Threads
setting initial values for SelectOneMenus inside of an HtmlDataTable
java. lang. NoClassDefFoundError: org/richfaces/
Problem with f:validator & f:attribute - EL does not evalute in f:attribute
How to handle checkbox in jsf
How to find componet in jsf table?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter