Requirement
On ADF Form after Clicking Accept Terms and Condition
Checkbox(af:selectBooleanCheckbox) make another component eg. Command Link (af:commandLink) visible or enable using Partial Page
Rendering.
After Accepting T&C show Command Link Available Options
2)In Property Inspector à Behavior à Auto Submit to True
3)In Property Inspector à Behavior à Value Change Listener to create method TCcheckUncheck
4)In Property Inspector àAdvanced
à Bindings click edit to
create New tcCheckBox
<af:selectBooleanCheckbox text="Accept
T&C"
label="Accept"
id="sbc1"autoSubmit="true"
valueChangeListener="#{IATLoginMB.TCcheckUncheck}"
binding="#{IATLoginMB.tcCheckBox}"/>
Create Command Link with appropriate URL or Action
1)Enter Label and/or other details2) In Property Inspector àAdvanced à Bindings click edit to create New myLink1
3) ) In Property Inspector àAdvanced àVisible to False
<af:commandLink text="Available Options" action="taskflowLogin1"
id="cl1"
binding="#{IATLoginMB.myLink1}" visible="false"/>
Below Code in Managed Bean
private
RichSelectBooleanCheckbox tcCheckBox;
private
RichCommandLink myLink1;
public void
TCcheckUncheck(ValueChangeEvent valueChangeEvent) {
if(this.getTcCheckBox().isSelected() == true ) {
System.out.println("Checked
");myLink1.setVisible(true);
}
else if(this.getTcCheckBox().isSelected() == false ){
System.out.println("UnChecked ");
myLink1.setVisible(false);
}
AdfFacesContext.getCurrentInstance().addPartialTarget(myLink1);
}
public void setTcCheckBox(RichSelectBooleanCheckbox tcCheckBox) {
this.tcCheckBox = tcCheckBox;
}
public RichSelectBooleanCheckbox getTcCheckBox() {
return tcCheckBox;
}
public void setMyLink1(RichCommandLink myLink1) {
this.myLink1 = myLink1;
}
public RichCommandLink getMyLink1() {
return myLink1;
}
I have searched the web for an example of selectBooleanCheckbox. This is the first one that explains what is needed and even works.
ReplyDeleteI did some modifications and they work.
Thanks for the great tutorial.
Jack
Thanks Jack
ReplyDeleteThanks a lot. Exactly what I was looking for.Great Tutorial.
ReplyDeleteThanks Jack
ReplyDeleteThank you so much Jack... This is what I perfectly wanted.
ReplyDeleteThanks again!!