You need to sign in to do that
Don't have an account?
Visual force error
Hi,
I am new to salesforce i am trying to understand visualforce page and apex .I have wriiten piece of code in visual force without the controller as suggested by the developer book for salesforce but which is giving me error when i tried to save saying it is java.lang.IllegalArgumentException: Illegal view ID !{save}. The ID must begin with /
<apex:form >
<apex:pageBlock title="Edit Account for {!$User.FirstName}">
<apex:pageMessages />
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="!{save}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection >
<apex:inputField value="{!account.Start_Date__c}"/>
</apex:pageBlockSection>
<apex:pageBlockSection >
</apex:pageBlock>
</apex:form>
</apex:page>
Can someone tell me what am i making mistake in this code.I really appreciate your help.
Hi,
should be rewritten as,
All Answers
Seems like the pagereference that is being returned is causing problem
Hi,
should be rewritten as,
Thanks a lot guys for the replies it really helped.
Can someone explain me why are we using the "!{Save}" or why should we use the " ! " mark what does it signify? and sometime they put the "!" mark in the " {} " and sometimes they put outside the braces ..why do we have the differences and when how it has to be used?
If you have an example of Visualforce code where you see the exclamation mark outside the braces, e.g. "!{ something }", please let us know by clicking the feedback links at the bottom of the HTML version of the topic. It's almost certainly an error.
<open brace><exclaimation mark> ... <close brace>, or {! ... }, is the syntax for a Visualforce expression. Whatever is inside those delimiters will be evaluated by Visualforce. Generally speaking, the contents will be either a variable provided to the page by its controller, a controller method call, or a formula of some sort.
See the appendices in the Visualforce Developer's Guide for some more details, in the Functions and Expressions Operators appendices sections. You can also review the chapters on controllers for more details of accessing variables on a page, or calling controller methods.
Hi,
Alderete_SFDC has explained you everything. Its a syntax that we follow in visualforce.