无法设置内容类型。响应已经提交(jsf,primefaces)

时间:2014-04-28 08:13:28

标签: jsf primefaces rad websphere-portal websphere-8

我正在尝试在p:对话框中加载一些数据,但我得到"无法设置内容类型。响应已经承诺"错误和对话框中的数据不显示..也是" selectedGift" value始终为null ..

这是我的xhtml ..任何想法?

    

    <h:form id="giftForm">

        <p:dataGrid var="gift" value="#{AvailableGiftsView.gifts.giftType}" columns="3"  
    rows="12" >  

    <p:panel header="#{gift.nameAr}" style="text-align:center">  
        <h:panelGrid columns="1" style="width:100%">  


            <h:outputText value="#{gift.descriptionAr}" />  
            <p:commandLink  update=":giftForm:giftDetail" onclick="giftDialog.show()" title="View Detail">  
                <p:graphicImage value="#{gift.photoUrl}"/>   
                <f:setPropertyActionListener value="#{gift}"   
                        target="#{AvailableGiftsView.selectedGift}" />  
            </p:commandLink>  

        </h:panelGrid>  
    </p:panel>  

</p:dataGrid>  

 <p:dialog id="dlg" header="Gift Detail" widgetVar="giftDialog" modal="true">  
    <h:outputText value="Resistance to PrimeFaces is futile!" />  
    <p:outputPanel id="giftDetail" style="text-align:center;"> 
     <h:panelGrid  columns="2" cellpadding="5">  
            <h:outputLabel for="giftName" value="Gift Name " />  
            <h:outputText id="giftName" value="#{AvailableGiftsView.selectedGift.name}" />  

            <h:outputLabel for="costPoints" value="Points: " />  
            <h:outputText id="costPoints" value="#{AvailableGiftsView.selectedGift.pointsCost}" />  

            <h:outputLabel for="description" value="Description: " />  
            <h:outputText id="description" value="#{AvailableGiftsView.selectedGift.name}"/>  
        </h:panelGrid> 
    </p:outputPanel> 
</p:dialog>  
    </h:form>

</f:view>
</h:body>

1 个答案:

答案 0 :(得分:0)

好吧,经过将近4天,我发现了问题所在...... 问题是我正在使用RAD 8.5和Websphere门户8.0 ..在创建我的portlet时,它是在JSR 168上创建的,所以portlet.xml如下所示

  

http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" ID =&#34; com.ibm.faces.portlet.FacesPortlet.2a8361a544&#34;&GT;       

如您所见,它使用架构版本1.0

当我把它改为

  

http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"   ID =&#34; com.ibm.faces.portlet.FacesPortlet.2a8361a544&#34;&GT;

它工作得很好!

我希望它帮助那里的人..整个问题是portlet版本与AJAX类型的请求不兼容......

相关问题