Print a datatable from VF page - salesforce

I have two apex:datatable in my VF page. I need an option of printing these tables from the VF page. How as renderasPdf work? does it print the whole page or can we render only that datatable? Or should we have the table generated in another vf page and render that page as pdf
Any pointers?
Thanks
Prady

renderAs=pdf renders the entire page. You could make your datatable a custom component and include it in two different VF pages: 1 that is your screen-only page, the other that is a pdf VF page.

Related

Saving pagination position

I have made a pagination for a list by Bootstrap and Backbone. The list contains links for different pages. What is the best way to to "save" the pagination "page" when user goes to different page and comes back to page where the pagination is the pagination gets resetted to page one. I can't use hash because there are many bugs with window.history.back(). Are there any decisions? Or how can I use cookies?
The standard way to do this is to use routing; When you press the back button from browser you will be redirected to the last route; If you have a custom back button on the page, add on your page model last_page property. When you render the page set the route as url address.
Maybe you have problem with your application structure. BackboneJS used to write single page. So that, when you choose different page index, your page should not reload, only new data is applied to your table. You should start with this book http://addyosmani.github.io/backbone-fundamentals/

How to hide the VF page in Opportunity View in salesforce

i am using one Vf page in opportunity page and and have one checkbox above the VF page as
Approverd ---------- checkbox
....................................................Visual force page..........................................
Data
.............................................................................................................................
what i did is when check box is uncheked the vf page or view that show above is hide on save button click that work perfectly.but the blank space is there in the place of VF page .
I hope you got what I mean.
You can create 2 different opportunity page layouts. The first layout with your checkbox the second with the visualforce page. You assign the 2 page layouts to different RecordTypes. Your checkbox can trigger a workflow that is changing the record type and the pagelayout.
The next option is to use javascript to hide the section, but this is not reliable.

Get View on VF page

I want to get object view on a custom VF page.
eg: when we click on a object in salesforce we get a view i want that view on a VF page which i create.
Can anybody help me to solve this problem. If possible provide me the apex-code
Thanks
Anu
That view is called a detail page. There is in fact an visualforce component called apex:detail that does exactly what you want.

Can i call a vf page as popup from a custom link button from a standard sf page

I want to show a popup of list of cases without parentid and allow to select usign checkbox and the selected cases are added up in a related list. This popup would be availabe on clicking of link button
First question would be can i call a vf page as popup from a standard page? The rest i guess i can hande it in the VF page
Thanks
Prady
Yes, you create a link button for the object in whose page layout the link will reside. As a source for the link button choose "Visual force page" and choose a page. Keep in mind that the vf page MUST use standardController for the same object (with or without extensions) or it will not show up in the list. Choose to show the page in a new window and later place the link button on the page layout.

How to do pagination for three divs separately in the same page in cakephp?

I have three divs (on the same page)with different id that I would like to use pagination for. I am using CakePHP's inbuilt pagination method to bring about this. The first page for all the divs are displayed correctly. But if I am in the first page of the second div and click the next link, I get the next items of the first div.
And similarly, If there are no items for the third div for the second page, yet I get the items for the first div.
How can I go about setting up pagination to control the three lists independently?
There is a post about this on the Debuggable site.
How to have multiple paginated widgets on the same page with CakePHP
If you want to use inbuilt pagination, you won't be ale do this.
Thus, you have to write your own pagination. or just create new helper extends on the original one

Resources