Matt RaibleMatt Raible is a Java Champion and Developer Advocate at Okta. developer.okta.com

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: AngularJS, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

Is there a component like panelGrid that uses ul instead of table?

JSF 1.1 has a problem with JSP in that it can't bind components together when a page first loads. This is well documented in Improving JSF by Dumping JSP by Hans Bergsten.

The easy example of this problem is when you have <h:outputLabel> tags before <h:inputText> tags. The average JSF user might not notice the problem, but if you customize <h:outputLabel> to display "required field" indicators based on the "required" attribute of <h:inputText> - the issue slaps you in the face. The easy solution is to use <h:panelGrid> to layout your form data, and everything magically works. However, table-based forms are ugly and I'd much rather do pretty forms like this one.

In order to create pretty forms and get around the JSF sucks with JSP problem, I'm looking for a component similar to panelGrid - but it spits out <ul> and <li> instead of <table> and <tr>/<td>. Does anyone know of such a component? I asked this question on the MyFaces list this morning, but haven't had much luck.

I'm fully aware that Facelets (or Clay) will solve this problem. However, I'm merely trying to get AppFuse 1.9.2 released without making major changes. I suppose I could always go with ugly table-based forms, but I'd rather not.

Posted in Java at May 23 2006, 12:55:44 PM MDT 13 Comments
Comments:

http://myfaces.apache.org/tomahawk/dataList.html

Posted by Jacob Hookom on May 23, 2006 at 01:12 PM MDT #

Heh, this is the same response I got from the MyFaces list. This component looks like it takes in a list of items. I'm just looking to wrap form elements like <h:panelGrid> allows - so JSF slurps it up and processes it, instead of processing each component as it loads in a JSP. If this component allows this - that'd be awesome.

Posted by Matt Raible on May 23, 2006 at 01:18 PM MDT #

oops, sorry-- yeah... switching to Facelets is cake from JSP/X :-)

Posted by Jacob Hookom on May 23, 2006 at 02:25 PM MDT #

I know you have been looking for this for quite some time. You made reference to it in your "JSF sucks" phase a long time ago. ;) My only suggestion, and not an easy one, is to design a custom renderer and not really a component to show a panelGrid the way you want. In this case with ul, ol, li, and span instead of table, tr, td, etc. If you are to venture down this path you can probably just subclass this class and replace all the table stuff with your list stuff. Danno

Posted by Dan Hinojosa on May 23, 2006 at 09:25 PM MDT #

> In order to create pretty forms and get around the JSF sucks with JSP problem, I'm > looking for a component similar to panelGrid Try using JSF 1.2 as soon as possible, there the JSF/JSP problem should be non-existant.

Posted by Marc Logemann on May 24, 2006 at 12:20 AM MDT #

In order to create pretty forms and get around the JSF sucks with JSP problem, I'm looking for a component similar to panelGrid

Try using JSF 1.2 as soon as possible, there the JSF/JSP problem should be non-existant.

Note: Commenting without HTML is a pain. Each blog should support plain text with keeping formatting like paragraphs. Look at my blog ;-)

Posted by Marc Logemann on May 24, 2006 at 12:24 AM MDT #

If you think tables are ugly, try a view-source on this beauty for an alternative... http://thedailywtf.com/forums/74146/postattachment.aspx

Posted by Alonso on May 24, 2006 at 08:02 PM MDT #

see Repeater or DataList in Coldtags suite: http://www.servletsuite.com/jsp.htm

Posted by Dmitry on May 25, 2006 at 04:41 AM MDT #

Check out DataList or Repeater from Coldtags suite: http://www.servletsuite.com/jsp.htm

Posted by Dmitry on May 25, 2006 at 07:26 AM MDT #

Quick question, Matt: by "ugly" and "pretty", do you mean aesthetically, for users? Or on a source code level?

Posted by Daniel on May 25, 2006 at 03:19 PM MDT #

I mean aesthetically. Of course, the default panelGrid makes for prettier source code (if you like to look at JSP tags ;-).

Posted by Matt Raible on May 25, 2006 at 05:37 PM MDT #

With respect to JSF 1.2: To the best of my knowledge, JSF 1.2 requires JSP 2.1, which means that JSF 1.2 providers won't run on today's web containers - such as Tomcat 5, Resin 3, WebLogic 9, WebSphere 6. The only JSP 2.1 container available right now (that I'm aware of) is GlassFish - the Java EE 5 RI. Tomcat will support JSP 2.1 as of Tomcat 6, but that's still a while away. So I'm afraid the JSF-with-JSP problem will persist until JSP 2.1 / Java EE 5 containers become mainstream.

Posted by Juergen Hoeller on June 06, 2006 at 07:16 AM MDT #

JSF 1.2 and JSP 2.1 do work together, but aren't necessarily required because of the minimal touch points around the EL context. Many have been using Facelets with JSF 1.2 on Tomcat 5 for some time now. I still recommend that people look at using Glassfish to experience the stack integration with JEE 5 from an EJB/persistence standpoint.

Posted by Jacob Hookom on June 06, 2006 at 07:58 AM MDT #

Post a Comment:
  • HTML Syntax: Allowed