0

By change the combo box value h:inputtext loss behavior for readonly/disable

What should I do?

<h:selectOneListbox class="form-control selectpicker" value="{Controller.value}" layout="grid" columns="3">  
  <f:selectItems value="#{Controller.valueList}" var="abc" itemLabel="#{abc.description}" itemValue="#{abc}" />  
  <f:ajax render="panelId2" />
</h:selectOneListbox>

<h:panelGroup styleClass="row row-sm" id="panelId2" layout="block">  
  <div class='input-group date datepicker'/>
  <h:inputText styleClass="form-control" value="#{Controller.date}" immediate="true" readonly="#{facesContext.renderResponse}">
    </h:inputText>
</h:panelGroup>
H.Shah
  • 1
  • 2
  • Welcome to SO, please try to explain better your question. Right now it is not clear what you are asking. Provide relevant parts of your code and what you are trying to do. – Jorge Campos Sep 09 '15 at 20:57
  • Use `disabled` instead of `readonly` and remove styles if you don't want them. – Geinmachi Sep 09 '15 at 21:00
  • 1
    Don't write your code like that in comments, edit your post. – Geinmachi Sep 09 '15 at 21:00
  • @Geinmachi sorry man i cant post question properly... but let me try with disabled. – H.Shah Sep 09 '15 at 21:01
  • Have you tried `disabled`? Also you have not closed div and [tag:primefaces] tag is unnecessary because you use no PriemFaces components. – Geinmachi Sep 09 '15 at 21:07
  • @JorgeCampos after update "panelid" by ajax i got false for facesContext.renderResponse but i want to keep true for each time – H.Shah Sep 09 '15 at 21:08
  • @Geinmachi yes div is already closed its my mistake and yeah primefaces tag is unnecessary – H.Shah Sep 09 '15 at 21:09
  • @Geinmachi yeah now is perfect. you can see this... i am trying with disable – H.Shah Sep 09 '15 at 21:11
  • You forgot `'` in `class` attribute in `div` but that doesn't matter, using `disabled` instead of `readonly` should work. – Geinmachi Sep 09 '15 at 21:13
  • with disabled="true" value is not post to back. – H.Shah Sep 09 '15 at 21:13
  • @Geinmachi and with disabled ="#{facesContext.renderResponse}" it is same problem i am facing... when i change the combo box value it will update the h:inputText and then h:inputText loss the disable/readonly behavior. – H.Shah Sep 09 '15 at 21:16
  • @BalusC i have to put it readonly with each view... please look the code... when i update inputText by changing the combo value by ajax request it loss the readonly behavior. but should be able to post back this value – H.Shah Sep 09 '15 at 21:20
  • 1
    So, you didn't understand/tried the answer in the duplicate question? – BalusC Sep 09 '15 at 21:21
  • @BalusC yeah its working with thanks dude.... thanks... – H.Shah Sep 09 '15 at 21:30

0 Answers0