You need to sign in to do that
Don't have an account?
SJTT
Highlight Row in a pageblocktable when clicking on commandbutton on that row
I have a Pageblocktable which displays a set of values. Now each row in this table has a commandbutton whose action method will display another table below this pageblocktable.Now I want to highlight the row whose commandbutton I clicked. Can somebody help me with this?
Well this can be easily done.
lets assume you are passing Id of the record when you click the command button so the code will be something like
here once the record gets selected and the id matches the styleclass "ui-state-active" gets applied. Well ui-sate-active is part of jquery css to use that you have to import the css
instead of that you can define your own class
All Answers
Well this can be easily done.
lets assume you are passing Id of the record when you click the command button so the code will be something like
here once the record gets selected and the id matches the styleclass "ui-state-active" gets applied. Well ui-sate-active is part of jquery css to use that you have to import the css
instead of that you can define your own class
Thanks...but I am not clear on the solution.
This is how my code is:
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!resList}" var="res" id="pb">
<apex:column value="{!res.currCode} {!res.amount}" headerValue="Amount" />
<apex:column value="{!res.amount}" headerValue="Currency" />
<apex:column headerValue="Select">
<apex:commandButton value="Select" action="{!controllermethod}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
when clicking on the command Button I have to get that entire row highlighted
Have a look at the above code. This code uses jquery to accomplish the same
Hi Avi,
Thanks for your good idea! When implementing it, I found out that for pageBlockTable you might just as well use the javascript on table level instead of inside the columns:
This way you don't have to include the onClick event in each and every column.
Be sure to update the javascript to:
Rgrds,
Guy
Hey there, How may I implement this on an Account tabbed visualforce page. The related lists/custom objects are tabs which re-render the button half of the page when you click on them. I need to make it so the selection stays highlighted. Maybe I am missing something in the explanation. I dont exactly understand how to import the CSS file either...I tried saving it to static resources, maybe I did not do it right..
Were you bale to solve this problem ?
I have a similar situation.
Regards,
Sudip