beautypg.com

Adding date and number formats, Navigating from moviedetails to main, Adding date and number formats 96 – Apple WebObjects 3.5 User Manual

Page 96: Navigating from moviedetails to main 96

background image

Chapter 3

Creating a WebObjects Database Application

96

This adds a new level 3 heading element around the string. The
MovieDetails page will show the title of the selected movie in this
heading.

4. Add labels and string elements to display the selected movie’s category,

rating, date released, and revenue.

5. Bold the labels.

6. Bind

selectedMovie

.

title

to the

value

attribute of the first string element (the one

in the heading).

7. Similarly, create bindings for the Category, Rating, Date Released, and

Revenue strings.

8. At the bottom of the page, add a horizontal rule.

Adding Date and Number Formats

String elements have

dateformat

and

numberformat

attributes just like text field

elements. Create bindings for the Date Released and Revenue strings so that

dateReleased

and

revenue

values are displayed the way they are in the Main page.

1. Add the date format

"%d %b %Y"

to the Date Released string.

2. Add the number format

"$ #,##0.00"

to the Revenue string.

Navigating from MovieDetails to Main

Now add a hyperlink to the MovieDetails page so users can navigate back to the
Main page from MovieDetails.

1. Add a hyperlink to the bottom of the page.

2. Label it

MovieSearch

.

3. Bind the hyperlink’s

pageName

attribute to the text (including the quotes)

"Main"

.

Recall that the

pageName

attribute is a mechanism for navigating to another

page without writing code. By setting the attribute to “Main”, you’re

Add the hyperlink here.