Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to find componet in jsf table?  RSS feed

 
chintan chintan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made table in jsf,rave component using netbeans 5.5 visual web pack .
I want to set disable of textField which is in table. For that I have used find text component id which is in table. I have used follwing codes to find components:

//source code starts

FacesContext fc = FacesContext.getCurrentInstance();
UIViewRoot myviewroot = fc.getViewRoot();
HtmlInputText text1 =(HtmlInputText) myviewroot.findComponent("form2:table1:tableRowGroup1:3:tableColumn2:textField1");
text1.setDisabled(true);
//source code ends

It always returns null
Please help me to solve this problem..
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No HTTP-based framework can reach out from the server and make unsolicited changes to the client. Once the page has been shipped out to the client, the only way it can change is if client-side code modifies it (generally in JavaScript) or if the client makes a page-update request back to the server.

If you know when the page is initially served up that you want to set properties on controls for pages being rendered, you can do that without any JSF-specific code at all. Just set bean properties on your backing bean (or in the case of a table, the bean for the table row you want controlled).
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"chintan chintan",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!