【发布时间】:2014-04-28 08:13:28
【问题描述】:
我正在尝试在 p:dialog 中加载一些数据,但出现“无法设置内容类型。响应已提交”错误,并且对话框中的数据未显示。而且“selectedGift”值始终为 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>
【问题讨论】:
-
通常这个异常是由于之前在一些ajax调用中的异常。您会在显示之前检查服务器日志是否有异常?
-
不,这就是我得到的全部.. [4/28/14 15:08:38:006 GMT+02:00] 00000084 SystemOut O 2014-04-28 15:08:38 调试 RequestLogWrapper :50 - 设置区域设置 :: en [4/28/14 15:08:38:020 GMT+02:00] 00000084 ServletExtern E 无法设置内容类型。响应已提交
标签: jsf primefaces rad websphere-portal websphere-8