• No results found

Steps to create the Registration Page

In document ADF+Tutorial (Page 49-53)

Working on the Controller and UI

3.4 Steps to create the Registration Page

So finally the big fish has arrived. Registration page is the one which will allow the user to create the new registration and to edit the existing one. Following are the steps to achieve

this:-Registration Details Region

Step 1) Create a new page with name “RegistrationPage” based on the template

“MyPageTemplate”.

Step 2) Set the page title as “Registration Page” and page window title also as

“Registration Page”.

Step 3) Select the Panel Splitter from the layout components and drop it on the MainPageRegion in the structure window.

Step 4) Select the newly created af:panelSplitter and set the following properties in the property

inspector:-SplitterPosition = 454, id=”FirstRN”.

Style = width:943px; height:200px;

Step 5) Select the PanelGroupLayout from the layout components and drop it on the first facet of above created panelSplitter. Select the newly created panelGroup and set the layout property as “scroll”.

Step 6) Inside the panel group layout add a output text with value as “Registration Details”. And below the output text, add the separator from the layout components.

Step 7) Now select the PanelFormLayout from the layout component and drop it inside the created panel group layout below the separator.

Step 6) Now select the RegistrationPageVORegNum from the data control and drop it on the above created panel form as TextADF Output Text w/ Label.

Step 7) Select RegistrationPageVOProcType from the data control and drop it below the above created output text as Single SelectionADF Select One Choice. In the Edit List Bindings window, select “Fixed List” option. Set the Base data source attribute as “ProcType” and enter following items in the set of values one by one, each item seprated by “enter”

key:- Standard Procurement key:- Emergency key:- Reimbursable Procurement and click ok.

Step 8) Select RegistrationPageVORegStatus from the data control and drop it below the above created ProcType choice list. Again created the fixed list choice box as above, with values as Open and Closed.

Step 9) Select RegistrationPageVOUrgency from the data control and drop it below the above created RegStatus choice list with, Created the fixed values choice list with values Normal and Urgent.

Step 10) Drop the TotalUsdAmt and TotalPfiAmt from RegistrationPageVO in data control and drop it below the above created Urgency choice list one by one as Text

ADF Output Text w/ Label.

Creation Details Region

Step 1) Select the PanelGroupLayout from the layout components and drop it on the Second facet of above created panelSplitter “FirstRN”. Select the newly created panelGroup and set the layout property as “scroll”.

Step 2) Inside the above created panel group layout add an output text with value as

“Creation Details”. And below the output text, add the separator from the layout components.

Step 3) Select the PanelFormLayout from the layout component and drop it inside the created panel group layout below the separator.

Step 4) Select the RegistrationPageVOCreatedByName and RegistrationPageVO

CreationDate one by one, from the data control palette and drop it on the above created panel form as TextADF Output Text w/ Label.

Step 5) Select the RegistrationPageVORequestedBy from the data control and drop it as Single SelectionADF Select One Choice.

Step 6) Select the RegistrationPageVODepartmentName from the data control palette and drop it on the above created panel form as TextADF Output Text w/

Label.

Notes to Buyer Region

Step 1) Add a spacer below the “FirstRN” panel splitter. Below that add another panel splitter with ID= SecondRN and splitterPosition=452.

Step 2) Inside the first facet of the “SecondRN”, add a panel group layout.

Step 3) Inside the panel group layout add a output text with value as “Notes to Buyer”. And below the output text, add the separator from the layout components.

Step 4) Select the RegistrationPageVONotesBuyer and drop it on the above created panel group as TextADF Input Text. And set the Rows property of newly created text box to 5.

Party Notes Region

Create this region in a similar fashion as Notes to Buyer region is created in the second facet of the SecondRN based on RegistrationPageVOPartyNotes from data control.

Registration Lines Region

Step 1) Add a spacer below the “SecondRN” and then add an output text with value

= “Registration Lines” in the structure window of registration page.

Step 2) Add a separator below the above created output text.

Step 3) Add a command button below the above separator with Text= “Add Item”

and action =”CatalogPage”. This button will help the user to navigate to the “Catalog Category Page”.

Step 4) Add another command button below the above command button with text property =”Search Item” and action=” ItemLitsPage”. This button will lead the user to Item list page once the action property of the button is set.

Step 5) Now select the RegistrationPageVORegistrationLinesVO from thedata control palette and drop it on the af:group as TablesADF Read Only table.

Step 6) From the Edit Table Columns window, delete “LineId”, “RegistrationId” and click ok.

Adding Registration Managed Bean

When user navigates from the Home page to the Registration page by clicking on the

“New Registration” button, the page appear in the new registration creation mode. In that case “Add Item” buttons and “Search Item” buttons in the Registration Lines region should be disabled. As the registration it self is not yet created, user should not be able to add the lines in registration. So we have to disable these buttons for new registration and when user clicks on the “Save” button buttons should be enabled. We will achieve this with the help of managed bean.

A managed bean is a regular java bean whose bean properties and methods are bind to the JSF components. We will use these properties to enable and disable the command button in our registration page.

Step 1) Right click the view controller project and select new. From items section select “Java Class”. In the Create Java Class window specify Name as RegistrationBean and package as “view.beans” and click ok.

Step 2) Add following two variables in the RegistrationBean class and generate accessors for both the variable(you can generate the accessors by right clicking on it and selecting ‘Generate Accessors’ from the context menu.

private boolean disableAddItemBtn;

private boolean disableSearchCataBtn;

Step 3) Now we have to declare the above managed bean in the adfc-config.xml file.

Open the adfc-config.xml file and in the code editor window, select Overview from the bottom of the window. Click on the “Add” icon and specify details as shown

below:-Step 4) Now we should also specify the initial value of the above created variable, which should be ‘false’ as “Add Item” and “Search Item” should be enable all the time except for the new registration request. For this select the Managed Properties and click on “Add” icon and add following

properties:-Step 5) Select the “Add Item” command button and set the Disabled property =

#{RegistrationBean.disableSearchCataBtn}

And then select the “Search Item” command button and set the Disabled property =

#{RegistrationBean.disableSearchCataBtn}

Action Button Bar Region

Step 1) Select the OperationsCommit from the data control palette and drop it on the ActionButtonBarRegion in the structure window and select operationsADF Button form the command window. Change the text property of the command button from Commit to Save and disabled property to false.

Step 2) Insert inside the Save command button two action listener with following

values:-From=#{false} and To=#{RegistrationBean.disableAddItemBtn}

 From=#{false} and To=#{RegistrationBean.disableSearchCataBtn}

Step 3) Add another command button inside the ActionButtonBarRegion with Text property = “Home” , Action property =” HomePage” and Immediate property set to true.

Your registration page layout in structure window should look

like:-This finishes the layout of the Registration page, our big fish. We will now work with controller to define the flow of the system.

In document ADF+Tutorial (Page 49-53)

Related documents