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
fretus30fretus30 

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"}

 

 

 

metaforcemetaforce

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.