• Post Reply Bookmark Topic Watch Topic
  • New Topic

Issue with h:inputText

 
Kumar Gaurav
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am writing following lines of code to render the input text in my xhtml file :


<hutputLabel
for="#{parameter.uniqueId}"
value="#{parameter.paramText}"/>

<h:inputText
id="#{parameter.uniqueId}"
disabled="#{!parameter.enable}"
required="#{parameter.mandatory}"
requiredMessage="#{parameter.requiredMessage}"
binding="#{parameter.uIComponent}"
maxlength="#{parameter.paramSize}"
style="border:1px solid black;"
converter="#{parameter.converter}"
validator="#{parameter.validator.validate}"
value="#{parameter.value}" >
<a4j:support event="onblur" reRender="#{parameter.uniqueId}" />
</h:inputText>

Here label is coming but text box is not getting rendered on screen.
When i am removing binding attribute text box is getting rendered. I am using same page for many a situation so i cannot remove binding attribute.

Can any one point what is going wrong.
 
Kumar Gaurav
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used a PhaseListener and checked its binding attribute is coming properly but still text box is not getting rendered.
Additional info, only 3 phase are getting invoked

1)Restore view
2)Apply request values
3)Render response


Please any one help me out as i am completely stuck
 
Kumar Gaurav
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, when i am removing binding attribute only 2 phases are getting invoked

1)Restore view
2)Render Response

and converter are getting called but in case when there is binding , converter are not getting called, which is probably causing issue i guess.
 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using binding anyway? Are you planning to dynamically modify the inputText UI control properties?
 
Kumar Gaurav
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes...As i am dynamically generating text boxes so i need binding attribute to modify their values.
 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. Just checking - people overuse binding and I think it's due to some really antique documentation still floating around.

In general UI terms, it's not considered good practice to make forms too dynamic, but it depends on what you're doing. I have a generic editor that has to build a form based on the database table that's being edited, but things like the disappearing "Print" menu from MS Word 2003 made me scream in frustration.

Binding or not, however, your "set" and action methods won't get invoked if the data in the control fails to pass validation. Although I haven't done a detailed analysis of your code, that's always the first thing I check for myself.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!