Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How to find componet in jsf table?

 
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..
 
Saloon Keeper
Posts: 22498
151
Android Eclipse IDE Tomcat Server Redhat Java 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).
 
ranger
Posts: 17346
11
Mac IntelliJ IDE 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.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic