I wonder, how can I pass input variable to getValuesForRepeat
in apex:repeat please. I.e, my apex:repeat renders different contents depends on inputVar1
.
Basically,
<apex:repeat value="{!valuesToBind}" var="valueToBind">
binds togetValuesToBind()
in the controller.getValuesToBind()
retrieve inputVar1 value from the controller constructor with inputVar1. ----> This value was not updated.
======> How can I get something like getValuesToBind(inputVar1)
or bind from visual force component please? <apex:repeat value="{!valuesToBind}" var="valueToBind" inputParam="someVariable">
In my controller
public class controllerClass {
public String inputVar1;
List<Object1> valuesForRepeat;
public controllerClass() {
}
public controllerClass(String inputVar1) {
setInputVar1(inputVar1);
}
public void setInputVar1(String inputVar1) {
this.inputVar1 = inputVar1;
}
public String getInputVar1() {
return this.inputVar1;
}
public List<Object1> getValuesToBind(){
Object2 obj = [SELECT blabla FROM Object2 where field =:***this.inputVar1*** Limit 1]; //HERE!!!!!!
valuesForRepeat = [SELECT field1, field2, blabla FROM Object1 where Id in :Object1Ids];
return valuesForRepeat;
}
}
In visual force component
<apex:component controller="controllerClass" access="global">
<apex:attribute name="templateBoundField" type="String" description="blabla" assignTo="{!inputVar1}" />
<apex:outputPanel rendered="{!!valuesToBind.empty}">
<apex:repeat value="{!valuesToBind}" var="valueToBind">
<table >
<table >
<tr><td ">{!valueToBind.field1}</span></td></tr>
</table>
</table>
</apex:repeat>
</apex:outputPanel>
<apex:outputPanel rendered="{!valuesToBind.empty}">
<p >
No New ValuesToBind to Report.
</p>
</apex:outputPanel>
</apex:component>