css - 在右边放置一个命令按钮

标签 css primefaces jsf-2.2

我正在使用 jsf2.2 primefaces 6.0,我已经实现了一个图形解决方案,可以通过 primefaces 的 galleria 组件查看、下载和打印图片。

问题是我需要帮助将打印 commandButton 放在右侧以获得最佳人体工程学结果。

这是想要的结果:

Print button on the right

这里是 XHTML 代码:

<p:dialog header="Documents numérisés" widgetVar="diag" modal="true"
                dynamic="true" showEffect="fade" hideEffect="fade" resizable="true"
                position="center" id="diagImages" onShow="download()">
                <p:outputPanel id="gal" style="text-align:center;">
                    <p:galleria value="#{demandeBean.demandeSelectionnee.images}"
                        panelWidth="500" panelHeight="313" showCaption="false"
                        autoPlay="false" var="image">
                        <p:graphicImage id="image"
                            value="http://localhost:18080/openCars/images/#{image}"
                            width="500" height="313" />
                    </p:galleria>
                </p:outputPanel>
                <p:commandButton value="Print" type="button" icon="ui-icon-print" 
                    style="display:block;margin-bottom: 20px">
                    <p:printer target="image" />
                </p:commandButton>
            </p:dialog>

最佳答案

好吧,这可能不是一个完美的解决方案,但它对我有用。

<p:panelGrid>
<p:commandButton value="Print" type="button" icon="ui-icon-print"
style="float:right;">
<p:printer target="image" />
</p:commandButton>
<p:panelGrid>

关于css - 在右边放置一个命令按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44827151/

相关文章:

javascript - primefaces日历关闭overlayPanel

jsf - 有条件渲染 p :commandLinks

html - 为什么我的 img 元素总是从 srcset 加载最大的图像

html - 保持 Div 居中

html - 是否有可能使 float DIV 在不适合容器时不换行?

jsf-2 - 起始面流

spring - JSF 操作未调用(一种情况有效,而第二种情况则无效)

javascript - jQuery 检查是否设置了 .css 属性

jsf - p :resetInput does not reset the p:dialog when it is reopened

显示选项卡后触发 Primefaces tabview tabChange 事件