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
Erite11Erite11 

VF page with Inline Editing andRerender issue?

Hi,

I have a VF page that is working when using an inputfield with a rerender, but I am trying to apply inline editing to the page, and can not figure out a way to make both coexist.

 

I am at a deadend, and want to find if someone else has an idea.

Pradeep_NavatarPradeep_Navatar

Find below a sample code for inline editing in salesforce to use the inputfield within repeat control.

function HideShow(rId,Id,mode)
{
var rowId = rId;
var accountId = Id;
var editrowId = 'edit:'+ Id;
if(mode == 'n')
{
    document.getElementById(rowId).style.display = 'none';
    document.getElementById(editrowId).style.display = 'block';
}
else if(mode == 'e')
{
    var rrowId = 'detail:'+ Id;
    document.getElementById(rrowId).style.display = 'block';
    document.getElementById(rowId).style.display = 'none';
    
}
}
</script>

<apex:repeat id="rptAccount" value="{!Account}" var="a" >
<div id="detail:{!a.id}" style="width:61%;display:block;" ondblclick="HideShow(this.id,'{!a.id}','n');">
<table border="2">
<tr>     
<td width='25%'><a href="#" onclick="popu('{!a.id}'); ><h2>{!a.name}</h2></a></td>
<td width='25%'><h2>  <span style="width:45%">{!a.phone}</span></h2></td>
<td width='25%'><h2> <span style="width:25%" >{!a.billingcity}</span></h2></td>
<td width='25%'>  <span style="width:25%" class='rows'>{!a.CreatedDate}</span></td>
</tr>
</table>
</div>
<div id="edit:{!a.id}" style="width:35%;display:none;" >
<table border="2">
<tr>
    <td width='25%'><h2><span style="width:25%"><apex:inputField value="{!a.name}" id="MTBName" /></span></h2></td>
    <td width='25%'> <h1><span style="width:25%"><apex:inputField id="MTBPhone" value="{!a.phone}"/></span></h1></td>
    <td width='25%'> <h2><span style="width:25%"><apex:inputField id="MTBBCity" value="{!a.billingcity}"/></span></h2></td>
    <td width='25%'> <h2><span style="width:25%"><apex:inputField id="MTBCDate" value="{!a.createddate}"/></span></h2></td>
    <td width='25%'><input id="pqr" type="button" class="btn" value="save" onclick="HideShow('edit:{!a.id}','{!a.id}','e');savedata('{!a.id}');"/></td><td><input type="button" class="btn" value="cancel" onclick="HideShow('edit:{!a.id}','{!a.id}','e');"/></td>
</tr>  
</table>
</div>