in Technology by
What is an attribute tag? What is the syntax for including them?

1 Answer

0 votes
by

An attribute tag is a definition of an attribute of a custom component and it can only be a child of a component tag.

Note that you cannot define attributes with names like id or rendered. These attributes are automatically created for all custom component definitions. The below piece of code shows the syntax for including them:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

<apex:component>

 <apex:attribute name="myValue" description="This is the value for the component." type="String" required="true"/>

 <apex:attribute name="borderColor" description="This is color for the border." type="String" required="true"/>

  

</p>

<p>

</p>

<p>

</p>

<p>

</p>

<h1 style="border:{!borderColor}">

 <apex:outputText value="{!myValue}"/>

 </h1>

<p>

</p>

<p>

</p>

<p>

</p>

<p>

 

</apex:component>

Related questions

0 votes
    I am refactoring some CSS on a website. I have been working on, and noticed the absence of traditional ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 25, 2022 in Education by JackTerrance
0 votes
    I am refactoring some CSS on a website. I have been working on, and noticed the absence of traditional ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 24, 2022 in Education by JackTerrance
0 votes
    a) Yukti has created a webpage. Which tag and attribute should she use to insert an image on this webpage? plz answer this also…. Select the correct answer from above options...
asked Dec 15, 2021 in Education by JackTerrance
0 votes
    What will happen if the browser encounters a script tag without an src attribute? (a) Throws an error ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
0 votes
    The sample xml file is shown below What should I write in XSLT so that i can get the sample ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    Which is not a value of the VALIGN attribute of the tag?* TOP CENTER MIDDLE BOTTOM Select the correct answer from above options...
asked Nov 28, 2021 in Education by JackTerrance
0 votes
    What is the purpose of holding whatever tag you create in the attribute type? (a) To have more ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
0 votes
    Ansible can deploy to virtualization and cloud environments, Including (i)Cloud Stack (ii)Google cloud platform (iii)All the Options (iv)Amazon web services (v)Open Stack...
asked Jan 25, 2023 in Technology by JackTerrance
0 votes
    What is difference between including the header file with-in angular braces < > and double quotes “ “?...
asked Jan 17, 2021 in Technology by JackTerrance
0 votes
    What is difference between including the header file with-in angular braces < > and double quotes “ “?...
asked Jan 17, 2021 in Technology by JackTerrance
+1 vote
    What is difference between including the header file with-in angular braces < > and double quotes “ “?...
asked Nov 9, 2020 in Technology by JackTerrance
...