Голову ломаю который час, надеюсь на вашу помощь
1.Хотелось бы понять что значит эта часть кода:
String SearchContactKeywordCreteria = '%'+(SearchContactKeyword == null ? '' : SearchContactKeyword)+'%';
<apex:page controller="ContactsManagerController">
<apex:pageBlock title="Contact">
<apex:form>
<apex:inputText value="{!SearchContactKeyword}" />
<apex:commandButton value="Search" rerender="ContactTableBox" status="SearchStatus"/>
<apex:actionStatus id="SearchStatus">
<apex:facet name="start"><img src="/img/loading.gif" alt="" /></apex:facet>
<apex:facet name="stop"></apex:facet>
</apex:actionStatus>
<apex:outputPanel layout="block" id="ContactTableBox">
<apex:panelGrid columns="7">
<apex:commandButton action="{!setCon.first}" status="PaginationStatus" reRender="ContactTableBox" value="|<" disabled="{!!setCon.hasPrevious}" title="First Page"/>
<apex:commandButton action="{!setCon.previous}" status="PaginationStatus" reRender="ContactTableBox" value="<" disabled="{!!setCon.hasPrevious}" title="Previous Page"/>
<apex:commandButton action="{!setCon.next}" status="PaginationStatus" reRender="ContactTableBox" value=">" disabled="{!!setCon.hasNext}" title="Next Page"/>
<apex:commandButton action="{!setCon.last}" status="PaginationStatus" reRender="ContactTableBox" value=">|" disabled="{!!setCon.hasNext}" title="Last Page"/>
<apex:outputText >{!(setCon.pageNumber * size)+1-size}-{!IF((setCon.pageNumber * size)>noOfRecords, noOfRecords,(setCon.pageNumber * size))} of {!noOfRecords}</apex:outputText>
<apex:actionStatus id="PaginationStatus">
<apex:facet name="start"><img src="/img/loading.gif" alt="" /></apex:facet>
<apex:facet name="stop"></apex:facet>
</apex:actionStatus>
</apex:panelGrid>
<apex:pageBlockTable id="ContactTable" value="{!Contacts}" var="item">
<apex:column >
<apex:outputLink title="" value="/{!item.id}/e?retURL=/apex/{!$CurrentPage.Name}" style="font-weight:bold">Edit</apex:outputLink> |
<a href="javascript:if (window.confirm('Are you sure?')) DeleteAccount('{!item.Id}');" style="font-weight:bold">Del</a>
</apex:column>
<apex:column value="{!item.Name}"/>
<apex:column value="{!item.Email}" />
<apex:column value="{!item.Contact_Level__c}" />
<apex:column headerValue="Account" value="{!item.AccountId}" />
<apex:column headerValue="Owner" value="{!item.OwnerId}" />
<apex:column value="{!item.CreatedById}" />
<apex:column value="{!item.CreatedDate}" />
</apex:pageBlockTable>
</apex:outputPanel>
</apex:form>
</apex:pageBlock>
</apex:page>
public with sharing class ContactsManagerController { public String SearchContactKeyword { get; set; }
public Integer noOfRecords{get; set;}
public Integer size{get;set;}
public List<Contact> Contacts { get{
return (List<Contact>)setCon.getRecords();
} set; }
public ApexPages.StandardSetController setCon {
get{
if(setCon == null){
size = 10;
String SearchContactKeywordCreteria = '%'+(SearchContactKeyword == null ? '' : SearchContactKeyword)+'%';
List<Contact> ContactList = [SELECT Id, Name, Email, Contact_Level__c, AccountId, OwnerId, CreatedById, CreatedDate
FROM Contact
WHERE Name
LIKE :SearchContactKeywordCreteria
LIMIT 10000];
setCon = new ApexPages.StandardSetController(ContactList);
setCon.setPageSize(size);
noOfRecords = setCon.getResultSize();
}return setCon;
}set;
}
public void SearchContacts() {
setCon = null;
setCon.setPageNumber(1);
}
}
готовится поисковый стринг для дальнейшего использования в квери,
поставь после строки 20 в контроллере дебаг показывающий количество записей в ContactList, так узнаешь, доходит ли код до того места вообще, и сколько записей получено