Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Monday, February 7, 2011

Popup from Popup

There are many ways on how to launch a popup from a popup, and I'm going to demonstrate here a "backingBean-based" of launching this.

So why go programmatic? The reason for this is because most of the time, I would prefer launching one popup at a time, meaning  that when I call the second popup, I first make sure to close the current popup.

So a straight forward sample in launching the popup declaratively looks like this.





As you might already know, this is achieved by simply calling af:showPopupBehavior.

Now let's go for the programmatic approach in making sure we first close the current popup before launching a 2nd one. As I have already mentioned, there are different ways of achieving this without binding your popup to a bean by using javascript for example (see Invoke popup from a popup by Luc Bors ).





Cheers.

Wednesday, February 2, 2011

Modeling a Cascading DropDown

Here's a quick step-by-step tutorial on how to model a 3 level cascading dropdown combobox.

Requirements:
  • HR Schema
  • ReadOnly viewObject for Countries, Locations and Departments 

Model

You'll need to set viewCriterias on:
  • Location filtered by CountryId
  • Department filtered by LocationId

Create a viewObject that will utilize these models.

Sample viewObject

Add an lovModel for CountryId, LocationId and DepartmentId.

Country Attribute

Location Attribute







Department Attribute




Test your ApplicationModule


And everything in the UI is just a matter of drag-and-drop and setting autosubmit on the selectOneChoice and partialTrigger on those component that has dependencies.