Passing the parameters
When we call the page, we will pass a value in for the Person ID
field. You will notice that at present the value is empty. Therefore, we need to populate this with the value of the PersonId
parameter we are using to call the page. In preparation for this, we will set a default value of 1234
in the controller. Later on when we add the code to call this page from our EmpSocietiesPG, we will add the PersonId
parameter that is passed.
How to do it...
To set a default value, perform the following:
Open the
CreateSocietyCO.java
controller and edit theprocessRequest
method. Remember theprocessRequest
method executes when the page is initialized, so this is where we will set the default value.Create a parameter list that we can pass to our
createNewSociety
method by adding the following code:
Note
Add any new packages to the import statement by clicking on the light bulb in the margin as we have previously.
First, we create a parameter that we will add to a parameter list. We...