• reguri
  • NEWBIE
  • 10 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hi All,

The below standardset controller code  is not saving the record changes.
Please help me to find where I am going wrong.

<apex:page controller="iolineController" >
<apex:form >
     <apex:pageBlock mode="inlineEdit" id="pb">
        <apex:pageBlockTable value="{!iolines}" var="line">
         <apex:column value="{!line.id}"/>
            <apex:column headerValue="Name">
              <apex:outputField value="{!line.Name}" />
            </apex:column>  
         </apex:pageBlockTable>
      </apex:pageBlock>
<apex:commandButton value="Save" action="{!setCon.save}" title="Refresh Page"/>
</apex:form>        
</apex:page>

public class iolineController {

    public List<io_Line__c> getIolines() {
        return (List<io_Line__c>) setCon.getRecords();
    }
     public string channelIOId;
   
  public ApexPages.StandardSetController setCon {
        get {
            channelIOId= ApexPages.CurrentPage().getParameters().get('chId');
            if(setCon == null) {
                   setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
                   [Select i.Name, i.Id  From IO_Line__c i where i.Channel_IO__c=:channelIOId ]));
                 
            }
            return setCon;
        }
        set;
    }
   

}
  • February 12, 2014
  • Like
  • 0
Hi All,

The below visualforce page throws this error while referencing wrapper class field. "Error: Unknown property 'IOLineHistoryController1.ioLinehistory.LineName'"

Visualforce page:

<apex:page controller="IOLineHistoryController1" action="{!getRecordsTodisplay}">
<apex:form >
<apex:pageBlock >
  <apex:pageblockTable value="{!display_list}" var="rec">
      <apex:column value="{!rec.LineName}" />
  </apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>


Controller class

public with sharing class IOLineHistoryController1 {
public string channelIOId{get;set;}
public List<ioLinehistory> display_list { get;set;}
public PageReference getRecordsTodisplay()
{
   for (IO_Line__C line:iolineList)
         {
           for(IO_Line__History lhistory:line.Histories)
           {
               display_list.add(new ioLinehistory(line.id, line.name,lhistory ));
            }
         }
         return null;
}
public List<IO_Line__C>  iolineList{get;set;}
public class ioLinehistory
    {
        String LineId {get;set;}
        String LineName {get;set;}
        IO_Line__History lineHistory {get;set;}
        public ioLinehistory(String lid, String lName, IO_Line__History lineHistory1)
        {
            this.LineId = lid;
            this.LineName = lName;
            this.lineHistory =lineHistory1;
        }
    }
  



public IOLineHistoryController1() {
   
      display_list = new List<ioLinehistory>();
       channelIOId= ApexPages.CurrentPage().getParameters().get('chId');
       System.debug('channelIOId:'+channelIOId);
       iolineList= new List<IO_Line__C>([Select i.Name, i.Id, i.Channel_IO__c, (Select Id, IsDeleted, ParentId, CreatedBy.Name, CreatedDate, Field, OldValue, NewValue From Histories) From IO_Line__c i where i.Channel_IO__c=:channelIOId]);
       
       
    }
}
if I replace
<apex:column value="{!rec.LineName}" />
with
<apex:column value="{!rec}" />
I am able to see the complete record.
Please let me know if I missed something.

Thanks
Praveen
  • January 04, 2014
  • Like
  • 0
Hi All,

The below standardset controller code  is not saving the record changes.
Please help me to find where I am going wrong.

<apex:page controller="iolineController" >
<apex:form >
     <apex:pageBlock mode="inlineEdit" id="pb">
        <apex:pageBlockTable value="{!iolines}" var="line">
         <apex:column value="{!line.id}"/>
            <apex:column headerValue="Name">
              <apex:outputField value="{!line.Name}" />
            </apex:column>  
         </apex:pageBlockTable>
      </apex:pageBlock>
<apex:commandButton value="Save" action="{!setCon.save}" title="Refresh Page"/>
</apex:form>        
</apex:page>

public class iolineController {

    public List<io_Line__c> getIolines() {
        return (List<io_Line__c>) setCon.getRecords();
    }
     public string channelIOId;
   
  public ApexPages.StandardSetController setCon {
        get {
            channelIOId= ApexPages.CurrentPage().getParameters().get('chId');
            if(setCon == null) {
                   setCon = new ApexPages.StandardSetController(Database.getQueryLocator(
                   [Select i.Name, i.Id  From IO_Line__c i where i.Channel_IO__c=:channelIOId ]));
                 
            }
            return setCon;
        }
        set;
    }
   

}
  • February 12, 2014
  • Like
  • 0
Hi All,

The below visualforce page throws this error while referencing wrapper class field. "Error: Unknown property 'IOLineHistoryController1.ioLinehistory.LineName'"

Visualforce page:

<apex:page controller="IOLineHistoryController1" action="{!getRecordsTodisplay}">
<apex:form >
<apex:pageBlock >
  <apex:pageblockTable value="{!display_list}" var="rec">
      <apex:column value="{!rec.LineName}" />
  </apex:pageblockTable>
</apex:pageBlock>
</apex:form>
</apex:page>


Controller class

public with sharing class IOLineHistoryController1 {
public string channelIOId{get;set;}
public List<ioLinehistory> display_list { get;set;}
public PageReference getRecordsTodisplay()
{
   for (IO_Line__C line:iolineList)
         {
           for(IO_Line__History lhistory:line.Histories)
           {
               display_list.add(new ioLinehistory(line.id, line.name,lhistory ));
            }
         }
         return null;
}
public List<IO_Line__C>  iolineList{get;set;}
public class ioLinehistory
    {
        String LineId {get;set;}
        String LineName {get;set;}
        IO_Line__History lineHistory {get;set;}
        public ioLinehistory(String lid, String lName, IO_Line__History lineHistory1)
        {
            this.LineId = lid;
            this.LineName = lName;
            this.lineHistory =lineHistory1;
        }
    }
  



public IOLineHistoryController1() {
   
      display_list = new List<ioLinehistory>();
       channelIOId= ApexPages.CurrentPage().getParameters().get('chId');
       System.debug('channelIOId:'+channelIOId);
       iolineList= new List<IO_Line__C>([Select i.Name, i.Id, i.Channel_IO__c, (Select Id, IsDeleted, ParentId, CreatedBy.Name, CreatedDate, Field, OldValue, NewValue From Histories) From IO_Line__c i where i.Channel_IO__c=:channelIOId]);
       
       
    }
}
if I replace
<apex:column value="{!rec.LineName}" />
with
<apex:column value="{!rec}" />
I am able to see the complete record.
Please let me know if I missed something.

Thanks
Praveen
  • January 04, 2014
  • Like
  • 0