You need to sign in to do that
Don't have an account?
Bareera Noor
Visual force trailhead Challenge: Create & Use Custom Controllers
I need help with the fllowing code:
apex:page controller="ContactsListController">
<apex:form >
<apex:pageBlock title="Contacts List" id="contacts_list">
<!-- Contacts List goes here -->
<!-- Contacts List -->
<apex:pageBlockTable value="{! contacts }" var="ct">
<apex:column value="{! ct.FirstName }"/>
<apex:facet name="header">
<apex:commandLink action="{! sortByFirstName }"
reRender="contacts_list">First Name
</apex:commandLink>
</apex:facet>
</apex:column>
<apex:column value="{! ct.LastName }"/>
<apex:facet name="header">
<apex:commandLink action="{! sortByLastName }"
reRender="contacts_list">Last Name
</apex:commandLink>
</apex:facet>
</apex:column>
<apex:column value="{! ct.Title }"/>
<apex:column value="{! ct.Email }"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
I wrote this code but everytime I run this code it gives me a following error.
Error: ContactListController line 15, column 7: The element type "apex:pageblocktable" must be terminated by the matching end-tag "</apex:pageblocktable>"
Error: The element type "apex:pageblocktable" must be terminated by the matching end-tag "</apex:pageblocktable>".
apex:page controller="ContactsListController">
<apex:form >
<apex:pageBlock title="Contacts List" id="contacts_list">
<!-- Contacts List goes here -->
<!-- Contacts List -->
<apex:pageBlockTable value="{! contacts }" var="ct">
<apex:column value="{! ct.FirstName }"/>
<apex:facet name="header">
<apex:commandLink action="{! sortByFirstName }"
reRender="contacts_list">First Name
</apex:commandLink>
</apex:facet>
</apex:column>
<apex:column value="{! ct.LastName }"/>
<apex:facet name="header">
<apex:commandLink action="{! sortByLastName }"
reRender="contacts_list">Last Name
</apex:commandLink>
</apex:facet>
</apex:column>
<apex:column value="{! ct.Title }"/>
<apex:column value="{! ct.Email }"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
I wrote this code but everytime I run this code it gives me a following error.
Error: ContactListController line 15, column 7: The element type "apex:pageblocktable" must be terminated by the matching end-tag "</apex:pageblocktable>"
Error: The element type "apex:pageblocktable" must be terminated by the matching end-tag "</apex:pageblocktable>".
<apex:column value="{! ct.FirstName }"/>
Update your code like below
Let us know if this will help you