You need to sign in to do that
Don't have an account?
Oron Mizrachi
Inline edit query result from costume object visualforce
the Inline Editing doesn't work in the pageBlockTable (editable but doesn't update changes).
my suspicions its related to the need to update controller object from sql query running on costume object.
buy i don't know how to solve it , because its the best method to get this specific data. Any ideas?
Thank you.
Visualforce Page
Extension
my suspicions its related to the need to update controller object from sql query running on costume object.
buy i don't know how to solve it , because its the best method to get this specific data. Any ideas?
Thank you.
Visualforce Page
<apex:page showHeader="false" sidebar="false" standardController="ACCOUNT" extensions="BackStationsController"> <apex:form > <apex:pageBlock title="Room Deatels" > <apex:pageBlockButtons location="bottom"> <apex:commandButton action="{!save}" id="saveButton" value="Save" rendered="true"/> </apex:pageBlockButtons> <apex:pageMessages /> <apex:pageBlockSection columns="1" title="Room Guests List" rendered="TRUE" collapsible="false"> <apex:pageBlockTable value="{!constroom}" var="croom" rows="5"> <apex:inlineEditSupport event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/> <apex:column headerValue="Local ID" value="{!croom.PasiveAccount__r.Local_ID__c}"/> <apex:column headerValue="First Name" value="{!croom.PasiveAccount__r.firstname}"/> <apex:column headerValue="Last Name" value="{!croom.PasiveAccount__r.lastname}"/> <apex:column headerValue="Email" value="{!croom.PasiveAccount__r.PersonEmail}"/> <apex:column headerValue="Phone" value="{!croom.PasiveAccount__r.phone}"/> </apex:pageBlockTable> </apex:pageBlockSection> </apex:outputPanel> </apex:pageBlock> </apex:form>
Extension
public with sharing class BackStationsController { public BackStationsController(ApexPages.StandardController std) { stdCtrl=std; integer Tempcount = [Select Count() from UnitCloneJunc__c where ActiveAccount__r.id =:stdCtrl.getId()]; if (stdCtrl.getId() != NULL && temp >0 ) setupRoomchange(); } private ApexPages.StandardController stdCtrl {get; set;} public List<UnitCloneJunc__c> constroom {get; set;} Private void setupRoomchange(){ constroom=[select ID,PasiveAccount__r.phone, PasiveAccount__r.firstname, PasiveAccount__r.lastname,PasiveAccount__r.PersonEmail,PasiveAccount__r.Local_ID__c from UnitCloneJunc__c where id != null and ActiveAccount__r.isPersonAccount = true and ActiveAccount__r.id =:stdCtrl.getId() order by CreatedDate ASC]; }
Uou call save method from standart controller, this save only account record for which you open page. You need write own save method, and don't forgot that when you update UnitCloneJunc__c it's not updated related PasiveAccount__r record.
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks,
Alex
though it dosent work.
constroom sql return multiple PasiveAccount__r, how would it knows to update the spacific PasiveAccount__r been edited?
im using in a in a diffrenete table (but similar use) a commandlink ('delete guest') and <apex:param name="selAccId" value="{!croom.Id}" assignTo="{!selectedelId}" /> to pass the selected Account id parameter . but i dont know how to do it with Inline edit.
As i understand, u want edit some "PasiveAccount__r" fields and save only records that contains changes.
For it u can create duplicate(full copy) - old version of initial constroom array, user edit only original constroom and when click save button u need check both array for determine changes.
Please see code below
Thanks,
Alex
understood the logic. thank you. but again it dosent work. with no errors, just dosent update.