J'ai un problème étrange avec les composants jsf (h: inputFile & h: selectBooleanCheckbox).SelectBooleanCheckbox reçoit focus sans mouseover
Les deux composants reçoivent le focus, même lorsque ma souris se trouve ailleurs sur la page. Voici le code:
<h:form id="logoUpload" enctype="multipart/form-data">
<div>
<h:outputLabel rendered="true">
<h:inputFile id="companyLogo" label="file" value="#{fileHandlerBean.part}" >
<f:validator validatorId="FileUploadValidator" />
</h:inputFile>
</h:outputLabel>
</div>
<div class="clear" />
<h:outputLabel rendered="true">
<div>
<div style="width: 5%">
<h:selectBooleanCheckbox id="acceptToULogo" value="#{companyEditController.confirmToU}">
<p:ajax event="change" update="buttonLogo" />
</h:selectBooleanCheckbox>
</div>
<div style="width: 95%">
<h:outputText value="Some Text " />
</div>
<br />
<h:commandButton id="buttonLogo" styleClass="formbutton" value="Upload"
action="#{companyEditController.companyLogoUpload()}"
actionListener="#{fileHandlerBean.uploadCompanyLogo()}"
disabled="#{!companyEditController.confirmToU}"/>
</div>
</h:outputLabel>
</h:form>
Si je déplace la souris sur le h: outputText, la case à cocher reçoit le focus. J'ai rencontré le même problème avec la balise h: inputFile. Je l'ai résolu en l'entourant d'une balise h: outputLabel, mais malheureusement elle ne fonctionne pas avec selectBooleanCheckbox.
Est-ce que quelqu'un avait le même problème dans le passé et connaît une solution?
connexes: http://stackoverflow.com/q/17544141 Vous avez été plus mauvais tutoriels probablement lisez JSF. – BalusC