primefaces Uncaught TypeError:无法读取属性' show'未定义的

时间:2014-11-11 23:46:37

标签: jsf primefaces

我正在尝试从支持bean打开一个对话框,但我得到了:未捕获的TypeError:无法读取未定义的属性'show'

这是我从bean调用对话框的代码:

RequestContext.getCurrentInstance().update("someForm:confirmDialog");
context.execute("PF('confirmDialog').show()");

这是我的支持bean的一部分:

@SuppressWarnings("serial")
@ManagedBean
@ViewScoped
public class SomeBean implements Serializable{

private String something = "";
private ObjectCast newDefault = null;
private List<SomeObject> list = null;

public void onEdit(RowEditEvent event) {

newDefault = (ObjectCast)event.getObject();

if( newDefault.getDefault().equals("X") ){

RequestContext context = RequestContext.getCurrentInstance();

RequestContext.getCurrentInstance().update("someForm:confirmDialog");

context.execute("PF('confirmDialog').show()");

}

public void updateNewDefault(){

... do something...

}

.... getters and setters ...

}

XHTML:可

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
template="/commonTemplate.xhtml">
<ui:define name="content">
<h:form id="someForm">
<p:growl id="msg" showDetail="true" life="3000" autoUpdate="true"/>
<p:panelGrid width="100%">
<p:row>
<p:column colspan="4"> 
<p:dataTable id="search" var="result" value="#{someBean.list}" editable="true"> 
<!--  ajax -->
<p:ajax event="rowEdit" listener="#{someBean.onEdit}" update=":someForm:msg" />
<p:ajax event="rowEditCancel" listener="#{someBean.onCancel}" update=":someForm:msg" />   
<p:column headerText="title" sortBy="#{result.somePropertie}">
<p:cellEditor>
<f:facet name="output">
<h:outputText value="#{result.somePropertie}" />
</f:facet>
<f:facet name="input">
<p:inputText value="#{result.somePropertie}" />
</f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="Edit" style="width:50px;" >
<p:rowEditor />
</p:column>
</p:dataTable>
</p:column>
</p:row>
<p:row>
<p:column colspan="4">&#160;</p:column>
</p:row>
<p:confirmDialog id="confirmDialog"
widgetVar="confirmDialog"
message="Message ......................"
header="Warning"
severity="alert"
closeOnEscape="true"
width="600"
showEffect="slide"
hideEffect="fold"
closable="true">
<p:commandButton id="btnYes"
value="Yes"
process="@this"
oncomplete="PF('confirmDialog').hide()"
actionListener="#{someBean.updateNewDefault}" 
/>
<p:commandButton id="btnNo"
value="No"
onclick="PF('confirmDialog').hide()"
type="button" />
</p:confirmDialog>
</p:panelGrid>  
</h:form>
</ui:define>
</ui:composition>

我有一个barChart,我使用extend修改datapoint,当我把它和下面的js代码,我的对话框停止工作...为什么??

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"  
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core" 
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets"
>
<h:head>
<title>Chart</title>
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/css/default.css"/>
<script type="text/javascript">
function chartExtender() {
this.cfg.seriesDefaults = {
renderer:$.jqplot.BarRenderer,
pointLabels: { show: true }
};
this.cfg.highlighter = { show: false };
}
</script>      
</h:head>
<h:body style="background-color: #E1E1E1;">
<p:panelGrid columns="1" columnClasses="left" style="width:100%">
<p:barChart id="basic" value="#{someBean.categoryModel}" legendPosition="ne"  
title="some Title" min="0" max="#{someBean.max}" style="height:400px"
shadow="true" barPadding="60" animate="true" extender="chartExtender"
/>
</p:panelGrid>
</h:body>
</html>

谢谢!

0 个答案:

没有答案