You need to sign in to do that
Don't have an account?
Dynamic column using method
Hello, how are you ?!?!?
Well, I'm having a problem with my code. I'm trying to do a table with dynamics columns. But to each line I have differents registers. Look down:
apex:form >
apex:pageBlock >
apex:pageBlockTable value="{!listFuncionario}" var="func">
apex:column headerValue="Funcionario">
apex:outputField value="{!func.name}"/>
/apex:column>
apex:repeat value="{!staffGet(func.name)}" var="eachDay">
apex:column headerValue="{!eachDay.Diad__c}">
apex:inputField value="{!eachDay.Diad__c}"/>
/apex:column>
/apex:repeat>
/apex:pageBlockTable>
/apex:pageBlock>
/apex:form>
public List<Dia__c> staffGet(String name){
List<Dia__c> days;
days = [select id, name, Diad__c, FuncionarioPai__r.name from Dia__c where FuncionarioPai__r.name = :name];
return days;
}
Finally, my problem is in this line: <apex:repeat value="{!staffGet(func.name)}" var="eachDay">
The error message is this: Unknown function staffGet. Check spelling.
I don't know how to solve this problem !!! :-(
Somebody can help me ?!?!
Thank you so much !!!!!
public List<Dia__c> getstaffGet(String name){
List<Dia__c> days;
days = [select id, name, Diad__c, FuncionarioPai__r.name from Dia__c where FuncionarioPai__r.name = :name];
return days;
}
^^^ try that. You have to specify it's a getter method by including get in the beginning.
Actually, to me, this won't change the problem !
Thank you again !!