+ Start a Discussion
Sathish Kumar 241Sathish Kumar 241 

Apex and Visualforce(display values in <apex:pageBlockTable>.

Hi friends i have implemented bubble sort and quick sort using apex and visualforce, i.e 
User-added image
when i press buttons bubble sort and quick sort, its getting sorted.
Now my requirement is there should be a single button called sort. So that if i press sort sorted values shoud be displayed in its respective blocks, i,eUser-added image

Plz guide me, how am i going to acheive this. I am new to apex and visualforce.
Muzammil BajariaMuzammil Bajaria
hi Satish,

You need to create two different list to display both the sorting.
You might have created two different functions for both the sorting. merge both the method and call on single action.
As i assume there is only one list in back end which u need to sort. Create two temporary list and store your bubble sorting in one list and quick sorting in other list.
On your VF page, there are two different sections i.e. Bubble sort and quick sort. So display the list in respective section and rerender.

let me know if this helped or not.