You need to sign in to do that
Don't have an account?
Staci
button to change color with each click
I'm building a sort of audit vf page for our products and was wondering if there is a way to make this circle(shown), then when a users clicks this circle once and it turns green, click twice and it turns yellow, click 3 times and it turns red.
You can try using javascript to achieve above requirement. Check similar refrence below that can help you.
https://salesforce.stackexchange.com/questions/64484/how-to-change-the-color-of-the-button-when-pressed-help
Please mark as Best Answer if above information was helpful.
Thanks,
Visual Force Page Apex Controller CSS
Is there a way to make the button look like that circle?
That would be used to get a string(URL) value in the VisualForce page but not in the Apex (Apex you would need to query it). What that line is doing is getting the URL for the image. What I am suggesting is using a CSS class that you dynamically set to a string in your controller that you then write a CSS class for and have set to a div/button (that you also style to make round). With what you are trying to do with the image you can do it in a similar way. You could set the image to a variable that you dynamically set based on button clicks. Example:
Apex
Visualforce page
My class is giving me this "unexpected token 'public'. at line 39 column 5" for
public void RatingChange() Also, this in the vf page, creates a Submit button and the image is broken and if I click, it still tries to save instead of change the image. Any other thoughts?
<apex:column >
<apex:commandButton image="{!imageUrl)}" onClick="RatingChange()" /></apex:column>
Apex
Visualforce page
It makes me change the class to this
and I updated the apex page to this <apex:commandButton image="{!URLFOR(imageUrl)}" onClick="RatingChange()" /></apex:column>
but when saving the apext page its saying "Error: Unknown property 'Audit_Report__cStandardController.imageUrl'"