You need to sign in to do that
Don't have an account?
nrwing
Conditional Color For Visualforce Page Depending On Record Type
I am putting together basic VS pages, but want I had hoped to do is set it up so that I can change the label and color on the detail of a record (when it is first being created as well as viewed and edited) depending on the record type. Can you do this using the visualforce and incorporating apex conditionals? I would assume I want to use a conditional that might reference a stylesheet, but how do you do that in visualforce?
If you want conditional logic to determine which class an element needs to use you can do something like :
You could even use the same trick to swap the entire stylesheet based on some condition :
Hope this helps,
David
Message Edited by David VP on 10-13-2008 03:42 PM
Message Edited by nrwing on 10-13-2008 03:54 PM
Message Edited by nrwing on 10-13-2008 03:57 PM
Check out 'Controller Extensions' in the Visualforce Developer's guide.
You can basically leave your standard controller in place and 'extend' it with some custom logic of your own. That's where you could put a method for deciding which stylesheet you would like to render.
The conditional logic itself is basically the same as in most other languages (if then ... return ... else return ...) ... You'll find plenty of examples of that in the docs or in this forum.
-David