1
클릭 수를 계산하고 반환 할 때 개체의 필드를 업데이트하는 컨트롤러로 리디렉션되는 이미지 (commandLink)를 클릭하고 싶습니다. 그러나 페이지를 리디렉션하고 싶지는 않습니다. 사용자가 문서에서 파일을 다운로드 할 수있는 창이 나타납니다.명령 링크 페이지가 리디렉션되지 않음
여기 내 코드가 있습니다. 누군가가 outputlink 작업하는 방법을 말해 줄 수 .. 내 카운터가 잘 작동하지만.
<apex:pageBlockTable value="{!Docs}" var="d" rendered="{!if(Docs.size>0,true,false)}">
<apex:column >
<apex:commandLink action="{!incrementCounter}">
<apex:image url="{!URLFOR($Resource.LibraryImages)}" title="Click to Download" />
<apex:param assignTo="{!SelectedId}" name="selId" value="{!d.Id}"/>
<apex:outputLink value="/servlet/servlet.FileDownload?file={!d.Document_Id__c}"/>
</apex:commandLink>
</apex:column>
<apex:column headerValue="Downloaded" >
<apex:outputText value="{!d.Counter__c}" />
</apex:column>
</apex:pageBlockTable>
-------------------------------------------
public pagereference incrementCounter()
{
UpdateCount = [select id, counter__c from Document_Details__c where id =:SelectedId];
Decimal num= updatecount.counter__c;
updatecount.counter__c=num+1;
update updatecount;
Docs.clear();
// to get the updated values from the object
Docs=[Select id, Name__c, Document_Id__c, counter__c,Uploaded_by__c,Type__c,Description__c,Document_Created_On__c,My_Library__c From
Document_Details__c where My_Library__c=: MyLib.id];
return null;
}
나는 부분적으로 outputlink, action support 및 rerender를 사용하여 페이지를 새로 고치려고했으나 작동하지 않아 commandlink를 사용한다고 생각했습니다. 같은 <apex:actionStatus>
및 <apex:commandLink>
등