voyent
validation error message to be cleared on server push  XML
Forum Index -> General Help
Author Message
manish.jain12

Joined: 03/Oct/2008 00:00:00
Messages: 4
Offline


If a modal panelPopup has some validation message on the popup. When a server push occurs in the background, the push causes the validation error message to be cleared.

If anybody have idea to fix this issue plz share with me.

thanks
rainwebs


Joined: 24/Jul/2007 00:00:00
Messages: 237
Offline


Can you give some more details. Normally the server has an exact copy of the DOM on the client side. So if you seen something in the browser the server knows of it. Following updates that are initiated by the push will keep everything and only different parts of the page will be updated.

Do you change the popup content in between?

ICEfaces book . ICEcube . ICEfusion . ICEfaces Technical Blog Award
dipashri.tikle

Joined: 20/Sep/2012 04:35:25
Messages: 12
Offline



Hi,

I am also facing same issue.

Issue: I have one modal popup containing two inputText components like :-

Code:
 <ice:panelGroup>
 <ice:outputText value="value 1:"/>
 <ice:inputText id="text1" value="#{myBean.value1}" size="5"
 maxlength="10" 								valueChangeListener="#{myBean.value1ValueChanged }"
 partialSubmit="true" />
 									
 </ice:panelGroup>									
 <ice:panelGroup>
 <ice:outputText value="value 2:"/>
 <ice:inputText id="text1" value="#{myBean.value2}" size="5"
 maxlength="10"									valueChangeListener="#{myBean.value2ValueChanged}"
 partialSubmit="true" />									
 </ice:panelGroup>
 


Where, user should provide integer values and if value validation fails i am setting error message in context inside valueChangeListener method of bean as:-

final FacesMessage faceMsg = new FacesMessage("Invalid Value", "Invalid number", null);
final FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(errorTitle, faceMsg);

and for displaying this message i have another modal popup which renders only when validation fails and displays error message using <ice : messages> like:-



Code:
 <ice:form>
 <ice:panelPopup visible="#{myBean.valueFails}"		
 			rendered="#{myBean.valueFails}"
 			modal="true" draggable="true" autoCentre="true" clientOnly="true">
 			<f:facet name="header">
 				<ice:outputText
 					value="Validation messages" />
 			</f:facet>
 
 			<f:facet name="body">
 				<ice:panelGroup id="validationMessages">
 						<ice:messages id="validationCheckMsgsId"/>
 					</ice:panelGroup>
 				<ice:panelGroup>
 						<ice:commandButton id="messagesCloseBtn" type="submit"
 							value="Close"
 							actionListener="#{myBean.closeValidationPopup}" />
 					</ice:panelGroup>	
 			</f:facet>
 </ice:panelPopup>			
 </ice:form>
 


When first time validation popup renders it shows proper message as set in context from bean, as soon as i click any where in UI other than "Close" button , message is getting disappear. Also i can see in console one request "send-receive-updates" is generating in background because of which the message is disappearing.

Please let me know if anybody has solution to pertain the message till close button get clicked by user.
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


Is this 1.8? When you call FacesContext.addMessage() try using the clientId of the invalid component.


.
dipashri.tikle

Joined: 20/Sep/2012 04:35:25
Messages: 12
Offline


Hi Philip,

Yes i am using Icefaces EE 1.8.2.

Could you please give me example of using clientId for adding Messages?
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


I posted the link above to the api.

.
dipashri.tikle

Joined: 20/Sep/2012 04:35:25
Messages: 12
Offline


Hi Philip,

I tried your suggested solution, but still issue is same.

Thanks & Regards,
Dipashri
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team