Skip to content

Instantly share code, notes, and snippets.

@artlung
Created February 9, 2018 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artlung/71b17296674c92fe54028ad50771e7f1 to your computer and use it in GitHub Desktop.
Save artlung/71b17296674c92fe54028ad50771e7f1 to your computer and use it in GitHub Desktop.
<apex:page controller="DreamhouseProspects">
<apex:pageBlock >
<apex:sectionHeader title="Leads" subtitle="Home"/>
<apex:form >
<div style="text-align:center;">
<apex:commandButton action="{!URLFOR($Action.Lead.New)}" value="New"/>
</div>
<apex:outputLabel value="Sort: " for="sortList" />
<apex:selectList value="{! sortOrder}" size="1" id="sortList">
<apex:selectOption itemvalue="LastName" />
<apex:selectOption itemvalue="FirstName" />
</apex:selectList>
<apex:commandButton value="Sort Table" action="{!sortList}" reRender="leads_list"/>
<apex:pageBlockTable value="{! leads }" var="ct" id="leads_list">
<apex:column headerValue="First Name">
<apex:outputLink value="/{! ct.Id}">{! ct.FirstName }</apex:outputLink>
</apex:column>
<apex:column value="{! ct.LastName }"/>
<apex:column value="{! ct.Email }"/>
<apex:column value="{! ct.Phone }"/>
</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>
</apex:page>
<apex:page controller="DreamhouseProspects" lightningStylesheets="true">
<apex:slds rendered="{! !isClassic}"/>
<apex:pageBlock >
<apex:form >
<apex:outputPanel rendered="{! isClassic}">
<apex:sectionHeader title="Leads" subtitle="Home"/>
<div style="text-align:center;">
<apex:commandButton action="{!URLFOR($Action.Lead.New)}" value="New"/>
</div>
<apex:outputLabel value="Sort: " for="sortList" />
<apex:selectList value="{! sortOrder}" size="1" id="sortList">
<apex:selectOption itemvalue="LastName" />
<apex:selectOption itemvalue="FirstName" />
</apex:selectList>
<apex:commandButton value="Sort Table" action="{!sortList}" reRender="leads_list"/>
</apex:outputPanel>
<apex:outputPanel rendered="{! !isClassic}">
<div class="slds-page-header">
<div class="slds-grid">
<div class="slds-col slds-has-flexi-truncate" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<div class="slds-media slds-no-space slds-grow">
<div class="slds-media__figure">
<svg class="slds-icon slds-icon-standard-user .slds-icon_small" aria-hidden="true">
<use xlink:href="{!URLFOR($Asset.SLDS, 'assets/icons/standard-sprite/svg/symbols.svg#lead')}"></use>
</svg>
</div>
<div class="slds-media__body">
<p class="slds-text-title_caps slds-line-height_reset">Lead</p>
<h1 class="slds-page-header__title slds-m-right_small slds-align-middle slds-truncate"
title="this should match the Record Title">Home</h1>
</div>
</div>
<div class="slds-grid slds-grid_vertical-align-end slds-m-vertical_small">
<div class="slds-size_1-of-6 ">
<apex:outputLabel value="Sort: " for="sortListLightning" styleClass="slds-form-element__label" />
<div class="slds-select_container">
<apex:selectList value="{! sortOrder}" size="1" id="sortListLightning" styleClass="slds-select">
<apex:selectOption itemvalue="LastName" />
<apex:selectOption itemvalue="FirstName" />
</apex:selectList>
</div>
</div>
<div class="slds-no-flex slds-m-left_x-small">
<apex:commandButton value="Sort" action="{!sortList}" reRender="leads_list" styleClass="slds-button slds-button_neutral"/>
</div>
</div>
</div>
<div class="slds-col slds-no-flex slds-grid slds-align-top">
<apex:commandButton action="{!URLFOR($Action.Lead.New)}" value="New" styleClass="slds-button slds-button_neutral"/>
</div>
</div>
</div>
</apex:outputPanel>
<apex:pageBlockTable value="{! leads }" var="ct" id="leads_list">
<apex:column headerValue="First Name">
<apex:outputLink value="/{! ct.Id}">{! ct.FirstName }</apex:outputLink>
</apex:column>
<apex:column value="{! ct.LastName }"/>
<apex:column value="{! ct.Email }"/>
<apex:column value="{! ct.Phone }"/>
</apex:pageBlockTable>
</apex:form>
</apex:pageBlock>
</apex:page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment