File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes MyFaces displayValueOnly from Java does not work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "MyFaces displayValueOnly from Java does not work" Watch "MyFaces displayValueOnly from Java does not work" New topic

MyFaces displayValueOnly from Java does not work

A. Dusi
Ranch Hand

Joined: Sep 27, 2004
Posts: 114
I am trying to set the displayValueOnly property to true for a textarea component in the backing bean Java code. But it does not work. The widget is still displayed. The same works when I give t:inputTextArea directly in the JSP. All the components that I am creating in the backing bean are from org.apache.myfaces.component.html.ext package. Is this the correct package to use the displayValueOnly?
I need to create components in the backing bean since I do not know the number of components until run time.
The textarea is embedded in a panelGrid which is also from the same package.

Experts, please advise.
Tushar Kherde
Ranch Hand

Joined: Apr 28, 2006
Posts: 56

Can you provide code snipplet

This is how i have creating component in runtime.

HtmlInputText component = (HtmlInputText) application.createComponent((HtmlInputText.COMPONENT_TYPE));


Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
By the way .. What's in your opinion the difference between:

A. Dusi
Ranch Hand

Joined: Sep 27, 2004
Posts: 114
I could not know the difference. When I tried, both approaches seemed to create the component. Could you please explain how one should decide upon choosing an approach to creating the components given a situation.
But in either of the approaches, the displayValueOnly is still not working.

Please advise.

Thanks in advance.

Joined: Feb 23, 2007
Posts: 1
Hi Dusi,

were you able to solve your issue?
I'm having the same problem here.
I just posted a bug to Apache because I cannot
see any way to get this working.

I agree. Here's the link:
subject: MyFaces displayValueOnly from Java does not work
Similar Threads
managed -and backing beans question.
Brain burp! Can't get the right Data Grid layout
Prevent data in h:inputTextArea from being submitted
MyFaces t:input displayValueOnly attribute
value and binding attribute