function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vishalavishala 

Need to change the color of Commandlink when onclick event occurs

Hi,

We have implemented pagination, and is working fine. but unable to get the current page getting highlighted.

 

<apex:actionRegion >
             <apex:variable value="{!1.0}" var="pageCount"/>
              <apex:outputText rendered="{!results1.size <> 0}">Page:</apex:outputText>
                            <apex:repeat value="{!results1}" var="V" rows="{!CEILING(results1.size / pageSize)}">
                                            <apex:commandLink value="{!floor(pageCount)}" action="{!Test}"> &nbsp; 
                                                       <apex:param value="{!floor(pageCount)}" name="intParam"  assignTo="{!PN}" />
                                            </apex:commandLink>
                                            <apex:variable value="{!pageCount + 1}" var="pageCount"/>
                              </apex:repeat>
</apex:actionRegion>


Shashikant SharmaShashikant Sharma

I don't know ur specif problem but you can do it with this style attribute. Update this onclik, if your page get refreshed then update color of selected pageno link using java script.

 

var ctrl = document.getElementById('commandLinkID');       

ctrl.style.color = 'red'; //Color Id of the color

Ankit AroraAnkit Arora

You just need to put font:bold in style of component where you are displaying the number of page. But it would be good if you can provide the highlighted code  where you are displaying the page number?

 

Also for more reference how to implement pagination with native look and feel visit : http://forceguru.blogspot.com/2011/04/pagination-in-salesforce.html

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

vishalavishala

My code is paginating the results with pageno's 1 - 10 and has Previous and Next buttons, displayed.

When I click on a particular pagenum the result page gets refreshed and showup the corresponding content

with respect to the pagenum, same as google search result page.

I need to color the current page num which is active as and when the pagenum is clicked. (or through usage of next and previous buttons)

Ankit AroraAnkit Arora

You can use <b> tags or use font color="red" in style where you are displaying the page number, rest it depends upon your code how you are displaying the page number.

 

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

vishalavishala

I tried with changing the color, but the color is changed for all the pageno's, i just need it only for the current rendered pageno