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

<h:inputText tag in JSF not updating the managed bean values when attribute is readonly=true.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am facing the problem of JSF <h:inputText> tag which not updating the managed bean values when attribute is readonlytrue. and while rerendering values from managed beans It is only updating the values in the textboxes when it is has been changed as readonly. If the attribute changed to readonly="false" then the values are not getting displayed in the text boxes

please some one help me. to resolve this readonly issue of JSF tag <h:inputText>
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i don't think readonly attribute is causing this effect

can you post your code ( not complete code though)
 
mani manikantan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Naveen Gupta

please find the below code

<h:inputText id="dateOfBirth" value="#{CustomerBean.dateOfBirth}" size="12" readonly="true"/>
if this date field is made as readonly="true". Null is reflecting after clicking the submit button even we give date in the field. If this is not set to readonly="true" the date values which i entered is coming sucessfully.

the below tag is not set to readonly. But i am trying to redering the values when some dropwown event is fired using ajax tag. but the values are not appearing in ths field. If i made this as readonly="true" then the values are getting renderd sucessfully and appering in the text box.
<h:inputText id="areaCode1" value="#{retailCustomerBackingBean.addressInfoBackingBean.contactInfoBackingBean.areaCode1}"/>

this is the ajax tag I used to rerender the values when the action is fired on dropdown component.
<a4j:support event="onchange" reRender="areaCode1"/>

please give me the solution
 
mani manikantan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi All,
please pull me out of the below problem of JSF tag.

<h:inputText id="dateOfBirth" value="#{CustomerBean.dateOfBirth}" size="12" readonly="true"/>
If this date field is made as readonly="true". Even after entering the date Null is reflecting in the bean class after clicking the submit button. If this is not set to readonly="true" the date values which i entered is coming sucessfully in the JSF managed bean.

The below tag is not set to readonly. But i am trying to Reredering the values when some dropwown event is fired using ajax tag. But the values are not updating the Textboxes. If i made this as textboxes as readonly="true" then the values are getting renderd sucessfully and appering in the text box.
<h:inputText id="areaCode1" value="#{retailCustomerBackingBean.addressInfoBackingBean.contactInfoBackingBean.areaCode1}"/>

this is the ajax tag I used to Rerender the values when the action is fired on dropdown component.
<a4j:support event="onchange" reRender="areaCode1"/>

Thanks in Advance
 
Hoo hoo hoo! Looks like we got a live one! Here, wave this tiny ad at it:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic