【发布时间】:2012-03-05 02:14:19
【问题描述】:
我有一个使用 ICEfaces 1.8 的 JSF 1.2 数据表。在一个列中,我想显示来自支持 bean 的文本,然后在它的右侧,在同一行上显示一个小图像,而不会换行。
图像实际上是一个ice:commandButton 组件,设置了图像属性。点击图片的动作是显示ice:panelPopup面板。
下面是dataTable中列的相关代码:
<ice:column id="col1">
<ice:outputText escape="false" value="#{document.column1Value}" />
<ice:form>
<ice:commandButton actionListener="#{bean1.open}" image="images/popup.gif">
<f:attribute name="docParam" value="#{document.parameter}" />
</ice:commandButton>
...
</ice:form>
</ice:column>
我尝试了各种添加CSS样式信息到各种标签,包括white-space:nowrap和float,但都无法得到想要的效果。
【问题讨论】:
-
我不确定我是否发现了问题。您已经将文本和图像按钮放在
<ice:panelGrid>的一个 hacky 的 2 列表中,但它们仍然显示在彼此下方?或者您实际上是在问如何在不使用表格的情况下实现它? -
@BalusC。
<ice:panelPopup>中的图像不是问题。我想我可以把那个组件拿出来,但我把它包括在内以防万一。问题是commandButton (images/popup.gif) 中显示的图像显示在来自#{document1.column1Value}的文本下方。我正在尝试让它们都在列单元格中内联显示。 -
哦,我现在明白你的意思了。我已经从问题中删除了一些代码噪音并发布了答案。