function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MsKnightMsKnight 

Dynamic pageBlockTable - ondblclick/onRowclick

Hi,

I'm trying to create a VF page that will display a budget line items in an easily editable format. So far I have been able to display both the budget information at the top of the page and the associated line items below in a pageBlockTable.

Code:
<apex:page Standardcontroller="Budget__c">
<apex:detail relatedList="false"/>
   <apex:pageBlock title="Budget Line Items">
       <apex:pageBlockTable value="{!Budget__c.BudgetLine__r}" var="lineItem">
        <apex:column value="{!lineItem.Name}"/>
        <apex:column value="{!lineItem.Cost_Code__c}"/>
        <apex:column value="{!lineItem.Category__c}"/>
        <apex:column value="{!lineItem.Sales_Budget__c}" />
        <apex:column value="{!lineItem.PM_Initial_Projection__c}"/>
        <apex:column value="{!lineItem.Active_Budget__c}"/>
      </apex:pageBlockTable>
   </apex:pageBlock>
</apex:page>

 I want the end user to be able to double click on a field in the "Budget Line Items" table, edit it and then have the field save (similar functionality to the Enhanced List View). I've been digging through the documentation and haven't found the best way of going about this. Any suggestions on implementing ondblclick or onRowclick for a table?


Thanks!

Nick.ax106Nick.ax106
Hi,

You just need to add the HTML with the links:  /e for edit /d for delete /s for save

eg.

Code:
<apex:pageblocktable value="{!caselist}" var="s">
<apex:column headervalue="Action" colspan="5"><B><a href="/{!s.id}/e">Edit</a> | <a href="/{!s.id}/s">Cls</a> </B> </apex:column>
<apex:column headervalue="Case"><a href="/{!s.id}">{!s.casenumber}</a> </apex:column>
<apex:column headervalue="Subject">{!s.subject} </apex:column>
</apex:pageblocktable></apex:pageBlock>