Developer Tools
JDeveloper
Work in JDeveloper's IDE to create the page flow and pages that comprise the view and navigation portion of your application targeted for mobile device browsers.
Create a Mobile Project: Create the view project for your ADF Mobile Browser application and select the Mobile Browser technology scope.
Set the Screen Size: Use the Preferences dialog to set the default screen size for target mobile devices.
Create the Page Flow: Use the diagrammer to create a page flow diagram by adding pages and navigation cases.
Create a JSF Page: Use the Create JSF Page dialog to create JSP XML documents with the starter page structure targeted for mobile devices.
Create the Browse Page: Use the Data Controls panel to add buttons, a read-only form and a read-only table to define a page for browsing orders.
Create the Edit Page: Use the Data Controls panel to add an editable input form and commit button to define a page for editing order details.
Run the Application: Run the application in the IDE.
Optimize the Layout: Set the properties for various components on the pages to ensure that page contents are displayed on mobile device screens with minimal scrolling.
A JDeveloper project is used to logically group files that are related. A project keeps track of the source files, packages, classes, images, and other elements that your program may need. You can add multiple projects to your application to easily access, modify, and reuse your source code. [ tell me more...]
mvc as the project name.
Entering short, lowercase names for ADF Mobile applications and projects creates a shorter URL, which is easier to enter from a mobile device. For example, use
mvc for "mobile view controller" project. [
tell me more...]
After completing the steps for creating a mobile project, the Application Navigator should look similar to this, if the model and ViewController project folders are collapsed: [ tell me more...]
JDeveloper enables you to set the visual editor to the dimensions of a mobile device screen. In the example below, the screen size of the visual editor is set to 240X320 pixels. This provides a visual aid when designing pages for mobile browsers. [ tell me more...]
The Preferences dialog, Mobile page, enables you to set the default size of the visual editor to give you an approximation of how the components fit on a mobile device screen. [ tell me more...]
The
mvc (mobile view controller) project in the application contains a JSF configuration file, named by default
faces-config.xml. The JSF configuration file contains details of your application, such as the locales you are supporting and the rules for navigating between application pages. It also holds details of the resources needed by your application, such as managed beans and custom message bundles. [
tell me more...]
/br-o.jspx.
/ed-o.jspx.
goEdit.
goBrowse.
When you complete the steps for creating the page flow on a diagram, the diagrammer should look similar to this: [ tell me more...]
The JSF pages you create for your application using JavaServer Faces technology can be JSP documents (which have the file extension
.jspx) or JSP pages (which have the file extension
.jsp). [
tell me more...]
br-o.jspx and confirm that both
Create as XML Document (*.jspx)
and
Render in Mobile Device
are selected. Then click
OK.
JDeveloper provides the Component Palette for you to drag and drop UI components onto your JSF page. To see the libraries and components that are currently available, click the dropdown list in the Component Palette. To create a user interface for mobile devices, add Apache MyFaces Trinidad components to your JSF page in the visual editor. [ tell me more...]
Browse Order and press Enter.
When you complete the steps for creating a JSF page and adding Trinidad components, the visual editor looks similar to this: [ tell me more...]
The role of the browse page is to allow the user to view and navigate the data objects, one at a time. You will add databound components to the
br-o.jspx page to create a read-only form and table. Both the read-only form and read-only table supply the master/detail functionality in this browse page. At runtime, the orders are shown one at a time, with the order information in the read-only form, and the order's line items in the read-only table. [
tell me more...]
The Data Controls panel shows the structure of your business components data model in a hierarchical display of business objects, methods, and data control operations. [ tell me more...]
#{bindings.OrderId.hints.label}, then press Enter.
The Operations folder that is a direct child node of a data collection (for example, OrdersView1) contains operations that affect the current row in the collection or operations that refresh the data collection. [ tell me more...]
Edit in the
Text property field. Then select
goEdit from the
Action property
ID and press Enter.
Quan., the
UnitPrice column to
Price, and the
ProductName column to
Name.
100% in the
Width field and press Enter.
When you finish creating the browse page, the page in the visual editor should look similar to this: [ tell me more...]
ADF drag and drop data binding allows you to bind UI components on a page to data or actions. You will use both techniques: you will create a form to edit orders data, and you will bind a button to the commit action. [ tell me more...]
ed-o.jspx and confirm that both
Create as XML Document (*.jspx)
and
Render in Mobile Device
are selected. Then click
OK.
Edit Order and press Enter.
While each data collection contains its own set of operations such as Next, Previous, Create, and Execute, the Operations folder that is the direct child node of the application module node (for example, FODModuleDataControl) contains operations that apply to all data collections in the module. The application module data control exposes two data control built-in operations named Commit and Rollback. [ tell me more...]
Save. From the
Return in the
Text field. Then select
goBrowse from the
Action property
When you finish creating the edit page, the page in the visual editor should look similar to this: [ tell me more...]
Since you have both the user interface and model of your application complete, you can run your application in the IDE by running the
br-o.jspx page. In the Application Navigator, right-click the page and choose
R
un
from the context menu. [
tell me more...]
To test an Oracle ADF Mobile Browser Client application using an emulator, enter your computer's IP address into the application URL, in place of the localhost reference. Device emulator cannot resolve the localhost reference as it simulates a network device, so you must substitute the localhost reference with the IP address of your computer. Other than the host name, the remainder of the application URL is the same. For example, enter
http://<IP Address>:<Port Number>/adfm-mvc-context-root/faces/br-o.jspx in the device browser. [
tell me more...]
When you run the
br-o.jspx page in a desktop web browser, the page should look similar to this: [
tell me more...]
In this cue card, you will optimize the layout of both pages for display on mobile devices. [ tell me more...]
2 and press Enter.
meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/
The
meta tag places lines of code in between the
<head></head> tags in your web page code. To improve the presentation of web page contents on mobile devices, use the
viewport key on the
meta tag to specify the initial scale and width of the viewport. [
tell me more...]
meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/
ed-o.jspx, expand
tr:panelGroupLayout and then
tr:panelFormLayout.
5 and press Enter.
You can use the Property Inspector to change the properties of multiple components simultaneously. [ tell me more...]
ed-o.jspx, select the following
tr:inputText components:
OrderDate,
OrderShippedDate,
OrderTotal,
ShipToName,
ShiptoPhoneNumber, and
GiftwrapMessage.
12 and press Enter.
When you run the
br-o.jspx page and navigate to an order that has more than two items in the table, the page in a desktop web browser should look similar to this: [
tell me more...]
Copyright © 1997, 2009, Oracle. All rights reserved.