PageBlockTable Enhancer v2.0 - And the Awesomeness Continues

[Live Demo]


Note : A newer version of this plugin is released please check the same by clicking on this link

Well I have been working on this new component "PageblockTable Enhancer" for a while and am trying to merge all the functionality that were featured in my earlier components " Sortable Pageblock table" and "Enhanced PageBlock Table".

The version 2.0b brings in some exciting changes like inclusion of Pagination along with the Sorting capability.

Check out the demo of the newest version here




How to use?

Parameter :

  • targetPbTableIds : comma-separated Ids of the target Pageblock tables




 <c:PageBlockTableEnhancer targetPbTableIds="mid,mid2"/>    
   <apex:pageBlock >  
       <apex:pageBlockTable value="{!accounts}" var="acc" id="mid">  
         <apex:column value="{!acc.Name}"/>  
       </apex:pageBlockTable>   
        <apex:pageBlockTable value="{!accounts}" var="acc" id="mid2">  
         <apex:column value="{!acc.Name}"/>  
       </apex:pageBlockTable>     
   </apex:pageBlock>





PS: This is a beta version of the plugin, some bug may exists, If you find one, I will be more than happy to resolve them.

19 comments:

  1. I'm really impressed by this! I've implemented similar functionality through Apex/Visualforce before, but this is much faster than the way I was doing it (SOQL queries).

    I have two questions/requests, though!

    1. It appears that while the checkboxes persist through pagination (awesome!), only the results on the visible page are affected if the PageBlockTable is involved in a DML action (eg. insert or update).

    2. Is there a way the arrow could be displayed by default on page load for the current sort? Obviously this would be before the user interacts with it, but being able to lay down an arrow will at least imply to end users that the form can be clicked on. Without the arrow, it's not clear that it's a sortable form. Just a suggestion!

    ReplyDelete
    Replies
    1. I am glad that you liked it.
      This basically uses jQuery to paginate and sort the data.
      Regarding your requests
      1. I guess if a DML is issued this will submit all the records, not the visible ones.
      2. I am already working on a newer version which will have the requested feature. currently it is not supported.

      Delete
    2. Hey-- that's good news re: #2 :) I'll keep watching for the update!

      I should describe what my scenario is for #1, though:

      I'm using a wrapper object with two variables: a Boolean isSelected field and a Custom Object reference. Then a List of that wrapper object is being built & passed to the Visualforce PageBlockTable. isSelected is mapped to an there.

      So what I've found is that my checkbox selections persist on the page despite pagination (which is great!)-- but when I submit the form on the page, only the checkboxes I can see page are submitted. If I've checked records that I've paged away from, they won't be submitted, even though I could see the checkmarks if I paged back to them.

      Hope that makes sense :) This could be my bug on my end but I just wanted to let you know.

      Delete
    3. @Troy version with requested feature is almost ready. Will be publishing it in this week only

      Delete
  2. I get the following error and cannot install on my Dev edition, any ideas?
    line 3, column 7: Method does not exist or incorrect signature: MyHelloWorld.addHelloWorld(LIST)
    null

    ReplyDelete
    Replies
    1. Seems like your dev org contains a Class named "MyHelloWorld" and that class is throwing error. You can either fix the class or delete the same. Or you can try this in a new org

      Delete
    2. This comment has been removed by the author.

      Delete
    3. This comment has been removed by the author.

      Delete
  3. Installed and working in the most part for me now, excellent thanks!!

    Just a few things I was wondering how I could fix, my table has both input and output fields, from free text, picklists and checkboxes

    The sort does not work for input fields, dates or checkboxes. It works great for output fields for text values.

    I am using the mass edit script and have about 25 fields in my table which is why this is very useful. Maybe one of your previous versions has this sort function and I should just use that?

    ReplyDelete
    Replies
    1. Well am working on a new version that will have this feature. Currently it is not supported

      Delete
  4. Sweet component! You've saved me a bunch of work.

    ReplyDelete
  5. Wow..uh-may-zing! Much easier to implement than I thought, I was overanalyzing the sample page that comes with the package, but I should have just read the instructions above. There was no need to remove my existing code, I just had to add the 'id' to my pageblocktable and add the line. Very cool! Thank you!

    ReplyDelete
  6. It worked fine for me.

    But I have a UI issue.

    When I try to click on first column to sort. The second column is sorting.

    I dont know whats the problem.Anyone faced this issue.


    ReplyDelete
    Replies
    1. Havent experienced something like this

      Well can you post your code somewhere ?
      So that I can have a look on the same.

      Delete
  7. Hi,

    Thank you for this tool. I have a question, in my sandbox I am also testing an opportunity product tool, which makes adding product to an opportunity very easy (http://www.michaelforce.org/recipeView?id=a0G30000006eVxVEAU). I'm wondering if it would be possible for both of these tools to work together. In other words when I'm in the Opportunity Product screen, I'd like to click on the column headers to sort by the different columns. Any chance of having a bit of coaching on how that would work? Thank you very much!

    ReplyDelete
  8. Hello again, is there a way of setting the default number of rows to 40, instead of 10?

    ReplyDelete
    Replies
    1. Hi,
      Well currently this is not supported!.
      But am working on a new version and will be posting the same soon with the ability to set the page number and their options

      Delete
    2. Ok, thanks. I eagerly await the update.

      Delete
    3. version with requested feature is almost ready. Will be publishing it in this week only

      Delete