Search

What the Quote?

"Mmm... translucent bear..."

Brent Bowers

"You're the hypotenuse of my right triangle."

Nathan T Freeman

"That can't be good."

Porko Rosso

« how to make an XPage a "mashup" - Step 3 | Main| the newest item on my XPages wishlist »

how to make an XPage a "mashup" - Epilogue

Category xpages
Declan suggested I post a couple more items of information about my XPages weather mashup:
  • an explanation of which fields I added to the Location form
  • instructions on how to remove the location from the sessionScope
First, I added two editable fields to the Location form: a text field called OfficeLocationID, and a radio button field called OfficeTemperatureUnit. The first will store the location ID that Yahoo associates with each location. You can obtain the ID for any location by going to weather.yahoo.com and searching for the city. The resulting page will end in LocationID.html; For example, the ID for Sydney, Australia is ASXX0112. I set the available values for the radio button to be "Fahrenheit|f" & "Celsius|c".

To remove the location from the sessionScope, I just added an onclick event handler to the "Home" link in the "layout_PlaceBar" custom control, which executes the following script:

sessionScope.remove('locationfilter');


As a result, if the user clicks that breadcrumb, the location is no longer known and the weather widget disappears until a new location is chosen. But if the user returns to the home screen another way (i.e. the back button, a bookmark, manually editing the URL, etc.), the scope would still contain the location.

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)