Alignment problems in JSF datatable
Hi,
In my JSF data-table, i have few alignment problems.
For Example, I have 4 columns, Emp-Id, First-Name,Last-name and Age.
What happens is, sometimes, the value in the First-Name cell moves into the Last-Name cell, leadiing to alignment problems. But this is not happening always. Occasionlly this happens.
I tried with iFrames and also by having fixed width for each cell, then also this problem is persisting.
Is it something to do with the datatable display in JSF?
Any suggestions/ideas on how to resolve this problem would be of immense help.
Thanks
Hi
What happens if you delete the text and retype in and change alignment ?
Does the same issue happens with all sub menu items ?
Please provide the site url.
Thanks,
Sanjit
Similar Messages
-
when data is fetch using user criteria:
i have a problem with jsf DataTable. I use e request bean to populate the datatable and i insert a commandButton column. The data dispay successfully into the datatable, but when a push the button on the row...the page simply refresh and notinhg else
when data is fetch using constants:
The data dispay successfully into the datatable, when a push the button on the row...the action execute OKHi,
I don't think that with this description only anybody on this list is able to help you.
I use e request bean to populate the datatable and i insert a commandButton column
What is a command button column and what does it do ?
but when a push the button on the row...the page simply refresh and notinhg else
What did you do to debug the problem ?
when data is fetch using constants
What does this mean ?
Frank -
JSF dataTables - Problem during retrieving data from bean
Hi, Below is the Stack Trace got on displaying data using JSF datatables.
This error occurs somtimes and is not very frequent.We are using jboss seam, jboss-4.0.5.GA server and Hibernate.
Anyone knows about this problem and how it can be resolved?
Thanks in advance
javax.faces.el.EvaluationException: Cannot get value for expression '#{loc.companyName}'
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:402)
at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1075)
at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:508)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:433)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:216)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:98)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:495)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:363)
at org.apache.myfaces.shared_impl.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:54)
at org.apache.jsp.menu_jsp._jspx_meth_h_panelGrid_0(menu_jsp.java:225)
at org.apache.jsp.menu_jsp._jspx_meth_f_subview_0(menu_jsp.java:118)
at org.apache.jsp.menu_jsp._jspService(menu_jsp.java:87)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
at org.apache.jsp.finish_005fregistration_jsp._jspx_meth_h_form_0(finish_005fregistration_jsp.java:263)
at org.apache.jsp.finish_005fregistration_jsp._jspx_meth_f_view_0(finish_005fregistration_jsp.java:139)
at org.apache.jsp.finish_005fregistration_jsp._jspService(finish_005fregistration_jsp.java:93)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
at org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:59)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.kmedia.filter.RequestFilter.doFilter(RequestFilter.java:184)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:620)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:464)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at org.jboss.seam.jsf.SeamApplication11.getPropertyResolver(SeamApplication11.java:197)
at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:532)
at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
at org.apache.commons.el.BinaryOperatorExpression.evaluate(BinaryOperatorExpression.java:154)
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:383)
... 70 more
10:23:55 Servlet.service() for servlet jsp threw exception
Also check the JSF page, Backing bean, and VO
JSF page
<h:dataTable value="#{finishedRegistrationBean.list}" var = "loc" >
<h:column>
<f:facet name="header">
<h:outputText value="#{displaymessages.registrationDate}" />
</f:facet>
<span class="bodylighttext"> <h:outputText value="#{loc.registrDate}" /> </span>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{displaymessages.companyName}" />
</f:facet>
<span class="bodylighttext"> <h:outputText
value="#{loc.companyName}" /> </span>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{displaymessages.Address}" />
</f:facet>
<span class="bodylighttext"> <h:outputText
value="#{loc.address}" /> </span>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="#{displaymessages.Action}" />
</f:facet>
<h:commandLink target="_blank"
action="#{finishedRegistrationBean.viewFinishedRegistrationPage(loc)}">
<h:graphicImage value="images/view_icon.gif"
alt="#{displaymessages.info_tooltip_view}"
width="17" height="17" style="border:0" />
</h:commandLink>
</h:column>
</h:dataTable>
Backing bean
@Name("finishedRegistrationBean")
public class FinishedRegistrationBean {
@In
private User user;
@In
private FacesMessages facesMessages;
private List<FinishedRegistrationVO> list;
public FinishedRegistrationBean() throws KMException {
filterFinishedRegistration();
public void filterFinishedRegistration() throws KMException
list = new ArrayList<FinishedRegistrationVO>();
finished_list = userDAO.searchFinishedRegistrationDetails(country_code,uniqueID, companyName, user.getUserName());
public void setList(List<FinishedRegistrationVO> list) {
this.list = list;
public List<FinishedRegistrationVO> getList() {
return list;
FinishedRegistrationVO
public class FinishedRegistrationVO {
private String uniqId;
private String companyName;
private Date registrDate;
private String address;
public String getCompanyName() {
return companyName;
public void setCompanyName(String companyName) {
this.companyName = companyName;
public String getAddress() {
return address;
public void setAddress(String address) {
this.address = address;
public String getUniqId() {
return uniqId;
public void setUniqId(String uniqId) {
this.uniqId = uniqId;
public Date getRegistrDate() {
return registrDate;
public void setRegistrDate(Date registrDate) {
this.registrDate = registrDate;
}Could you please post your
-HBM
-faces-config.xml -
Very big problem with JSF about FORM and "id=" for HTML form's elements and
I have discovered a very big problem with JSF about FORM and "id=" for HTML form's elements and java instruction "request.getParameterNames()".
Suppose you have something like this, to render some datas form a Java Beans :
<h:dataTable value="#{TablesDb2Bean.myDataDb2ListSelection}" var="current" border="2" width="50%" cellpadding="2" cellspacing="2" style="text-align: center">
<h:column>
<f:facet name="header">
<h:outputText value="Name"/>
</f:facet>
<h:outputText id="nameTableDb2" value="#{current.db2_name_table}"/>
</h:column>
</h:dataTable>
Everything works fine...
Suppose you want to get the name/value pairs for id="nameTableDb2" and #{current.db2_name_table} to process them in a servlet. Here is the HTML generated :
<td><span <span class="attribute-name">id=<span class="attribute-value">"j_id_jsp_1715189495_22:0:nameTableDb2">my-table-db2-xxxxx</span></td>
You think you can use the java instructions :
Enumeration NamesParam = request.getParameterNames();
while (NomsParam.hasMoreElements()) {
String NameParam = (String) NamesParam.nextElement();
out.println("<h4>"++NameParam+ "+</h4>);
YOU ARE WRONG : request.getParameterNames() wants the syntax *name="nameTableDb2" but JSF must use id="nameTableDb2" for "<h:outputText"... So, you can't process datas in a FORM generated with JSF in a Servlet ! Perhaps I have made an error, but really, I wonder which ?
Edited by: ungars on Jul 18, 2010 12:43 AM
Edited by: ungars on Jul 18, 2010 12:45 AMWhile I certainly appreciate ejb's helpful responses, this thread shows up a difference in perspective between how I read the forum and how others do. Author ejb is correct in advising you to stay inside JSF for form processing if form processing is what you want to do.
However, I detect another aspect to this post which reminds me of something Marc Andreesen once said when he was trying to get Netscape off the ground: "there's no such thing as bad HTML."
In this case, I interpret ungar's request as a new feature request. Can I phrase it like this?
"Wouldn't it be nice if I could render my nice form with JSF but, in certain cases, when I REALLY know what I'm doing" just post out to a separate servlet? I know that in this case I'll be missing out on all the nice validation, conversion, l10n, i18n, ajax, portlet and other features provided by JSF".
If this is the case, because it really misses the point of JSF, we don't allow it, but we do have an issue filed for it
https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=127
If you can't wait for it to be fixed, you could decorate the FormRenderer to fix what you want.
I have an example in my JSF book that shows how to do this decoration. http://bit.ly/edburnsjsf2
Ed -
Problems with JSF and included subviews
Hi everybody,
I' ve got a problem with JSF and included subviews which makes me going
crazy. I've got no clue why my web-pages are represent wrongly. The only
tip I've got is that it must be connected with the kind I do include my JSF-pages.
When I use <%@file="sub.jsp"%> my pages are are represent right. When I use <jsp:include page="Sub.jsp" /> or <c:import url="Sub.jsp" /> ( mark: the usage of flush="true" or flush="false" doesn't matter )
my pages are represent wrongly.
The usage of tags like f:facet or f:verbatim were also included but didn't point to an solution.
I searched the whole Sun Developer Forum and some other web-sites for any solution for my problem but the given hints and clues didn't help. Now I'm trying to post my problem directly in Sun's Forum in hope to get help.
My environment is the following:
JAVA JDK 1.5 Update 4
Tomcat 5.5.9
JSLT 1.1
Sun JSF 1.1
Win 2K
Here's my code:
Main.jsp
<%@ page language="java"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
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%>">
<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" href="stil.jsp" type="text/css" />
</head>
<body>
<f:view>
<h:form>
<div class="table">
<div class="tr">
<h:outputText styleClass="tdleft" value="value 1"/>
<h:outputText styleClass="tdinfo" value="value 2"/>
</div>
<div class="tr">
<h:outputText styleClass="tdleft" value="value 3"/>
<h:outputText styleClass="tdinfo" value="value 4"/>
</div>
</div>
</h:form>
<jsp:include page="Sub.jsp" />
</f:view>
</body>
</html>Sub.jsp
<%@ page language="java"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<f:subview id="subview">
<h:form>
<div class="table">
<div class="tr">
<h:outputText styleClass="tdleft" value="value 11"/>
<h:outputText styleClass="tdinfo" value="value 22"/>
</div>
<div class="tr">
<h:outputText styleClass="tdleft" value="value 33"/>
<h:outputText styleClass="tdinfo" value="value 44"/>
</div>
</div>
</h:form>
</f:subview>stil.jsp
<%@page contentType="text/css"%>
<%
String schwarz = "#000000",
grau1 = "#707070",
grau2 = "#c0c0c0",
grau3 = "#e0e0e0",
grau4 = "#e8e8e8",
grau5 = "#fdfdfd",
blau = "#0000dd",
tuerkis = "#00cfff";
String liniendicke = "1px",
linienart = "solid";
String allgemeineTextFarbe = schwarz;
String allgemeineHintergrundFarbe = grau3;
String infoTextFarbe = blau;
String fieldsetRandFarbe = blau;
String fieldsetRandDicke = liniendicke;
String fieldsetRandArt = linienart;
String hrLinienFarbe = blau;
String hrLinienDicke = liniendicke;
String hrLinienArt = linienart;
String inputAktivHintergrundFarbe = grau5;
String inputReadonlyHintergrundFarbe = grau4;
String inputPassivHintergrundFarbe = grau4;
String inputPassivFarbe = schwarz;
String inputRandFarbe1 = grau1;
String inputRandFarbe2 = grau5;
String inputRandDicke = liniendicke;
String inputRandArt = linienart;
String inputButtonHintergrundFarbe = grau3;
String legendenFarbe = blau;
String linkFarbe = blau;
String linkAktivFarbe = tuerkis;
String linkBesuchtFarbe = blau;
String linkFocusFarbe = tuerkis;
String objectGitterFarbe = grau5;
String objectGitterDicke = liniendicke;
String objectGitterArt = linienart;
String tabellenGitterFarbe = grau5;
String tabellenGitterDicke = liniendicke;
String tabellenGitterArt = linienart;
%>
<%-- ----------------------------------------------- --%>
<%-- Textdarstellung mittels der Display-Eigenschaft --%>
<%-- in den Tags div und span --%>
<%-- ----------------------------------------------- --%>
*.table {
display:table;
border-collapse:collapse;
*.tbody {
display:table-row-group;
*.tr {
display:table-row;
*.td,*.tdright,*.tdleft,*.tdinfo,*.th {
display:table-cell;
padding:3px;
vertical-align:middle;
*.td,*.th {
text-align:center;
*.tdright {
text-align:right;
*.tdleft {
text-align:left;
*.tdinfo {
color:<%=infoTextFarbe%>;
text-align:right;
*.th {
color:<%=infoTextFarbe%>;
font-weight:bold;
}thanks in advance
benjaminHello Zhong Li,
many thanks for your post, but it didn't work.
My problem is that the JSF-Components im my included or imported
JSP-Pages does not accept any kind of style or styleClass for
designing. The components take over the informations for colors
but not for alignment.
When I take a look at the generated JAVA-Source in $TOMCAT/WORK/WEBAPP for my sub.jsp ( sub.java )
it seems that the resulting HTML-page would be presented correctly.
But later when I start the application via Firefox or Mozilla the html-sourcecode is totally wrong.
In my example I create a simple grid with 2 rows and 2 columns.
Both columns contains JSF-Outtext-Components and are included with div-tags.
The generated Sub.java shows that the text would be setted in the div-tags. Unfortunately the html-sourcecode represented by my browser shows that jsf-text is not setted in the tags but in the <h:form> tags. The div-tags are neither rounded by <h:form> nor containing the JSF-OutText-Components.
Any clue?
Many thanks Benjamin
Here is the html-code from Firefox:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="http://polaris21:8080/webtest/">
<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" href="stil.jsp" type="text/css" />
</head>
<body>
<form id="_id0" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
<div class="table">
<div class="tr">
<span class="tdleft">value 1</span>
<span class="tdinfo">value 2</span>
</div>
<div class="tr">
<span class="tdleft">value 3</span>
<span class="tdinfo">value 4</span>
</div>
</div>
<input type="hidden" name="_id0" value="_id0" />
</form>
<form id="SUB:_id5" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
<span class="tdleft">value 11</span>
<span class="tdinfo">value 22</span>
<span class="tdleft">value 33</span>
<span class="tdinfo">value 44</span>
<input type="hidden" name="SUB:_id5" value="SUB:_id5" />
</form>
<div class="table">
<div class="tr">
</div>
<div class="tr">
</div>
</div>
</body>
</html> -
Question about jdbc and jsf datatable
hello
I was wondering whether it was a correct way :
-retrieving data with resultset and putting them to an arraylist, then getting to jsf datatable.
or
Is there any better way I can speed up retrieving data from databse ?
regardsorkun wrote:
I was wondering whether it was a correct way :
-retrieving data with resultset and putting them to an arraylist, then getting to jsf datatable.Your question/problem statement is unclear, but just lookup the DAO pattern.
Is there any better way I can speed up retrieving data from databse ?Performance is a matter of good code and datamodel and decent hardware. -
Alignment problem in converting smartform printpreview into PDF
Hi all,
I am getting some alignment problem in converting smartform printpreview into PDF format, i.e the format of PDF is different from printpreviw of smartform.
kindly suggest something so that alignment is not changed while converting to PDF.
Regards,
Sumalathause below f.m to convert it into 255 characters....
CALL FUNCTION 'QCE1_CONVERT'
TABLES
t_source_tab = i_tline
t_target_tab = so_ali[]
EXCEPTIONS
convert_not_possible = 1
OTHERS = 2. -
Alignment problem on abap report after Unicode conversion
Hi,
I've recently convert my system to unicode. Now my user is complaining the aged debtor report (ABAP) is having a column alignment problem when displaying the Japanese character.
I'm not sure what to do now. Have anyone experience this and let me know how can I sove the problem?
/EidaHi,
you need to regenerate the data
For this regeneration, you start the program RKETREGP with the parameter
application class 'KK', subclass '01' and table name 'KKROBJ'.
br, Guido -
EL Expression in a JSF Datatable
I have a JSF Datatable that returns a list of results. These results contain a short version of what I actually want to display. For example, "DOC" which stands for "Document". Is there a way that I can create an EL expression inside the Datatable to print out the full name instead of the shortened name?
jmsjr wrote:
gimbal2 wrote:
IMO this requirement, if it is possible to implement, is only going to lead to a hard to maintain application. But I guess that's something you have to experience before you believe it.
You can't use EL directly in a resource bundle out of the box, but it is possible to parametrize them anyway, did you know that? Perhaps that is already good enough for you.
http://murygin.wordpress.com/2010/04/23/parameter-substitution-in-resource-bundles/
http://stackoverflow.com/questions/5697189/pass-parameters-to-messages-from-resource-bundle-to-components-other-than-hou
Yes, I am aware of parameterising the resource bundles. However, these require you to use f:param .. and the last time I tried, these parameters were not available / visible at the requiredMessage attribute. I'll try it again anyway.As I have re-discovered, you cannot parameterise the requiredMessage attribute.
http://stackoverflow.com/questions/9280915/how-to-parameterize-requiredmessage-attribute-in-composite-component
The other alternative I am looking at, for the cases where the requiredMessage needs to be parameterised, or needs to have dynamic content, is to call a backing method for the requiredMessage attribute, from which I can then do whatever I need, even use EL expressions. I was thinking of this as a last resort.
On the other hand, when one uses the validator attribute, usually one ends up adding one or multiple FacesMessage in code within the method being called, where the string of the message already comes from a resource bundle. I was trying to have a delineation whereby:
1) requiredMessage should only use resource bundles, no backing bean method called.
2) FacesMessages added via the method called by the validator attribute is OK -
Problems in JSF t:commandlink
Hello,
I am facing a problem with JSF Command link
I have three JSP pages with one backing bean in session scope.The property defined in the backing bean is an Object type which contains fields mapped to the database.
The navigation between pages is through hyperlinks.
I enter data on page 1 and move to page 2.Again due to some reasons if I come back to first page I dont see values restored on the textfields on page 1.It is again reset when page 1 loads.I have to restore values and I have to do it using command links.I do not want button to navigate between two pages.
How can I restore data
I set the data on textfields as #{BackingBean.property.property_field}
I am new to JSF.can anyone suggest how to restore values while navigating.
[email protected]
Thankyou,
Pankaj Shirkeon the commandLink tag are you using the immediate = "ture" if so remove it or set it to false
-
JSF Datatable row data - Expand/Collapse
Hi,
I just started learning the JSF concepts. I read articles by BalusC which are very clear and easily understandable. Thanks to BalusC.
I have a requirement to implement expand and collapse data using JSF datatable. The data comes from the backing bean is in the form of java.util.List which contains StudentInfo. I will have to display following data from the list.
*{color:#0000ff}name {color}(this is to be displayed a link), firstname, lastname, dob*
I am able to display the data in a nice formatted table using h:datatable. My main hurdle is to display an expanded info when the name link is clicked. The expanded info should be displayed below the row spanning all columns. The additional info being the comments, instructions whic are the part of the row data. Here is the code describing the StudentInfo.
Appreciate if someone help me with suggestions. Very helpful if any sample code is avaialble.
Regards,
Smitha
public class StudentInfo {
//Following fields to be shown in row data
private String name;
private String firstname;
private String lastname;
private String dob;
//Following fields to be shown in expanded form
private String comments;
private String instructions;
public String getName() {
return name;
public void setName(String name) {
this.name = name;
public String getFirstname() {
return firstname;
public void setFirstname(String firstname) {
this.firstname = firstname;
public String getLastname() {
return lastname;
public void setLastname(String lastname) {
this.lastname = lastname;
public String getDob() {
return dob;
public void setDob(String dob) {
this.dob = dob;
public String getComments() {
return comments;
public void setComments(String comments) {
this.comments = comments;
public String getInstructions() {
return instructions;
public void setInstructions(String instructions) {
this.instructions = instructions;
}That's not possible with plain h:dataTable.
Consider Tomahawk t:dataList where in you can specify rows and colspans yourself using plain HTML. Show/hide rows should be easy with JavaScript. -
Jsf datatable component + java.sql.SQLException
I get the following error when implementing a JSF DataTable component using
JDeveloper 10.1.3.1.
javax.faces.FacesException: java.sql.SQLException: Io exception: Socket closed
I am able to follow the article in this link:
http://www.oracle.com/technology/oramag/oracle/06-jan/o16jsf.html
I can get the table generated, but it occurred to me that the example in this article does not include logic to close the statement, resultset, and connection. Sure enough, I jumped out to the database and there were numerous inactive connections hanging around from my application.
I added the following code before the return null statement from the article:
finally {
try {
rs.close();
stmt.close();
c.close();
catch (Exception e) {
System.out.println("after close");
So I need to know the proper procedure to closing the resultset, statement, and connection using a jsf datatable component.You need to make sure you're using the Oracle9i JDBC driver, or using the Oracle 8.1.7.2 JDBC driver as I mentioned above.
If you are using JDeveloper9i release 9.0.2 or 9.0.3, the driver you need is in <jdevhome>\jdbc\lib
Otherwise, you can also download the drivers from OTN. -
Having a image alignment problem using clearbox
Hi,
I'm having an image alignment problem. I cannot figure it out. I'm using the clearbox - lightbox dreamweaver widget. Using Dreamweaver CS6.
Actual page located here. Any help would be appreciated.
http://dirtysouthink.com/gallery/dustin2.htmlThis has very little to do with Dreamweaver. DW is merely a tool to assist you in building a web site. It is purely a matter of styling (CSS).
When I look at the structure, I see
BODY-CONTENT (width: 490px)
GALLERY (width: 452px)
CONTAINER (width: 500px)
ITEM (width: 150px)
From this I can deduce that:
GALLERY will fit inside BODY-CONTENT
CONTAINER will NOT fit inside GALLERY or BODY-CONTENT
ITEM will fit three times into CONTAINER
To start with, I would reduce the size of the CONTAINER so that it fits inside of its parent. Then I would adjust the width of the ITEM so that only two of them fit inside of the CONTAINER. -
Same alignment problem! can ANYONE help??
Hi guys i still need help with my alignment problem! My nav
bar lokos good in the preview window of fireworks
CLICK
HERE TO VIEW THE NAV BAR IN FIREWORKS
but when previewed in a browser or exported into dreamweaver,
the navbar is all out of order
CLICK
HERE TO VIEW THE NAV BAR IN DREAMWEAVER
Can anyone tell me what is going on?? i really need to launch
the website ASAP.
Thankyou!10totti wrote:
> Hi guys i still need help with my alignment problem! My
nav bar lokos good in
> the preview window of fireworks
>
>
http://img97.imageshack.us/my.php?image=nav1yp1.jpg
I hate being harassed by ads and will not review images on
the image
shack site any longer. Post the screen shot or original file
to your
personal site.
Linda Rathgeber [PVII] *Adobe Community Expert-Fireworks*
http://www.projectseven.com
Fireworks Newsgroup:
news://forums.projectseven.com/fireworks/
CSS Newsgroup: news://forums.projectseven.com/css/
Design Aid Kits:
http://www.webdevbiz.com/pwf/index.cfm -
I am having an alignment issue with a website that I recently built using dreamweaver.
http://bacs.myweb.uga.edu
There is not an alignment problem on the front page (index.html), but subsequent pages (http://bacs.myweb.uga.edu/currentstudents.html) change the alignment of the banners below the tabs for each section. Screen resolutions of 1280X800 do not have any alignment issues, but pretty much any other resolution changes the alignment. Is there a solution to this problem? Rather than posting all the code, you should be able to get it from the links above. Thanks in advance.
Frustrated in Athens,
Aldohtml
<body>
<div id="wrapper">
</div>
</body>
css
#wrapper {
width: /*the width of your content */
margin:0 auto; /*this will centre align it*/
padding:0;
Maybe you are looking for
-
Why does Itunes no longer plays Trailers or bought/rent Movies ?
Hi all, since yesterday, I have the problem that I can't play neither rent movies nor trailers anymore. I get into the player window and I can see all controls, but there is no video or sound playback. With some videos the time counter starts, with s
-
Adobe Reader Will not open any Type of PDF
I resent days I have had to deal with my Adobe Reader X not wanting to open and show any type of PDF's whether it is from a downloaded file to a PDF that is being opened on the web. It will give me a blank black screen and tells me that adobe reader
-
How to combine two dataModel in one JTable
rs = stat.executeQuery(query); model = new ResultSetTableModel(rs); <--- a class to create AbstractTable Model JTable table = new JTabel(model) will show only the data inside the model I want to append some new information How to do??
-
Electronic Signatures in Smartforms
Hi, Is it possible to get electonic signatures into forms?
-
Ok I'm running iChat, and my buddy is running iChat. I can see his 3+ telephone and everything. We both just updated to 10.4.4 If i try and start the chat, and he oks it, the says, "connecting" for a bit. Then it stops and say that I didn't respond.