You need to sign in to do that
Don't have an account?
fretus30
How to put custom text into value or title field using predefined StringID
Hi,
Here the samle of code:
<apex:commandButton value="Edit" />
Instead of using hardcoded text "Edit" I would like populate the value with the dynamic text, based on the parameter (MSG_002) passed into apex class .
<apex:commandButton value="MSG_002" />
example of apex class code :
if (msgID== "MSG_002" && user.lang == "en.US" ){ return "Edit"}
if (msgID== "MSG_002" && user.lang == "en.US" ){ return "Edit"}
You can easily do this by defining properties in VF Page's controller, but am assuming that you have these parameters already available with the controller class, e.g. through URL query parameters:
VF Page code:
-----------------
<apex: commandButton value="{!buttonLabel}"/>
Controller class:
-----------------
String buttonLabel;
public String getButtonLabel()
{
// some businesslogic goes here
// based on the parameter values
return 'Dynamically generated text';
}
-----------------
Is this what you are looking for or have I understood it incorrectly.