You need to sign in to do that
Don't have an account?
Can I use <apex:message> without an sObject?
Please see my code:
public class MyCustomController {
public String MyVal { get; set; }
public void save() {
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'MyVal: '+MyVal));
}
}
<apex:page controller="MyCustomController">
<apex:messages />
<apex:form >
<apex:inputText id="textMyVal" value="{!MyVal}" />
<apex:message for="textMyVal"/>
<apex:commandButton action="{!save}" value="Save" />
</apex:form>
</apex:page>
Question:
I know I can use <apex:messages> or <apex:pageMessages>.
But is there a way to display my message in <apex:message for="textMyVal"/>? Can <apex:message> be used without an sObject?
Thanks!