Utilisation de <tr:table>
Salut,
J'utilise l'implémentation MyFaces et Trinidad sous Eclipse avec PostgreSQL.
Je suis un peu déçu par les tables. Celles que je fais apparaître sont beaucoup moins belles que celles que je vois dans les tutos et démos comme si j'étais en mode texte.
Certaines balises n'ont aucun effet sur l'aspect, notamment les align="center" ou les rowbanding...
Et en plus la navigation ne fonctionne jamais!
Est-ce que j'ai des choses en plus à ajouter à mon code?
Voici une de mes pages, mon web.xml et mon trinidad-config.xml. Merci de votre aide!
page :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://myfaces.apache.org/trinidad" prefix="tr"%>
<%@ taglib uri="http://myfaces.apache.org/trinidad/html" prefix="trh"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:directive.page contentType="text/html;charset=utf-8"/>
<title>Search results</title>
</head>
<body>
<f:view>
<tr:form>
Here is the results set matching your requirements :
<br/>
<tr:table allDetailsEnabled="true" var="oritem" value="#{beanAccessData.objectsRetrieved}" rows="10" summary="Element information">
<tr:column headerText="Id">
<h:outputText value="#{oritem.id}">
</h:outputText>
</tr:column>
<tr:column>
<tr:column headerText="Class">
<h:outputText value="#{oritem.oclass}" />
</tr:column>
</tr:column>
<tr:column>
<tr:column headerText="Name">
<h:outputText value="#{oritem.name}" />
</tr:column>
</tr:column>
<tr:column>
<tr:column headerText="Species">
<h:outputText value="#{oritem.species}" />
</tr:column>
</tr:column>
<tr:column align="center">
<tr:column headerText="Database Id">
<h:outputText value="#{oritem.databaseid}" />
</tr:column>
</tr:column>
</tr:table>
<br/>
<h:outputLink value="TestPage.jsf">
<h:outputText value="Back to the search page" />
</h:outputLink>
</tr:form>
</f:view>
</body>
</html> |
Web.xml :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Quercus</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<!-- Trinidad also supports an optimized strategy for caching some
view state at an application level, which significantly improves
scalability. However, it makes it harder to develop (updates to
pages will not be noticed until the server is restarted), and in
some rare cases cannot be used for some pages (see Trinidad
documentation for more information) -->
<context-param>
<param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</param-name>
<param-value>false</param-value>
</context-param>
<!-- If this parameter is enabled, Trinidad will automatically
check the modification date of your JSPs, and discard saved
state when they change; this makes development easier,
but adds overhead that should be avoided when your application
is deployed -->
<context-param>
<param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
<param-value>true</param-value>
</context-param>
<!-- Enables Change Persistence at a session scope. By default,
Change Persistence is entirely disabled. The ChangeManager is
an API, which can persist component modifications (like,
is a showDetail or tree expanded or collapsed). For providing
a custom Change Persistence implementation inherit from the
Trinidad API's ChangeManager class. As the value you have
to use the fullqualified class name. -->
<context-param>
<param-name>org.apache.myfaces.trinidad.CHANGE_PERSISTENCE</param-name>
<param-value>session</param-value>
</context-param>
<filter>
<filter-name>trinidad</filter-name>
<filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>trinidad</filter-name>
<servlet-name>faces</servlet-name>
</filter-mapping>
<!-- Faces Servlet -->
<servlet>
<servlet-name>faces</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<!-- resource loader servlet -->
<servlet>
<servlet-name>resources</servlet-name>
<servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>resources</servlet-name>
<url-pattern>/adf/*</url-pattern>
</servlet-mapping> |
trinidad-config.xml :
Code:
1 2 3 4 5 6 7
| <?xml version="1.0"?>
<trinidad-config xmlns="http://myfaces.apache.org/trinidad/config">
<!-- Enable debug output -->
<debug-output>true</debug-output>
<accessibility-mode>default</accessibility-mode>
<skin-family>simple</skin-family>
</trinidad-config> |