Saturday, August 2, 2014

Inline Editing in Visualforce Page.

Inline Editing in Visualforce Page.


Hi,
In this post i am giving basic example of how to work with inline editing in visualforce page.

Controller Class:
public class AccountInlineEditCLs {
public List<account> acclst=new List<account>();

public List<account> getAccounts(){
 acclst=[select name,industry,type,Description from account];
      return acclst;

}

public void save1() {
     update acclst;
}
}

Visualforce Page:

<apex:page controller="AccountInlineEditCLs">
<apex:form >
<apex:pageBlock mode="inlineEdit">
<apex:pageBlockButtons >
<apex:commandbutton value="save" action="{!save1}"/>
</apex:pageBlockButtons>
<!-- calling getAccounts() methods in pageblock table -->
<apex:pageBlockTable value="{!accounts}" var="a">
<apex:column Headervalue="Account Name">
<apex:outputfield value="{!a.name}"/>
</apex:column>
<apex:column headervalue="Industry">
<apex:outputfield value="{!a.industry}"/>
</apex:column>
<apex:column >
<apex:outputfield value="{!a.type}"/>
</apex:column>

</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>

Output: 

save image


save image



Thank's for reading....




1 comments:

Post a Comment

 
| ,