You create controllers the same way you created extensions in the previous tutorial, by navigating to Visualforceeditor create them for you.
. You can also have the - Create a new Visualforce page named AccountWithContacts.
- Enter the following as the body of the page:
<apex:page controller="MyController"> <apex:form> <apex:dataList value="{! myaccounts}" var="acct"> <apex:outputText value="{! acct.name}"/> </apex:dataList> </apex:form> </apex:page>
The contents of the page will be very familiar to you. The primary component iterates over a list of accounts, displaying their names. Where is myaccounts defined? It’s not defined yet, but it will reside in the controller that you specified, MyController. - Click Save.
- Visualforce notes that the class MyController doesn’t exist. Click Create Apex class 'public class MyController'.
- Visualforce notes that there’s an unknown property myaccounts and offers to create it for you. Click Create Apex method 'MyController.getMyAccounts'.
You will notice two things in your Visualforce editor. First, there’s another error message: Unknown property 'String.name'. This happens because you haven’t quite fully defined the getMyAccounts() method yet. Visualforce doesn’t know the type that will be returned by that method. You’ll also notice a new tab has appeared next to Page Editor titled Controller. This lets you modify the controller’s Apex class.
then how should I overcome this problem.....
ReplyDeleteI am following your blog from the beginning, it was so distinct & I had a chance to collect conglomeration of information that helps me a lot to improvise myself.
ReplyDeleteCloud is one of the tremendous technology that any company in this world would rely on(Cloud computing course in Chennai). Using this technology many tough tasks can be accomplished easily in no time. Your content are also explaining the same(Cloud computing training chennai). Thanks for sharing this in here. You are running a great blog, keep up this good work.
ReplyDeleteThere are lots of information about latest technology and how to get trained in them, like Big Data Training in Chennai have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies(Big Data Training). By the way you are running a great blog. Thanks for sharing this.
ReplyDeleteHadoop Training in Chennai | Big Data Training in Chennai
Thank you for sharing your thoughts SalesForce online training
ReplyDelete
ReplyDeleteThe way you have explained the Big Data concept is really superb! I have never come across such a informative blog in my career. Nowadays, Hadoop course is in high demand by most of the professional to enhance their career.
Regards:
Big Data Training |
Big Data Course in Chennai
Nice blog on Selenium Testing!!! I agree with your points, Testing will help whole organization to handle the projects in efficient manner.
ReplyDeleteSelenium Training in chennai |
selenium training in t nagar
Great post! I really enjoyed reading it. Keep sharing such articles. Looking forward to learn more from you.
ReplyDeleteG4EXcellence Security & Facility Services
Best Security & Facility Services in Chennai
Security service Providers in Chennai
Leading Security Service Providers in Chennai
Building Security Services
Facility Service Providers in Chennai
There are lots of information about digital marketing have spread around the web, but this is a unique one
ReplyDeleteaccording to me. The strategy you have updated here will make me to get to the next level in digital
marketing. Thanks for sharing this.
Visit SKARTEC
SKARTEC Digital Marketing Academy
digital marketing course fees
digital marketing course online
digital marketing course near me
digital marketing course in chennai fees
digital marketing course in tamil
digital marketing course with placement
digital marketing training institute in chennai
digital marketing training institute
digital marketing training institute near me
digital marketing training in india
digital marketing training in chennai
I gathered lots of information from your blog and it helped me a lot. Keep posting more. good luck guys
ReplyDeleteAi & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai
BEST POST.
ReplyDeletehttps://www.kitsonlinetrainings.com/course/salesforce-online-training salesforce online training
Angular JS training
Selenium training
DevOps training
Pega training
Servicenow training