HTML Input Element of Type Text | User Input Component | Salesforce Exam DEV-501

User Input Component for Salesforce Controllers | DEV-501 Exam | HTML Text Input

Question

An HTML input element of type text.

Use this component to get user input for a controller method that does not correspond to a field on a Salesforce object.

This component does not use Salesforce styling.

Also, since it does not correspond to a field, or any other data on an object, custom code is required to use the value the user inputs.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

C.

The correct answer for this question is C. apex:inputText.

apex:inputText is a Visualforce component that renders an HTML input element of type text. This component allows users to input text that can be captured by a controller method that doesn't correspond to any field on a Salesforce object.

This component doesn't use Salesforce styling, which means that it doesn't inherit any CSS styles from Salesforce. Therefore, you can apply your custom styling to the input element using CSS.

When the user submits the form, the value entered in the apex:inputText component can be accessed in the controller method using the ApexPages.currentPage().getParameters() method. This method returns a map of all parameters sent with the request, including the value entered in the apex:inputText component. You can then use this value in your custom code as required.

In summary, apex:inputText is a Visualforce component that allows users to input text that can be captured by a controller method that doesn't correspond to any field on a Salesforce object. Custom code is required to use the value entered in the component, and it doesn't use Salesforce styling.