?
Solved

Column size in JSF dataTable

Posted on 2006-04-05
3
Medium Priority
?
11,398 Views
Last Modified: 2008-01-09
Hi. I have a JSF dataTable with a string like "2006-04-05 14:58:00" in the far right column.

The problem is that this string looks like this:

2006-
04-05
14:58:00


So I need either to get a nowrap on my cells in that column,
or to be able to explicitly set the size of the cells in the column
in order to prevent this from happening. Anyone know how this
can be achieved? (see code below)

\\Karl



THE CODE:


<h:dataTable id="table" columnClasses="list-column-left, list-column-left, list-column-left"
                                      headerClass="list-header" rowClasses="list-row" styleClass="list-background"
                                      value="#{jobList.jobs}" var="jobs">
                           
                            <h:column>
                                <c:facet name="header">
                                    <h:outputText value="Job name:"/>
                                </c:facet>
                                <h:outputText id="name" value="#{jobs.name}"/>
                            </h:column>
                           
                           
                            <h:column>
                                <c:facet name="header">
                                    <h:outputText value="Commands"/>
                                </c:facet>
                                <h:commandButton id="runJob" action="#{jobList.runJob}"
                                    immediate="true" value="#{jobList.runLable}" type="SUBMIT" />
                                <h:commandButton id="editJob" action="#{jobList.viewJobDetail}"
                                    immediate="true" value="#{jobList.editLable}" type="SUBMIT"/>
                                <h:commandButton id="deleteJob" action="#{jobList.deleteJob}");"
                                    immediate="true" value="#{jobList.deleteLable}" type="SUBMIT"/>
                            </h:column>
                           
                            <h:column>
                                <c:facet name="header">
                                    <h:outputText value="Next trigger time:"/>
                                </c:facet>
                                <h:outputText id="triggerTime" value="#{jobs.nextTriggerTime}"/>
                            </h:column>                          
                           
                        </h:dataTable>
0
Comment
Question by:eSolutionsGroupAS
3 Comments
 

Accepted Solution

by:
itamar82 earned 375 total points
ID: 16381782
0
 
LVL 35

Expert Comment

by:TimYates
ID: 16389657
Try changing:

                            <h:column>
                                <c:facet name="header">
                                    <h:outputText value="Next trigger time:"/>
                                </c:facet>
                                <h:outputText id="triggerTime" value="#{jobs.nextTriggerTime}"/>
                            </h:column>                          

to:

                            <h:column>
                                <c:facet name="header">
                                    <h:outputText value="Next trigger time:"/>
                                </c:facet>
                                <h:outputText id="triggerTime" value="#{jobs.nextTriggerTime}"/>
                                <f:attribute value="true" name="nowrap" />
                            </h:column>                          

Tim
0
 

Author Comment

by:eSolutionsGroupAS
ID: 16390389
                           <h:column>                                
                                <c:facet name="header">
                                    <h:outputText value="Next trigger time:"/>
                                </c:facet>                                
                                <h:outputText style="width:200px" id="triggerTime" value="#{jobs.nextTriggerTime}"/>                                
                            </h:column>  


Works fine. I didn't get the

<f:attribute value="true" name="nowrap" />

 solution to work though.


Thanks!

- Karl
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question