I want a value from one input field to be copied into all pageBlock fields. I could insert records with the value, but then user wouldn't be able to change individual values in the pageBlock.
Current code is:
<apex:form >
<apex:inputtext value="{!newQuoteValue}" required="true">
<apex:actionSupport event="onchange" rerender="newQuotesBlock"/>
</apex:inputText>
<apex:pageblock id="newQuotesBlock" >
<apex:pageblockTable value="{!wrapperObj}" var="Rec">
<apex:column headerValue="£/year" >
<apex:inputtext value="{!Rec.Standing}" required="true"/>
</apex:column>
Apex:
Public List<WrapperClassEx> WrapperList {get;set;}
public long newQuoteValue {get;set;}
Public Class WrapperClassEx{
Public WrapperClassEx(sobject accRec, string meterNameMethodVar, string meterAQ, string meterIDs, long massStanding ){
elecObj = accRec;
meterName = meterNameMethodVar;
AQ=meterAQ;
meterID=meterIDs;
standing=massStanding;
}
}
Public List<WrapperClassEx> getwrapperObj(){
List<electricity_meter__c> MeterList = [Select id,name,AQ__c,meter_details__c from electricity_meter__c where (Linked_Monitor_Line__c =: lineId)];
WrapperList = New List<WrapperClassEx>();
for(electricity_meter__c met: MeterList){
String meterNameInner = String.valueOf( met.get('Name') );
String meterAQ = String.valueOf( met.get('AQ__c') );
String meterID = String.valueOf( met.get('meter_details__c') );
long massStanding = newQuoteValue;
WrapperList.add(New WrapperClassEx(met,meterNameInner,meterAQ,meterID,massStanding ));
}
return WrapperList;
}
I am guessing that getwrapperObj is not being updated from onChange event?