When I press the "enter" key, the download does not generate. Instead, perform a new search.
I have a button that opens a modal
:
This window is used to enter the credentials to download a .ZIP file, what happens is that when I press the enter key, the download does not take place.
When you press the enter key, this happens:
Instead of downloading, it does a search for me and I can't figure out why.
Button code (in case someone asks me but I don't think it's necessary):
<h:commandLink style="margin-top: 10px;" title="Adjuntar Fuentes Seleccionadas(.Zip)" disabled="#{empty busquedaBean1.fuente}" actionListener="#{busquedaBean1.abrirDialogo()}" >
<h:graphicImage value="/img/ZipIconID.png" style="width: 60px; height: 60px; position: relative;" rendered="#{empty busquedaBean1.fuente}"></h:graphicImage>
<h:graphicImage value="/img/ZipIcon.png" style="width: 60px; height: 60px; position: relative;" rendered="#{not empty busquedaBean1.fuente}"></h:graphicImage>
</h:commandLink>
<h:commandLink action="#{user.goLoginPage}" />
Code that is calling when clicking the button:
public void abrirDialogo(){
if(!descargo){
RequestContext.getCurrentInstance().execute("PF('IniciarDescargaFin').show();");
}else{
PruebaFinal();
}
}
Modal code:
<p:dialog modal="true" widgetVar="IniciarDescargaFin" header="Descargar" draggable="false" closable="false" resizable="false">
<!-- Otro login para descargar -->
<center><h:outputLabel for="username" value="Usuario:" /></center>
<center><p:inputText styleClass="txtUsuario" id="username" value="#{busquedaBean1.usernombre}" required="false" label="username" autocomplete="off" style="text-transform: lowercase;" /></center>
<center><h:outputLabel for="password" value="Contraseña:" /></center>
<center><p:password styleClass="txtPass" id="password" value="#{busquedaBean1.usupass}" required="false" label="password"/></center>
<center><p:commandButton ajax="false" id="loginSVN" value="Descargar" update="growl1" action="#{busquedaBean1.PruebaFinal()}" onclick="CerrarG()"/></center>
<center><p:commandButton immediate="true" value="Cerrar" update=":form" onclick="CerrarG()" /></center>
</p:dialog>
It seems to me that the problem is because inside the dialog you don't have the :form tags for it.
I hope my answer will serve you, greetings.