You need to sign in to do that
Don't have an account?
Ashish Kumar Yadav
How to display vf page count the number of occurrences of elements
Hi Team,
how to display element count in vf page if I am trying to display it while click on show product method value of quantity increasing can you help me .
visualforce page i am displaying like that but problem is if i click on pagination first page,last page method is calling so value is increasing so what i need to do.
vf page
======
<input type="hidden" id='{!a.pricebookentry.Product2.name}q' value="{!elementCount[a.pricebookentry.EN_Code__c]}"/>
Apex class
============
I have added this code in method showproductdata()
elementCount=new map<string,Integer>();
List<String> filterLogicSplittedbySpace = (List<String>)System.JSON.deserialize(barcodeIn, List<String>.class);
system.debug('filterLogicSplittedbySpace'+ filterLogicSplittedbySpace.size());
for (String str : filterLogicSplittedbySpace){
system.debug('str'+str);
str =str.trim();
elementList.add(str);
}
system.debug('elementList size'+elementList.size());
for(String key : elementList)
{
system.debug('elementCount.containsKey(key)'+ elementCount.containsKey(key));
if(!elementCount.containsKey(key)){
elementCount.put(key,0);
}
currentInt=elementCount.get(key)+1;
System.debug('currentInt@@'+currentInt);
elementCount.put(key,currentInt);
}
how to display element count in vf page if I am trying to display it while click on show product method value of quantity increasing can you help me .
visualforce page i am displaying like that but problem is if i click on pagination first page,last page method is calling so value is increasing so what i need to do.
vf page
======
<input type="hidden" id='{!a.pricebookentry.Product2.name}q' value="{!elementCount[a.pricebookentry.EN_Code__c]}"/>
Apex class
============
I have added this code in method showproductdata()
elementCount=new map<string,Integer>();
List<String> filterLogicSplittedbySpace = (List<String>)System.JSON.deserialize(barcodeIn, List<String>.class);
system.debug('filterLogicSplittedbySpace'+ filterLogicSplittedbySpace.size());
for (String str : filterLogicSplittedbySpace){
system.debug('str'+str);
str =str.trim();
elementList.add(str);
}
system.debug('elementList size'+elementList.size());
for(String key : elementList)
{
system.debug('elementCount.containsKey(key)'+ elementCount.containsKey(key));
if(!elementCount.containsKey(key)){
elementCount.put(key,0);
}
currentInt=elementCount.get(key)+1;
System.debug('currentInt@@'+currentInt);
elementCount.put(key,currentInt);
}