• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to find componet in jsf table?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
No, tomorrow we rule the world! With this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic