I've not found anything like my case here, then I would ask if is there a way to enable/disable a p:calendar through a h:selectOneRadio and f:selectItem components?
I've already made <p:calendar> work with my app... but with the radiobuttongroup I can't get it to work...
I think I'm doing something wrong but i can't see what is... here is my xhtml:
Code: Select all
<h:form>
<h:selectOneRadio required="true" requiredMessage="Select one generation type"
style="display:inline" value="#{boletoController.habilitaData}">
<!-- "habilitaData" is the boolean variable at @MB that I'm using to store "disabled" state -->
<f:selectItem id="rbtnVenc" itemValue="#{boletoController.desabilita()}" itemLabel="#{bundle.BoletoTitle_GeracaoIndividualProxVenc}"
value="#{boletoController.desabilita()}"/> <!-- The "desabilita()" method sets true to the "habilitaData" variable -->
<f:selectItem id="rbtnData" itemValue="#{boletoController.habilita()}" itemLabel="#{bundle.BoletoTitle_GeracaoIndividualProxData}"
value="#{boletoController.habilita()}"/> <!-- The "habilita()" method sets false to the "habilitaData" variable -->
</h:selectOneRadio>
<p:calendar id="VencPersonalizado" disabled="#{boletoController.habilitaData}" locale="pt_BR"
value="#{boletoController.dataVencimento}" pattern="dd/MM/yyyy"/>
<!-- Here, I'm trying to take the boolean attribute from @MB but it's not working... -->
<h:commandLink action="#{boletoController.gerarUmBoleto(cobrancaController.selected)}" value="#{bundle.GerarPDF}" />
<!-- Business method that creates an object which optionally uses a Date parameter... -->
</h:form>
Hugs.