+ Start a Discussion
PappuPappu 

new question

Hi All,

I am new to salesforce. Got an requirement to create a Visual force page in lightning for list-view of Custom object and also, i should be able to perform in-line editing on their list views.

Any help is highly appreciated.
Deepak Kumar SharmaDeepak Kumar Sharma
Hi,
you can also create a component and try the below syntax for creating listview in lightning :-
<aura:component>
<lightning:listView aura:id="listViewAccounts"
                              objectApiName="Account"
                              listName="My_Accounts"
                              rows="5" showActionBar="false" 
                              enableInlineEdit="true"
                              showRowLevelActions="false" />
</aura:component>
Thanks,
If it really helps you please select this as best answere. happy coding :)
SandhyaSandhya (Salesforce Developers) 
Hi,

I would suggest you refer below blog for the same.

https://www.forcetalks.com/blog/inline-edit-support-in-custom-component-in-salesforce-lightning/
 
Please mark it as solved if my reply was helpful. It will make it available for other as the proper solution.
 
Best Regards
Sandhya
 
 
PappuPappu
Thanks for the reply guys.

I have used component and APEX class to create the VF page. It is working to a level, but inline - editing and lightning look is not displaying in salesforce page. I stuck up with below code and not able to proceed further.

VF Page:

<apex:page lightningStylesheets="true">
              <c:Test_EnhancedListcomponent listViewName="CUSTOM LIST VIEW NAME"/>   
</apex:page>

Component:

<apex:component controller="RequestListViewController">  
  <apex:attribute name="listViewName" type="String" required="true" 
    description="The name of the listview." assignTo="{!listName}"/>   
  <apex:enhancedList height="400" rowsPerPage="25" id="RequestList"
    listId="{!listId}" rendered="{!listId != null}" />
  <apex:outputText rendered="{!listId == null}" value="Could not find requewed ListView: '{!listName}'. Please contact your administrator."/>
</apex:component>

APEX Class:

public with sharing class RequestListViewController {

  public String listName {
    get;
    set {
        listName = value;
        String qry = 'SELECT Name FROM Request__C LIMIT 1';
        ApexPages.StandardSetController ssc = 
            new ApexPages.StandardSetController(Database.getQueryLocator(qry));
        List<SelectOption> allViews = ssc.getListViewOptions();
        for (SelectOption so : allViews) {
          if (so.getLabel() == listName) {
            // for some reason, won't work with 18 digit ID
            listId = so.getValue().substring(0,15);
            break;
          }
        }             
    }      
  }
  public String listId {get;set;}

}