A developer creates a custom controller and custom Visualforce page - ProProfs Discuss
Topics
Products
Follow Us:

A developer creates a custom controller and custom Visualforce page by using the following code block:public class myController {public String myString;public String getMyString() {return 'getmyString';}public String getStringMethod1() {return myString;}public String getStringMethod2() {if (myString == null)myString = 'Method2';return myString;}}{!myString}, {!StringMethod1}, {!StringMethod2}, {!myString}What does the user see when accessing the custom page?

This question is part of Salesforce Platform Developer 1
Asked by Cmduquer, Last updated: Jan 18, 2020

+ Answer
Request

5 Answers

kei

write something about yourself

Kei , a, a, ja

Answered Dec 10, 2019

To display the results of a getter method in a page, use the name of the getter method without the get prefix in an expression. For example, to display the result of the getName method in page markup, use {!Name}: https://developer.salesforce.com/docs/atlas.en-us.222.0.pages.meta/pages/pages_quick_start_controller_getter_methods.htm

 

silviamal

Silviamal

Answered Nov 25, 2019

The answer is not correct, as the variable myString is never assigne with a value, in the sequence in the page: {!MyString}, {!StringMethod1}, {!StringMethod2}, {!MyString} we'd get , , Method2,

 

ed.mdiaz

Ed.mdiaz

Answered Nov 14, 2019

I dont know how begins with GetMyString, because the method is not called. Please Explain !!

 

alexskempris

Alexskempris

Answered Nov 05, 2019

Can someone explain this please? Is it purely on the order the constructor calls the methods?

 

cmduquer

Cmduquer

Answered Sep 07, 2018

GetMyString , , Method2 , getMystring

####
 

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

Email Sent
We have sent an email to your address "" with instructions to reset your password.