I have successfully used the suggestion field in a portlet within liferay in a simple page such as:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://teamdev.com/quipukit" prefix="q" %>
<f:view>
<h:form id="testMerchantSuggestionForm">
<h:commandLink value="Home" action="HOME" style="float: right;" immediate="true" /><br/>
<h:messages id="messages"
layout="table"
infoClass="portlet-msg-success"
style="width: 100%;"
errorClass="portlet-msg-error"
showSummary="false"
showDetail="true"
rendered="#{not empty facesContext.messages}"/>
<h:outputLabel value="Suggestion Field Input:"/>
<q:suggestionField
style="margin:5px;width:180px;height:18px;"
value="#{myBean.myValue}"
required="true"
suggestionMode="custom"
autoComplete="true"
suggestionDelay="200"
suggestionMinChars="3">
<q:dropDownItems value="#{mybean.suggestions}"/>
</q:suggestionField>
<h:commandButton action="HOME" value="Home" />
</h:form>
</f:view>
Buf if I put the suggestion field into a subview, which is included (using jsp:include) on another page of the portlet, then the suggestion field fails to get data, complaining about "Illegal response - couldn't find data start marker." The subview is exactly the same as above, but uses <f:subview id="mysubview"> instead of <f:view> as above. Here is the code for the containing page.
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/portlet/components" prefix="p" %>
<f:view>
<p:portletPage>
<div style="portlet-section-header">
<table style="width:100%;" cellspacing="10" border="5">
<tr>
<td style="width:24%;border-color:#A9A9A9;border-width:2px;border-style:solid;padding:5px;">
<jsp:include page="suggestionChild.jsp"/>
</td>
</tr>
</table>
</div>
</p:portletPage>
</f:view>
I would appreciate any thoughts on getting around this issue. This is all used within a portlet, using jsf 1.2_07, and portlet bridge 1.2.2_0 running on Liferay portal server. quipukit is version 1.4.3.
Thanks in advance,
Joel
Hello Joel,
We will investigate the information you have provided and let you know about the results as soon as possible.
Sincerely,
Ilya Musihin
bump. Still waiting for further information on this topic.
Hello Joel,
Unfortunately, we are not able to reproduce the described error. Could you please send us a simple war with portlet and tell us which version of liferay portal server do you use.
Sincerely,
Ilya Musihin
I'll pull something together in the next couple of days and attach it here.
thanks,
Joel
Ok, I finally have further information. While creating a simple portlet to demonstrate the problem, I found a discrepancy between the single page and subview-ed page. The page that contained the subview has a <p:portletPage> tag in it. putting that same tag into the single page view of the suggestion field caused the ajax call to fail. Pulling out the <p:portletPage> tag allows the suggestion field to work.
Here is the code for the failing single page.
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://teamdev.com/quipukit" prefix="q" %>
<%@ taglib uri="http://java.sun.com/jsf/portlet/components" prefix="p" %>
<f:view>
<p:portletPage>
<h:form id="testSuggestionForm">
<h:commandLink value="Home" action="HOME" style="float: right;" immediate="true" /><br/>
<h:messages id="messages"
layout="table"
infoClass="portlet-msg-success"
style="width: 100%;"
errorClass="portlet-msg-error"
showSummary="false"
showDetail="true"
rendered="#{not empty facesContext.messages}"/>
<h:outputLabel for="someSuggestion" value="Enter Text:"/>
<q:suggestionField
style="margin:5px;width:180px;height:18px;"
value="#{suggestion.textValue}"
required="true"
suggestionMode="custom"
autoComplete="true"
suggestionDelay="200"
suggestionMinChars="3">
<q:dropDownItems value="#{suggestion.suggestions}"/>
</q:suggestionField>
<h:commandButton action="HOME" value="Home" />
</h:form>
</p:portletPage>
</f:view>
I am attaching a war where the suggestion field works correclty in the subview mode, but incorrectly in the single page.
Joel
Hello Joel,
Could you please provide us information about version of liferay portal, that you use to find this problem?
On liferay-portal-tomcat-6.0-5.1.1 version we can not reproduce you problem.
Sincerely,
Ilya Musihin
Liferay 4.4.1 in glassfish. Sorry, that was the one bit of information I left out of my original post. We are currently investigating liferay 5.1.x, but will still be running on glassfish.
Thanks for the help
Joel
Hello Joel,
Unfortunately we are unable to reproduce this issue. We have done the following steps:
1. Download liferay-portal-glassfish-windows-4.4.1.jar and install it
2. Download subview-portlet.war that you attach in Re: Problem with Suggestion Field in portlet subview and put it to %USER_HOME%/liferay/deploy
3. Login to liferay as administrator and add portlet to home page.
4. Try portlet in action. The drop-down list of suggestion is empty in both cases
How do you reproduce this issue?
Sincerely,
Ilya Musihin
Hello Ilya,
In order to reproduce the problem, you should be able to deploy the portlet within liferay and type within the suggestion field area. The suggestionMinChars is set to 3, so unless you type at least 3 characters, you won't see the problem. I just validated that this problem does occur within Liferay Portal 5.1.1 (Calvin / Build 5101 / August 11, 2008) on glassfish, as well as the version I originally reported. I have not tried it on any other application server. There is a small problem in the app I uploaded ( the "for" attribute of the label references a non-existent ID ) but it does not affect the performance of the quipukit dropdown. I am attaching screenshots of the demo app in action on Liferay 5.1.1 on glassfish. The screenshot names should be self-explanatory, but just in case:
01 - start page of the app
02 - view after you click on "Suggestion field in a sub view" on the start page
03 - view after entering at least 3 characters in the text field to get the suggestion to trigger
04 - view after you click on "Suggestion field in a single page" on the start page
05 - view after entering at least 3 characters in the text field to get the suggestion to trigger
06 - empty log message. Nothing was logged to the server error log when the quipukit component spewed.
In Liferay 4.x it seemed as though I got more information when the error occured.
Joel