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-backgroun d"
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.viewJobD etail}"
immediate="true" value="#{jobList.editLable }" type="SUBMIT"/>
<h:commandButton id="deleteJob" action="#{jobList.deleteJo b}");"
immediate="true" value="#{jobList.deleteLab le}" type="SUBMIT"/>
</h:column>
<h:column>
<c:facet name="header">
<h:outputText value="Next trigger time:"/>
</c:facet>
<h:outputText id="triggerTime" value="#{jobs.nextTriggerT ime}"/>
</h:column>
</h:dataTable>
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
headerClass="list-header" rowClasses="list-row" styleClass="list-backgroun
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}
<h:commandButton id="editJob" action="#{jobList.viewJobD
immediate="true" value="#{jobList.editLable
<h:commandButton id="deleteJob" action="#{jobList.deleteJo
immediate="true" value="#{jobList.deleteLab
</h:column>
<h:column>
<c:facet name="header">
<h:outputText value="Next trigger time:"/>
</c:facet>
<h:outputText id="triggerTime" value="#{jobs.nextTriggerT
</h:column>
</h:dataTable>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
<h:column>
<c:facet name="header">
<h:outputText value="Next trigger time:"/>
</c:facet>
<h:outputText style="width:200px" id="triggerTime" value="#{jobs.nextTriggerT ime}"/>
</h:column>
Works fine. I didn't get the
<f:attribute value="true" name="nowrap" />
solution to work though.
Thanks!
- Karl
<c:facet name="header">
<h:outputText value="Next trigger time:"/>
</c:facet>
<h:outputText style="width:200px" id="triggerTime" value="#{jobs.nextTriggerT
</h:column>
Works fine. I didn't get the
<f:attribute value="true" name="nowrap" />
solution to work though.
Thanks!
- Karl
<h:column>
<c:facet name="header">
<h:outputText value="Next trigger time:"/>
</c:facet>
<h:outputText id="triggerTime" value="#{jobs.nextTriggerT
</h:column>
to:
<h:column>
<c:facet name="header">
<h:outputText value="Next trigger time:"/>
</c:facet>
<h:outputText id="triggerTime" value="#{jobs.nextTriggerT
<f:attribute value="true" name="nowrap" />
</h:column>
Tim