modal panel closes on pressing return
jobor Sep 4, 2009 12:18 PMHello,
Below is de code of my modal panel.
It is working fine. But why is the panel closed if the cursor is in the input field with id="project-number" and then pressing the return key?
I did put in an A element to close the panel which works fine.
But I don't want the modal panel to close on pressing return in the entry field.
Is there a way to prevent that behaviour?
I'm using RF 3.3.1 on JBoss 5.0.
<rich:modalPanel id="modal-project-panel" width="600" height="220" onshow="focusProjectNumberSearch();" onbeforeshow="#{rich:component('myKey')}.disable();">
<f:facet name="header">
<h:outputText value="Programma koppelen" />
</f:facet>
<h:form id="project-search-form" style="margin: 0px;">
<div>
<h:panelGrid columns="3" cellpadding="4" cellspacing="0">
<h:outputText value="Projectnummer:" />
<h:inputText id="project-number" value="#{planningHandler.bulkProjectSearch}" style="width: 80px;" />
<a4j:commandLink actionListener="#{planningHandler.selectBulkProject}">
<h:graphicImage value="/images/magnifier.png" alt="Project zoeken" style="border-style: none;"/>
</a4j:commandLink>
</h:panelGrid>
</div>
<div style="border-bottom: 1px solid #c4c0b9; padding-top: 10px;">
<h:outputText value="Geselecteerd programma:" />
</div>
<a4j:outputPanel ajaxRendered="true" layout="block" style="padding-top: 10px;">
<h:panelGrid columns="2" cellpadding="4" cellspacing="0" columnClasses="label-column, text-column">
<h:outputText value="Projectnummer:" />
<h:outputText id="bulk-project-number" value="#{planningHandler.bulkProject.number}" />
<h:outputText value="Gidstitel:" />
<h:outputText id="bulk-project-title" value="#{planningHandler.bulkProject.title}" />
<h:outputText value="Afleveringstitel:" />
<h:outputText id="bulk-project-episode-title" value="#{planningHandler.bulkProject.episodeTitle}" />
</h:panelGrid>
</a4j:outputPanel>
<a4j:outputPanel ajaxRendered="true" layout="block" style="text-align: center; padding-top: 10px;">
<a4j:commandButton id="bulk-command" value="Koppelen" actionListener="#{planningHandler.changeProjectNumbers}" ajaxSingle="true" reRender="rows" disabled="#{planningHandler.bulkProject.key == 0}" onclick="if (!confirm('Geselecteerd programma koppelen?')) return false;"/>
</a4j:outputPanel>
<div style="text-align: center; padding-top: 10px;">
<a href="#" onclick="#{rich:component('modal-project-panel')}.hide();">
<h:outputText value="Sluiten" />
</a>
</div>
</h:form>
</rich:modalPanel>
T.I.A.
Johan Borchers