apex:attribute A definition of an attribute on a custom component. The attribute tag 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.
<!-- Page: -->
<apex:page>
<c:myComponent myValue="My component's value" borderColor="red" />
</apex:page>
<!-- Component:myComponent -->
<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"/>
<h1 style="border:{!borderColor}">
<apex:outputText value="{!myValue}"/>
</h1>
</apex:component>
<!-- Page: -->
<apex:page>
<c:myComponent myValue="My component's value" borderColor="red" />
</apex:page>
<!-- Component:myComponent -->
<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"/>
<h1 style="border:{!borderColor}">
<apex:outputText value="{!myValue}"/>
</h1>
</apex:component>
So as per this example, 1) <apex:page> using the component(i.e. myComponent). You can create myComponent under Setup->Build->Develop->Visualforce Components. 2) <apex:attribute> is same like variable which can be used for storing the value of mentioned data type. Like in above example, myvalue is an attribute of String type. 3) <apex:attribute> can be used only inside <apex:component></apex:component> tags.
apex:attribute A definition of an attribute on a custom component. The attribute tag 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.
<!-- Page: -->
<apex:page>
<c:myComponent myValue="My component's value" borderColor="red" />
</apex:page>
<!-- Component:myComponent -->
<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"/>
<h1 style="border:{!borderColor}">
<apex:outputText value="{!myValue}"/>
</h1>
</apex:component>
1) https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_html_features_pass_through_attributes.htm
2) https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_page.htm
To add a pass-through attribute to, for example, an <apex:outputPanel> component, prefix the attribute with “html-” and set the attribute value as normal. In above example below are component
<apex:page
<apex:outputPanel
<apex:insert
And below are attribute
showHeader
standardStylesheets
doctype
<apex:page showHeader="false" standardStylesheets="false" doctype="html-5.0">
Please check below post for all attribute list on page component
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_page.htm
You can also define your own componet and attribute like below
1) https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_attribute.htm
apex:attribute
A definition of an attribute on a custom component. The attribute tag 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.
Let us know if this will help you
All Answers
Please consider this example:
So as per this example,
1) <apex:page> using the component(i.e. myComponent). You can create myComponent under Setup->Build->Develop->Visualforce Components.
2) <apex:attribute> is same like variable which can be used for storing the value of mentioned data type. Like in above example, myvalue is an attribute of String type.
3) <apex:attribute> can be used only inside <apex:component></apex:component> tags.
Thanks,
Amit
1) https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_html_features_pass_through_attributes.htm
2) https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_page.htm
To add a pass-through attribute to, for example, an <apex:outputPanel> component, prefix the attribute with “html-” and set the attribute value as normal. In above example below are component
<apex:page
<apex:outputPanel
<apex:insert
And below are attribute
showHeader
standardStylesheets
doctype
<apex:page showHeader="false" standardStylesheets="false" doctype="html-5.0">
Please check below post for all attribute list on page component
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_page.htm
You can also define your own componet and attribute like below
1) https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_attribute.htm
apex:attribute
A definition of an attribute on a custom component. The attribute tag 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.
Let us know if this will help you