• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I need a colspan

 
Raphael Germano Boschiero
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends , i need somenthing similar to colspan in PanelGrid ....

Thanks

Raphael Germano Boschiero
raphaelboschiero@gmail.com
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not gonna happen. That attribute is not supported in any JSF components since you don't actually specify any individual TD or TR elements.
 
Raphael Germano Boschiero
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thankļæ½s

Raphael
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yea, don't you just love how everything in JSF if their way or the highway? There are better frameworks out there.
 
David Hergert
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
Yea, don't you just love how everything in JSF if their way or the highway? There are better frameworks out there.

What else do you suggest? From your blog it looks like you are an advocate of JSF.

Isn't it a possibility to extending something to get that functionality. Either by extending some component or extending a renderer or something? I am sure its possible and not entirely difficult. I am still new at this, but from the looks of it, alot is possible.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I appreciated JSF a lot more when I was learning it. Now that the newness (buzz) has worn off, I see it's faults. Not that nothing is flawless. Don't get me wrong. I don't think anything is "perfect". I just think that since JSF there have been some better and improved frameworks come about. Maybe even due to JSF.

Web layout design is a VERY important factor in web frameworks. JSF seemed to ignore this. That is the major issue. Yes, there are workarounds so any suggestions you want to make are sure to be appreciated by the original poster.
 
Gerardo Tasistro
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gentlemen stop whining and give the gentleman his answer will ya.

The following jsf uses panels and classes to set column widths as requested>

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>Example to JSF column width</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<style type="text/css">
.colStyle1 { width: 360px;
background: red;
}
.colStyle2 { width: 260px;
background: green;
}
.colStyle3 { width: 160px;
background: blue;
}
</style>

</head>

<body>
<f:view>

<h anelGrid columns="3" columnClasses="colStyle1,colStyle2,colStyle3">
<h anelGroup>
<h utputText value="TEST1"></h utputText>
<h:inputText></h:inputText>
</h anelGroup>
<h utputText value="TEST2"></h utputText>
<h utputText value="TEST3"></h utputText>
<h utputText value="TEST4"></h utputText>
<h utputText value="TEST5"></h utputText>
<h utputText value="TEST6"></h utputText>
</h anelGrid>
</f:view>
</body>
</html>

creating the following output>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>


<title>Example to JSF column width</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<style type="text/css">
.colStyle1 { width: 360px;
background: red;
}
.colStyle2 { width: 260px;
background: green;
}
.colStyle3 { width: 160px;
background: blue;
}
</style>

</head>

<body>
<table>
<tbody>
<tr>
<td class="colStyle1">TEST1<input type="text" name="_id3" /></td>
<td class="colStyle2">TEST2</td>
<td class="colStyle3">TEST3</td>
</tr>
<tr>
<td class="colStyle1">TEST4</td>
<td class="colStyle2">TEST5</td>
<td class="colStyle3">TEST6</td>
</tr>
</tbody>
</table>


</body>
</html>

Now that wasn't that hard was it!
[ January 21, 2006: Message edited by: Gerardo Tasistro ]
 
Jim Tough
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gerardo Tasistro wrote:Gentlemen stop whining and give the gentleman his answer will ya.


I agree. The short answer was: <h:panelGroup>. Thanks Gerardo.
 
Akaine Harga
Ranch Hand
Posts: 99
Java MyEclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gregg Bolinger wrote:I appreciated JSF a lot more when I was learning it. Now that the newness (buzz) has worn off, I see it's faults. Not that nothing is flawless. Don't get me wrong. I don't think anything is "perfect". I just think that since JSF there have been some better and improved frameworks come about. Maybe even due to JSF.

Web layout design is a VERY important factor in web frameworks. JSF seemed to ignore this. That is the major issue. Yes, there are workarounds so any suggestions you want to make are sure to be appreciated by the original poster.

Like there were other better alternatives... Struts2? Don't make me laugh... Maybe as an MVC framework itself it's ok but the extensions suck ash compared to MyFaces based series, Rich/Prime Faces, Seam, etc.

These days the major fault of each and every one of the frameworks out there (including JSF) is lack of advanced documentation, books included. You wanna do something just a bit more complicated than a HelloWorld app explained 1000 times in every book and tutorial - enjoy the hours and days of lonely and almost blind experiments (for ex. RichFaces AJAX API). Those who spend some time on dev forums know - more than 80% of all questions related to frameworks are caused by lack of documentation (not talking about the laziness case =)).
 
vladimir dimitrov
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raphael Germano Boschiero wrote:hi friends , i need somenthing similar to colspan in PanelGrid ....

Thanks

Raphael Germano Boschiero
raphaelboschiero@gmail.com


Hi,

I realize it's been some time since this thread was created, but I'm going to reply in case someone googles his way to this thread.

I know only one way to sort of span columns, and that is by using the header/footer facet.
The problem is, that for example the footer facet spans all columns.

Here's a link with an example:
http://www.exadel.com/tutorial/jsf/jsftags-guide.html#panel

Hope this helps.

Thanks.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Vladimir.

Actually, it's best to just let old threads like. We call this "waking the zombies", and one reason why we prefer that people just start new threads is that a lot of the information in them is obsolete. Even if you update the main topic, the side topics might not be correct any more. So actually, you may have just pushed some stale info back up into Google's view.

Over the last few years a number of discussions on "colspan" and its lack in JSF have been made. Someone actually did do a version of a colspannable grid control. I think Tomahawk may support this now, too. RichFaces has support in a specialized way. Otherwise, I've just learned to nest grid controls.
 
Jeff Do
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I found that the Towahawk library has extended panelGrid and panelGroup so that you can just go:

<t:panelGrid cols="3">
<hutputText value="Test1" />
<hutputText value="Test2" />
<hutputText value="Test3" />
<t:panelGroup colspan="3" >
<hutputText value="Test4" />
</t:panelGroup>
<hutputText value="Test5" />
</t:panelGrid>

Works like a charm
 
Sharan Rajendran
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something like this will work.


<style type="text/css">

.columnLabel {
width: 200px;
}
</style>

<h:panelGrid columns="2" columnClasses="columnLabel">
<hutputText value="#{msgs.labelAccountNo}"/>
<hutputText value="#{action.accountNo}"/>
<hutputText value="#{msgs.textUserName}"/>
<hutputText value="#{action.name}"/>
</h:panelGrid>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic