DairylandDan
Programmer
So, here's my question (with slight 'setup'):
I have an af : outputText which gets it's value set to a date value (slightly altered via af:convertDateTime to remove the "/" seperators) on page load:
I want a check box on the page (I'm trying an af:selectBooleanCheckbox) which, if checked, will change the outputText value to the final date of the previous year. If unchecked, it will return to the original value.
So, I thought that I could try some sort of 'value change listener' backing bean code sort of scenario like so . . .
Within the .jspx page:
Then, in the backing bean, something like so:
Don't worry about the "123109" value . . . right now I'm simply trying to make ANY change happen to the outputText. LOL!
Obviously, I'm missunderstanding something very basic about Java, the valuechangelistener scenario and the way to correctly work my backing bean code (as I am a beginner) . . . so, I really don't quite know how to proceed or where to look for a better suggested solution (even having spent many many, way TOO MANY, hours on Google)
I did a 'search' here and found no references to selectBooleanCheckbox.
Any assistance would be grealy appreciated.
DLD
I have an af : outputText which gets it's value set to a date value (slightly altered via af:convertDateTime to remove the "/" seperators) on page load:
Code:
<af:outputText value="#{AppInfo.paydateInLockout}"
binding="#{backing_apps_payroll_upload.outputTextBatchNum}"
id="outputTextBatchNum"
partialTriggers="selectBooleanCheckboxYearEndFirstRun">
<af:convertDateTime dateStyle="short" pattern="MMddyy"/>
</af:outputText>
So, I thought that I could try some sort of 'value change listener' backing bean code sort of scenario like so . . .
Within the .jspx page:
Code:
<!-- outputText -->
<af:outputText value="#{AppInfo.paydateInLockout}"
binding="#{backing_apps_payroll_upload.outputTextBatchNum}"
id="outputTextBatchNum"
partialTriggers="selectBooleanCheckboxYearEndFirstRun">
<af:convertDateTime dateStyle="short" pattern="MMddyy"/>
</af:outputText>
.....
<!-- selectBooleanCheckbox -->
<af:selectBooleanCheckbox text="#{resources['etsUpload.SelectYearEndFirstRun']}"
binding="#{backing_apps_payroll_upload.selectBooleanCheckboxYearEndFirstRun}"
id="selectBooleanCheckboxYearEndFirstRun"
selected="false" styleClass="dpc"
autoSubmit="true"></af:selectBooleanCheckbox>
.....
Code:
public void actionListenerYearEndFirstRunCheckChange(ActionEvent action) {
if(selectBooleanCheckboxYearEndFirstRun) {
//The selectBooleanCheckboxYearEndFirstRun has been CHECKED - set the Batch Number to "1231xx"; where "xx" equals Pay Period End Date Year (#{AppInfo.paydateInLockout}) minus one (1).
outputTextBatchNum.setValue("123109");
}else{
//The selectBooleanCheckboxYearEndFirstRun has been UNCHECKED - set the Batch Number to the same value as Pay Period End Date (#{AppInfo.paydateInLockout}).
outputTextBatchNum.setValue(#{AppInfo.paydateInLockout});
}
}
Obviously, I'm missunderstanding something very basic about Java, the valuechangelistener scenario and the way to correctly work my backing bean code (as I am a beginner) . . . so, I really don't quite know how to proceed or where to look for a better suggested solution (even having spent many many, way TOO MANY, hours on Google)
I did a 'search' here and found no references to selectBooleanCheckbox.
Any assistance would be grealy appreciated.
DLD