public List<Evaluation_by_metric__c> getcheck() { mlist=[select Id, Name, Metric_description__c,Metric_board__c from Metric__c where Metric_board__c=: mb.Metric_board__c];
metList=[select id,Monthly__c,name,lightforce1989__Actual_currency__c,lightforce1989__Actual_percent__c,lightforce1989__Actual_number__c,lightforce1989__Generic_del_del__c from Evaluation_by_metric__c where Metric__c in:mlist ];
Public List<lightforce1989__Metric_board__c> getgreeting() { List<lightforce1989__Metric_board__c> lis=[select name from lightforce1989__Metric_board__c where id=:mb.lightforce1989__Metric_board__c]; return lis; }
@PANKAJ:I am getting the following error:Error: RecordWrapper Compile Error: unexpected token: public at line 17,column 0.Plz let me know how to resolve the error with proper correction in the code.
I dont know proper usage of wrapper class and its declaration,Can you plz integrate my code and your code and send the entire compiled code?It would be of great help for me.Thanks in advance.
vf page
All Answers
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title="Detailed summary" collapsible="false">
<apex:inputField label="Metric board" value="{!Metric__c.Metric_board__c}"/> <p/>
<apex:selectList label="Frequency" multiselect="false" value="{!freq}" size="1" >
<apex:selectOptions value="{!frequencylist}"/>
</apex:selectlist><p/>
<apex:commandButton value="process selected" action="{!save}"/>
</apex:pageBlockSection>
<div style="float:left;">
<div style="float:left;height:300px">
<apex:pageBlockTable value="{!check}" var="e" >
<apex:column value="{!e.name}"/>
<apex:column value="{!e.Generic_del_del__c}"/>
<apex:column value="{!e.lightforce1989__Actual_currency__c }" />
<apex:column value="{!e.Actual_percent__c}"/>
<apex:column value="{!e.lightforce1989__Actual_number__c }"/>
</apex:pageBlockTable>
</div>
</div>
</apex:pageBlock>
</apex:form>
</apex:page>
------------------------------------------------------------------------------
public class detailedcontroller {
public lightforce1989__Metric__c mb{get;set;}
public boolean saveMethodCalled{ get; set; }
public string freq{get;set;}
public List<Metric__c> mlist{get;set;}
public List<Evaluation_by_metric__c> metlist{get;set;}
public detailedcontroller(ApexPages.StandardController controller) {
this.mb=(lightforce1989__Metric__c)controller.getRecord();
}
//public lightforce1989__Evaluation_by_metric__c evm{get;set;}
public List<selectoption> getfrequencylist()
{
List<selectoption> fq=new List<selectoption>();
Schema.DescribeFieldResult fieldRest = lightforce1989__Evaluation_by_metric__c.lightforce1989__Frequency__c.getDescribe();
List<Schema.picklistEntry> ple = fieldRest.getPicklistValues();
for(Schema.picklistEntry f:ple)
{
fq.add(new selectOption(f.getLabel(),f.getValue()));
}
return fq;
}
public void save(){}
public List<Evaluation_by_metric__c> getcheck()
{
mlist=[select Id, Name, Metric_description__c,Metric_board__c from Metric__c where Metric_board__c=: mb.Metric_board__c];
metList=[select id,Monthly__c,name,lightforce1989__Actual_currency__c,lightforce1989__Actual_percent__c,lightforce1989__Actual_number__c,lightforce1989__Generic_del_del__c from Evaluation_by_metric__c where Metric__c in:mlist ];
return metList;
}
// savemethodcalled=true;
/*
system.debug('@@@@@@@@@'+mb.lightforce1989__Metric_board__c);
pagereference pg=new pagereference ('/'+mb.lightforce1989__Metric_board__c);
pg.setRedirect(true);
return pg; */
Public List<lightforce1989__Metric_board__c> getgreeting()
{
List<lightforce1989__Metric_board__c> lis=[select name from lightforce1989__Metric_board__c where id=:mb.lightforce1989__Metric_board__c];
return lis;
}
}
<apex:column value="{!e.lightforce1989__Actual_currency__c }" />
<apex:column value="{!e.Actual_percent__c}"/>
<apex:column value="{!e.lightforce1989__Actual_number__c }"/>
replace that with just on column and use if condition in value attribute to display either of the three values which are non null
Please check below mentioned code and let us know if this makes sense to you:
I made some corrections in your code and made the usage of wrapper class in it.
Have you declared the wrapper class? Can you please share your complete code here?
I made some modifications only in getcheck() only and place the wrapper class there. Rest of the code would be the same like variable declaration etc.
It seems the issue you are facing belongs to syntax error. Please check within the controller if you are missing anything.
vf page
Sorry, There was a miss from my end. Please add below mentioned line at 42, 54 and 64:
<apex:param value="{!e.genericValue }"/>