voyent
How to disable singleSubmit?  XML
Forum Index -> Portals & Portlets
Author Message
romskom

Joined: 09/Dec/2010 03:58:24
Messages: 3
Offline


Hello!
I create 2 portlets which uses the Inter-Portlet Communication.
In 1-st portlet I have h:selectMenu component. When user change selection, this component submit form to server.

Code:
 <?xml version="1.0" encoding="windows-1251"?>
 <f:view contentType="text/html"
 	xmlns="http://www.w3.org/1999/xhtml" 
 	xmlns:c="http://java.sun.com/jsp/jstl/core"
 	xmlns:f="http://java.sun.com/jsf/core" 
 	xmlns:h="http://java.sun.com/jsf/html"
 	xmlns:ui="http://java.sun.com/jsf/facelets"
 	xmlns:portlet="http://java.sun.com/portlet_2_0"
 	xmlns:pf="http://portletfaces.org/bridge"
 	xmlns:aui="http://portletfaces.org/alloyfaces/aui" 
 	xmlns:aui-cc="http://portletfaces.org/alloyfaces/aui-cc"
 	xmlns:liferay-ui="http://portletfaces.org/liferayfaces/liferay-ui"
     xmlns:icecore="http://www.icefaces.org/icefaces/core"
     xmlns:ace="http://www.icefaces.org/icefaces/components"
     xmlns:ice="http://www.icesoft.com/icefaces/component"	
 >
 	
 	<h:body>
 		<aui:form id="customerAccList">
 			<h:panelGrid columns="2" rendered="#{customerAccList.customerAccounts.size() > 0}">
 				<h:panelGroup>
 					<h:outputLabel id="lblSelectAccount" for="selectAccount" value=""/>
 					<h:selectOneMenu id="selectAccount" 
 						value="#{customerAccList.currentAccId}" 
 						valueChangeListener="#{customerAccList.processValueChange}" 
 						onchange="submit();">
 						<f:selectItems 
 							value="#{customerAccList.customerAccounts}" 
 							var="elem"
 							itemLabel="#{elem.accNumber}"
 							itemValue="#{elem.accId}" />
 					</h:selectOneMenu>
 				</h:panelGroup>
 				<h:panelGroup>
 					<h:outputText value="#{customerAccList.accountCity}"/><br/>
 					<h:outputText value="#{customerAccList.accountAdress}"/>
 				</h:panelGroup>
 			</h:panelGrid>
 			<h:outputText
 				value="??? ??????????? ??????? ??????" 
 				rendered="#{customerAccList.customerAccounts.size() == 0}"/>
 		</aui:form>
 	</h:body>
 </f:view>
 


Code:
 	public void processValueChange(ValueChangeEvent arg0)
 			throws AbortProcessingException {
 		_logger.debug("LISTENER begin");
 		String id = (String) arg0.getNewValue();
 		
 		TAccList account = map.get(id);
 		
 		PortletSessionUtil.setCurrentAccountToSession(account);
 		currentAccount = account;
 
 		accountCity = createAccountCity(account);
 		accountAdress = createAccountAddress(account);
 		_logger.debug("accountCity is " + accountCity);
 		_logger.debug("accountAdress is " + accountAdress);
 		
 		publishEvent(account);
 		
 		_logger.warn("publish end");
 
 	}
 
 	private void publishEvent(TAccList account) {
 		
 		Account event = new Account(account);
 		
 		QName qName = new QName("urn:hostco.ru/portal/event", "currentAccount");
 		ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
 		Object obj = externalContext.getResponse();
 		
 		_logger.debug(obj.getClass().getCanonicalName());
 		
 		if (obj instanceof StateAwareResponse){
 			_logger.debug("response is instanse of StateAwareResponse");
 			StateAwareResponse response = (StateAwareResponse) obj;
 			response.setEvent(qName, event);
 		}
 		
 	}
 


Then I use the IceFaces 2.0.2. libs in my project, then obj is StateAwareResponse and my code works fine/
But then I include IceFaces 3.0 libs, I have ResourceResponse instead of StateAwareResponse. And i can'not publish my event.

How can I disable the partial submit and ajax usage in my portlet?

deryk.sinotte


Joined: 26/Oct/2004 00:00:00
Messages: 1008
Offline


That certainly doesn't seem like the correct behaviour. Do you have a simple portlet .war file that shows the problem that you could post to the forum thread?

As for a diagnostic tool for turning off ICEfaces automatic Ajax form capture behaviour, try adding this attribute to the form:

Code:
 <h:form > 
     <f:attribute name="DISABLE_CAPTURE_SUBMIT" value="true" />
     .... 
 

Deryk Sinotte
Team Lead
ICEsoft Technologies, Inc.
romskom

Joined: 09/Dec/2010 03:58:24
Messages: 3
Offline


deryk.sinotte wrote:
That certainly doesn't seem like the correct behaviour. Do you have a simple portlet .war file that shows the problem that you could post to the forum thread?

As for a diagnostic tool for turning off ICEfaces automatic Ajax form capture behaviour, try adding this attribute to the form:

Code:
 <h:form > 
     <f:attribute name="DISABLE_CAPTURE_SUBMIT" value="true" />
     .... 
 
 


After I have changed my code how it is specified above - the IPC mechanism has earned.
 
Forum Index -> Portals & Portlets
Go to:   
Powered by JForum 2.1.7ice © JForum Team