显示h:commandButton的标签值的问题

时间:2012-08-02 08:26:55

标签: jsf-2 primefaces

我在显示<h:commandButton>的标签值时遇到问题。例如,请参阅以下代码

<td align="left"  style="float: left;">
            <h:commandButton value ="Reset Demand To Default"  styleClass="refresh-button-style" />
        </td>

我已经为这个按钮创建了styleclass,下面指定了styleclass的代码。

.refresh-button-style
{
word-wrap: break-word !important;
background-color:#2996EF;
height:40px;
width:100px;
font-size:13px;
text-align: center;
font-family: Arial;
 }

当我尝试运行xhtml文件并禁用标签值时,标签值似乎水平显示。它确实执行wordwrap,因此只显示按钮标签的一部分。你能告诉我如何实现按钮的wordwrap并在命令Button中显示整个标签值。

1 个答案:

答案 0 :(得分:1)

尝试以下css属性:

white-space:normal;

这应该按预期包装文本(source)。