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
BritishBoyinDCBritishBoyinDC 

Field Sets and Inline Editing

Just trying out the new Spring 11 functionality, and had a question I am hoping someone might know..

 

I can get field sets to work as input or output fields.

 

I can get Inline editing to work as advertised.

 

But is it possible to output a set of fields from a field set and have those fields enabled to use inline editing? I have tried to combine the various examples but with no success - is it possible and if so, can someone give me an example?

 

For instance, it looks from the Spring Webinar that this should work if I pass in a Contact Id into the page...

 

 

<apex:page standardController="Contact" >
<apex:sectionHeader title="Inline for {!contact.Name}"/>
<apex:form>
 
<apex:pageMessages/>
<apex:pageBlock>
<apex:pageBlockButtons>
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="2">
<apex:repeat value="{!$ObjectType.Contact.FieldSets.TestFS1}" var="f">
<apex:outputField value="{!Contact[f]}">
<apex:inlineEditSupport event="ondblclick"/>
</apex:outputField> 
</apex:repeat>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

 

Many thanks

Best Answer chosen by Admin (Salesforce Developers) 
stephanstephan

Thanks for bringing this up guys. Turns out this is a bug. We should have it fixed in next week's patch.

 

...stephan

All Answers

Jim BoudreauxJim Boudreaux

I am having the same experience. It is even more baffling when you consider that <apex:repeat> is listed as a supporting tag in the inlineEditSupport tag documentation. Why else would we ever use the inlineeditsupport tag in a repeat tag except for field sets?

Jim BoudreauxJim Boudreaux

BTW BritishBoyinDC, if we don't get an answer here in the forums by Thursday, fear not. I am attending the Atlanta Dev Meet Up in Atlanta Thursday evening and I swear to you I will get an answer one way or another!!

BritishBoyinDCBritishBoyinDC

Thanks Jim.

 

I created a custom controller that brought back a list of Contacts, and was able to get a PageBlockTable to work as advertised, which seems more complex than my example, so assuming I am just missing something...

stephanstephan

Thanks for bringing this up guys. Turns out this is a bug. We should have it fixed in next week's patch.

 

...stephan

This was selected as the best answer
BritishBoyinDCBritishBoyinDC

Thanks - glad to know I wasn't losing it!

Jim BoudreauxJim Boudreaux

Good to hear. I was not looking forward to threatening Quinton Thursday. :)

sfdc guy.ax723sfdc guy.ax723

BritishBoyinDC,

Where did you find documentation on using PageBlockTable with Field Sets?

 

sfdc guy

BritishBoyinDCBritishBoyinDC

Take a look in the version 21 of the VF docs, and search for inline

http://www.salesforce.com/us/developer/docs/pagespre/index.htm

cloudcodercloudcoder

Glad you didn't ask! I was building some examples today and tried the same thing. Great pick up. Thanks!

 

@altius_rup@altius_rup

Hi Stephane,

Thanks for the info.

I am using inlineeditsupport in a pageBlockTable in a page driven by a standard controller extension, and have the same problem : will that be fixed also ?

 

Rup

asadim2asadim2

Is this supposed to be fixed now? I still can't make my page inline editable. I've also tried the examples on the online documentation but nothing. Basically I have a pageBlockTable in which I have a <repeat> tag for the Field Set and inside of it I construct colums. Nothing crazy.

 

Thanks.

BritishBoyinDCBritishBoyinDC

This works for me:

 

Controller: (Expects to receive an Account Id named aid e.g. 

https://c.na7.visual.force.com/apex/ConUpdate?aid=001A0000009aOc7

 

 

public class ConUpdate {

    public PageReference updatecons() {
        update consforupdate;
        return null;
    }


List<Contact> consforupdate;

public conUpdate () {
consforupdate = [Select Id, LastName, Email, MobilePhone from Contact where AccountId = 
:ApexPages.currentPage().getParameters().get('aid')];
}

public list<Contact> getconsforupdate () {
return consforupdate;
}

}

 

 

Page:

 

 

<apex:page Controller="ConUpdate" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton action="{!updatecons}" value="update"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!Consforupdate}" var="c">
<apex:column >
<apex:facet name="header">
Contact Name
</apex:facet>
<apex:outputField value="{!c.LastName}">
<apex:inlineEditSupport />
</apex:outputField>
</apex:column>
<apex:column >
<apex:facet name="header">
Email
</apex:facet>
<apex:outputField value="{!c.Email}">
<apex:inlineEditSupport />
</apex:outputField>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

asadim2asadim2

Yes, if I'm not using FieldSets that works. The issue is with the combo of FieldSets + inline editing.