I am currently trying to expand upon the Web-To-Case functionality by exposing certain updates to our users.
When trying to do this I would need a way for them to enter their case number, then pull up the field.
I've currently got the search field, and subsequent query running properly, but the case feed doesn't appear in the page, even after re-rendering it.
Visualforce code:
<apex:page standardController="Case" extensions="CaseReviewExtension" sidebar="false" showHeader="false">
<apex:form >
<span>Ticket Number:</span>
<apex:inputText value="{!caseNumber}"/>
<apex:commandButton value="Search" action="{!getCaseFeed}" reRender="feed"/>
<apex:outputField value="{!selectedCase.Id}" id="feed"/>
</apex:form>
<chatter:feed entityId="{!selectedCase.Id}" id="feed" showPublisher="true" feedItemType="CaseCommentPost"/>
</apex:page>
Apex Code:
public class CaseReviewExtension {
public final Case thisCase;
public String caseNumber {get;set;}
public Case selectedCase {get;set;}
public CaseReviewExtension(ApexPages.StandardController stdController) {
this.thisCase = (Case)stdController.getRecord();
selectedCase = new Case();
}
public void getCaseFeed(){
selectedCase = [SELECT Id FROM Case WHERE CaseNumber = :caseNumber];
}
}