This content has been marked as final.
Show 4 replies
-
1. Re: problem with modalPanel in conjunction with a4j:support
ilya_shaikovsky Jul 13, 2009 4:59 AM (in response to kevin36)1) do you read about forms limitations while using modal panel.
2) show full code for modal panel please.
3) about focus - you could use focus attribute on a4j:support. Focus lost if the focused component in the area which reRendered. And it works like designed because we do not know where you need to have focus after DOM tree elements replacement. -
2. Re: problem with modalPanel in conjunction with a4j:support
kevin36 Jul 19, 2009 5:14 AM (in response to kevin36)Hi thanx for your reply.
I googled around but couldn t find no modal panel form limitations.
Here s a code extract of my modal panel<rich:modalPanel id="addPanel" height="400" width="558" autosized="true" moveable="false" left="80"> <div id="content"> <f:facet name="header"> <h:outputText value="#{unfallmsgs.versichertePersonAddPanelHeader}" /> </f:facet> <a4j:form id="addPanelForm"> <h:panelGrid columns="1"> <a4j:outputPanel ajaxRendered="true"> <uu:unfallVersichertePersonInput idPrefix="#{idPrefix}EditModalPanel" containerId="#{idPrefix}_vornamemodalpanel_container" model="#{unfallVersichertePersonModel.selectedPerson}" formId="addPanelForm" /> </a4j:outputPanel> </h:panelGrid> <uc:javascriptButton color="red" idPrefix="addSaveButton" buttonText="#{unfallmsgs.speichern}" bean="#{unfallVersichertePersonModel}" action="addUnfallVersichertePerson" ajaxSingle="true" reRender="versichertepersontable,personhinzufuegen" oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('addPanel')}.hide();" /> <uc:javascriptButton color="grey" idPrefix="addCancelButton" buttonText="#{msgs.buttonTextAbbrechen}" bean="#{unfallVersichertePersonModel}" action="resetSelectedPerson" ajaxSingle="true" reRender="versichertepersontable,personhinzufuegen" oncomplete="#{rich:component('addPanel')}.hide();" immediate="true" /> <input name="rechner" type="hidden" value="UNFALL" /> </a4j:form> </div> </rich:modalPanel>
And this is the included component with the input fields inside the panel (<uu:unfallVersichertePersonInput />):<uc:dateInput idPrefix="#{idPrefix}GeburtsDatum" label="#{msgs.geburtsdatum}" dateDay="#{model.geburtsDatum.day}" dateMonth="#{model.geburtsDatum.month}" dateYear="#{model.geburtsDatum.year}" required="true" rendered="true" formId="#{formId}" measurement="#{unfallmsgs.labelMeasurementDate}" ><a4j:support event="onblur" reRender="berufOutputPanel" ajaxSingle="true"/> </uc:dateInput> <a4j:outputPanel id="berufOutputPanel" layout="block"> <a4j:outputPanel rendered="#{unfallViewController.displayBeruf}"> <uc:selectOneMenu idPrefix="#{idPrefix}Beruf" label="#{msgs.beruf}" viewItems="#{unfallViewController.selectItemsBeruf}" required="true" rendered="true" modelValue="#{model.beruf.nummer}" > </uc:selectOneMenu> </a4j:outputPanel> </a4j:outputPanel>
Whereas the important part of the dateInputComponent looks like this:<h:inputText id="#{idPrefix}DateDayInput" value="#{dateDay}" styleClass="firstInputField dateTripelFieldDay#{rendered ? '' : ' readonly'}#{invalid ? ' errorForm' : ''}" onkeyup="autotab(this, $('#{formId}:#{idPrefix}DateMonthInputDecorator:#{idPrefix}DateMonthInput'))" required="#{required}" readonly="#{!rendered and readonly}" disabled="#{readonly}" maxlength="2"> <f:validateLongRange minimum="1" maximum="31" /> <ui:insert /> </h:inputText>
As you can see, everytime the user leaves an input field of the dateInput (on blur) a reRender is processed which workes just fine. But all other input fields in the modal panel (which are not included in the sample code here) are somehow rerendered too cause all the inserted values disappear when the berufOutputPanel is rerendered.
I m really stuck on this one and I am doing circles. So if you got some advice I d really appreaciate that.
Regards -
3. Re: problem with modalPanel in conjunction with a4j:support
nbelaevski Jul 19, 2009 5:30 AM (in response to kevin36)I googled around but couldn t find no modal panel form limitations.
It's described in user guide. -
4. Re: problem with modalPanel in conjunction with a4j:support
kevin36 Jul 19, 2009 6:30 AM (in response to kevin36)Seems like surrounding the input in the modal panel with a
<a4j:region renderRegionOnly="true"> ... </a4j:region>
does the job. It looks a little dirty to me, but I didn t find another solution. Happy to receive a better way from you