Board index JavaServer Faces General Issue with JSF Primefaces datatable update - need your advic

Issue with JSF Primefaces datatable update - need your advic

Components, Ajax Framework, Utilities and More.

Posts: 2
I am facing issue with calling of javascript function in the JSF Primefaces page when i edit the row in the datatable.

I am using primeface verison 2.0

Issue is when we click on the datatable rowedit after editing the data , request will go to the bean and it will try to update it in the DB ( stored procedure is called).
If procedure returns the code as 2, we have to display javascript function with message "This update will delete/change activity period of existing models Continue?" with Yes and No buttons.

I am unable to generate this javascript function with Yes or No buttons (call the javascript from the datatable onroweditlistener).

Could you please tell me how to achieve this functionality?

below is the code

<p:dataTable id="values" var="items"
selectionMode="single" selection="#{maintGSPForecastModelBean.selectedRow}"
rowEditListener="#{maintGSPForecastModelBean.rowEdit}" onRowEditUpdate=";">

<p:column headerText="GSP Group">
<h:outputText value="#{items.gspGroup}" />

<p:column headerText="GTime">
<h:outputText value="#{items.gTime}" />
<p:column headerText="Type">
<h:outputText value="#{items.forecastType}" />

<p:column headerText="Start Date" >
<f:facet name="output">
<h:outputText value="#{items.startDate}" />
<f:facet name="input">
<p:inputMask id="stDate" mask="99999999"
value="#{items.startDate}" required="false">

<p:column headerText="End Date" >
<f:facet name="output">
<h:outputText value="#{items.endDate}" />
<f:facet name="input">
<p:inputMask id="edDate" mask="99999999"
value="#{items.endDate}" required="false">
<p:column headerText="Last Updated">
<h:outputText value="#{items.tStamp}" />
<p:column headerText="Options">
value=" " styleClass="ui-icon ui-icon-trash"
update="gspForecastModel:values" ajax="true" immediate="true">
value="#{items}" />
<p:confirmDialog message="Are you sure?"
header="Confirm" severity="alert" widgetVar="confirmation" >

Please advice me on this....

Thanks and Regards,

Return to General