+ Start a Discussion
Sfdc11Sfdc11 

Sum of colum in pablocktable

<apex:pageBlockTable value="{!listRec}" var="s" >

<apex:column headerValue="field1" >
<apex:inputField value="{!s.field1}" id="id1st"  />
</apex:column>

 

---------

</apex:pageblocktable>

 

how to calculate sum of input field in pgblk table???

 

help me out pls..

Dhaval PanchalDhaval Panchal

Hi Try below

<apex:variable id="total" value="{!0}"/>
<apex:pageBlockTable value="{!listRec}" var="s" >
	<apex:column headerValue="field1" >
		<apex:inputField value="{!s.field1}" id="id1st"  />
	</apex:column>
	<apex:variable id="total" value="{!total + s.field1}"/>
</apex:pageBlockTable>
<apex:outputText value="{!total}"/>

 This is just an idea, you can implement in your way. But it works.

 

Sfdc11Sfdc11

Hi, It's not working/taking inputfield value(data).

 

getting blank --for total when I use apex:var..

 

<apex:variable id="total" value="{!total + s.field1}"/>

its wrking for incrementing alone ..

 

<apex:variable id="total" value="{!total + 1}"/>