Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String sel_id{get;set;}
- public void DeleteRow()
- {
- system.debug('sel_id = ' + sel_id );
- try{
- if(sel_id != null || sel_id != '')
- {
- Color_Coding__c cc = new Color_Coding__c(id=sel_id);
- delete cc;
- RefreshColor();
- }
- }catch(Exception e)
- {
- ApexPages.Message MyMsg = new ApexPages.Message(ApexPages.Severity.ERROR, e.getMessage());
- ApexPages.addMessage(myMsg);
- }
- }
- public void RefreshColor()
- {
- try{
- colorCoding = new List<Color_Coding__c>();
- colorCoding = Color_Coding__c.getAll().Values();
- }catch(Exception e)
- {
- ApexPages.Message MyMsg = new ApexPages.Message(ApexPages.Severity.ERROR, e.getMessage());
- ApexPages.addMessage(myMsg);
- }
- }
- <apex:repeat value="{!colorCoding}" var="c" >
- <tr>
- <td><apex:inputField value="{!c.Name}"/></td>
- <td><apex:inputField value="{!c.Color_Code__c}"/></td>
- <td><apex:inputField value="{!c.Min_Value__c}"/></td>
- <td><apex:inputField value="{!c.Max_Value__c}"/></td>
- <td><apex:commandLink action="{!DeleteRow}" value="Delete" reRender="pb" immediate="true">
- <apex:param assignTo="{!sel_id}" value="{!c.id}" name="id"/>
- </apex:commandLink></td>
- </tr>
- </apex:repeat>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement