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
a contratora contrator 

How to get comma seperated string value in <apex:param...assignTo...>

 

Hi,
In our application, the user must access the internal news / message.
As a simple test, I use <apex:param name="a"  value="news1,content"  assignTo="{!content}"/>  within <apex:commandLink>.  The problem is, the variable "content" can only get the value"news1".  In other word, if the string value contains a comma "," , all contents after comma will be ignored.  How to deal with it ?   Actually, the message is a long string including many commas and line breaks.  How can I get the whole content by using <apex:param name="a" value="{!each.Message__c} assignTo="{!content}"/>  and display it in a right way (including line breaks) ?

Thank you very much!

The test code:

<apex:page controller="testmsg">
 <apex:outputtext value="{!content}" style="color:red"/>
<br/>
<apex:form >
  <apex:commandlink action="{!dosomething}" value="test message box">
    <apex:param name="a" value="news1,content" assignTo="{!content}"/> 
  </apex:commandlink>
</apex:form>
</apex:page>

public class testmsg{

public string content{get;set;}
public void dosomething(){
//
}
}