Saturday, November 26, 2011

Requied Field, Show Required Message Details, Programmatically Navigate

Requirment- Navigation from one page to another only if all the fields have value/ mandatory fields are not blank
1) Page1 say we have text field and a button
2) In adfc-config pull two pages page1 & page2 and controlFlow "gotoPage2" from page 1.
3) set action property for button on page1 to "gotoPage2"
4) Now for textfield on page one set below properties
Behaviour- Required-> True
Appearence- Required Message Details value -> {0} is mandatory, cannot be blank (sample message)
And simply run the page.
This will even work when you have some code attached to submit button and you want to return/navigate to specific control flow. This is what you need
Create a java class with request scope in adfc-config and to your button add expression to a method, and the method body can be like
public String SubmitBtn() {
return "gotoTest"; //this is the value on adfc-config control flow
}


Download Application