• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsf ajax rerender inputText

 
Thomas Poffet
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a selection list and detail inputText elements which should be populated according to the selection.
But unfortunately I cannot manage to populate an inputText field upon selection.
The backing bean is working fine, because if I change from inputText to outputText it works.
What am I doing wrong? Are inputText fields not rerenderable?

Following are some code extracts:

<rich:panel header="test immediate FLC update" >
...
<h:selectOneListbox
valueChangeListener="#{seaFltHandling.doPopulateDetails}"
onchange="submit()"
immediate="true"
value="#{seaFltHandling.selectedItem}" >
<f:selectItems value="#{seaFltHandling.selection}" />
<a4j:support event="onchange" reRender="rep" />
</h:selectOneListbox>
...
<h:inputText maxlength="3" size="2" value="#{seaFltHandling.flcArr}"
rendered="true"
styleClass="normalbold" id="rep" />
...
 
Bob Good
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does you backing bean have a both getFlcArr and a setFlcArr?
 
Thomas Poffet
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it has both and it works when I use hutputText instead of h:inputText
 
Bob Good
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you debug / break on the getter, is it going up to the server when you expect?
 
Varun Garg
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The setter on the inputText gets called after the value has been changed, if you define the a4j:region just on the object creating the event, then the setter does not get called and it works perfectly.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic