Link to home
Start Free TrialLog in
Avatar of eSolutionsGroupAS
eSolutionsGroupAS

asked on

Column size in JSF dataTable

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>
ASKER CERTIFIED SOLUTION
Avatar of itamar82
itamar82

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TimYates
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
Avatar of eSolutionsGroupAS
eSolutionsGroupAS

ASKER

                           <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