This week's book giveaway is in the Python forum.
We're giving away four copies of Python Continuous Integration and Delivery and have Moritz Lenz on-line!
See this thread for details.
Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Would like to know more on UICompenent  RSS feed

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

Iam learning JSF and i need some understanding of what actually an UIComponent in JSF means and how it is different from a standard HTML element.
The basic that i know/understood is that any UIComponent is dessgined as a class that has its own properties and methods and can connect to managed bean on server.
Would like to know more on UICompenent
 
Ranch Hand
Posts: 1723
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can read Core JavaServer Faces 3rd edition for my information.
JSF has UI components that can be converted and validated.
And there are CDI beans and managed beans to save the properties from the inputs.
Also, JSF supports AJAX and security constraints such as authentication/authorization.
 
Saloon Keeper
Posts: 20505
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UIComponents are not something you normally work with yourself.

JSF is a Model/View/Controller architecture, where you define the Models as JSF backing beans, the Views as templates in an xhtml View Definition Language (also known as View Template Language), and the Controllers are pre-supplied for you. It employs Inversion of Control (IoC) to manage the automated synchronization of data values between the rendered View and the Model, which it does as a batch process after first verifying that any View-to-Model data updates are, in fact, valid data. Any invalid data aborts the entire transfer.

JSF was designed as a platform-independent Java component-based MVC system, although its primary actual use is on HTML web platforms.

As part of its internal mechanisms, JSF build a Component Tree for each View to be rendered and the rendering subsystem walks that tree for UIComponents that tell it what HTML to render and how to populate the rendered View with data values from the Model. It also uses the Component tree to process incoming JSF form data. UIComponents are normally created automatically when the JSF View subsystem compiles the View Template. You can manually create, move, redefine, and remove UIComponents in the tree on the fly, but that's an advanced topic and you'll almost never need to do that. In fact, I've only done it once myself and probably shouldn't have done it even then. Mostly, it's best to pretend that they don't exist at all.

Regarding HTML and JSF:

JSF VDL tags come in several different XML namespaces. The "h" namespace (so-called because the convention is to use "h:" as the tag namespace qualifier) is the one and only namespace that directly corresponds to HTML. Tags in the "h:" namespace, such as outputText, selectOneMenu, and so forth are essentially thin wrappers over their corresponding HTML elements and don't add any additional functionality other than the ability to interact via JSF's Controllers with the Model. The h:dataTable is more abstract - it defines an HTML TABLE element structure, but maps to a DataModel that assists in rendering and tracking rows. The h:panelGrid is actually closer to what a vanilla HTML TABLE tag does. Note, however, that this is not a one-to-one mapping. JSF doesn't require or use row and column sub-elements (TR, TD) or header/footer sub-elements (THEAD, etc.) because it can deduce the need for them automatically.

The "h" namespace isn't the only one that results in HTML output. In fact, there is a wealth of third-party tagsets that abstract and extend the basic VDL, allowing such things as tables that you can sort on by clicking a column header, collapsible sub-tables, and so forth, plus knobs, sliders and a whole lot of conveniences that bare HTML doesn't have.

As Himai noted, JSF also supports AJAX. The security is actually a "freebie", since JSF is part of JEE and it works under the JEE container security system.

Finally, if you're new to JSF, there are 2 things to note:

1. You should avoid putting raw HTML on your JSF View Definitions. Almost all HTML has some sort of JSF equivalent.

2. Don't try to use HSTL on a JSF View Definition. Unlike JSPs, View templates do not compile into Java code (servlets), but compile into a data structure (Component Tree). Attempting to use JSTL on a View Template generally leads to unhappiness.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!