如何设置p:面板组件的标题样式?我想设置panel_header div的高度.
<p:panel id="panel"
toggleSpeed="500" toggleable="true">
<f:facet name="header" >
<p:outputPanel style="float:left;">
<p:commandButton process="@this" id="new"
oncomplete="dialog.show();" icon="ui-icon-plus" />
<p:spacer width="15px;" />
</p:outputPanel>
<h:outputLabel value="Title" />
</f:facet>
</p:panel>
Run Code Online (Sandbox Code Playgroud) 我正在使用<p:growl>PrimeFaces 3.2的组件来显示面部消息.我想自定义它的位置,使其显示在左侧而不是右侧.
我尝试了以下方法:
<h:head>
<title>Facelet Title</title>
<style type="text/css">
.ui-growl {
position:absolute;
top:20px;
left:20px;
width:301px;
z-index:9999;
}
</style>
</h:head>
<h:body>
<h:form id="frm">
<div id="add">
<p:growl id="growl" showDetail="true" sticky="true" autoUpdate="true"/>
<h:panelGrid columns="2" >
...
Run Code Online (Sandbox Code Playgroud)
但它没有用.我哪里错了?
创建按钮时,ui-corner-all始终应用该类.我尝试了以下方法:
<p:commandButton id="like" styleClass="ui-corner-right" />
Run Code Online (Sandbox Code Playgroud)
但它不起作用.在Firebug的,我看到都ui-corner-all和ui-corner-right:
<div id="form1:like" type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-left ui-corner-right">
Run Code Online (Sandbox Code Playgroud)
更新1:
继从JMelnik提示,我终于成功地改变风格ui-corner-all,以ui-corner-right加入下面的脚本:
<style type="text/css">
#myForm\:likeButton .ui-corner-all {
border-radius: 6px 0px 0px 6px !important;
}
</style>
Run Code Online (Sandbox Code Playgroud)
并将<p:commandButton>内部包装<h:panelGroup>如下:
<h:form id="myForm">
<h:panelGroup id="likeButton">
<p:commandButton />
<h:panelGroup>
</h:form>
Run Code Online (Sandbox Code Playgroud)
更新2:
感谢BalusC的建议,以下解决方案应该更好:
<style type="text/css">
.likeButton .ui-corner-all {
border-radius: 6px 0px 0px 6px !important;
}
</style>
<h:panelGroup styleClass="likeButton">
<p:commandButton />
<h:panelGroup>
Run Code Online (Sandbox Code Playgroud)
最好的祝福,
我需要使用primefaces隐藏所有panelgrids的所有边框.我试过他没有效果:
table {
border: none;
}
table tr, table td {
border: none;
}
Run Code Online (Sandbox Code Playgroud)
我能做什么?
我需要能够隔离 JSF 页面中的 2 个位置以发送到 Primefaces 打印机组件。不幸的是,我在包括 Primefaces 文档在内的任何地方都找不到如何执行此操作的示例。这个命令肯定比只接收一个目标更灵活吗?
使用 Primefaces 6.2
我试过这个:
...
<p:commandButton value="Print in a PRINTER FREINDLY format">
<p:printer target="area1" />
<p:printer target="area2" />
</p:commandButton>
<p:outputPanel id="area1">
...
</p:outputPanel>
...bunch of code between these two output panels...
<p:outputPanel id="area2">
...
</p:outputPanel>
...
Run Code Online (Sandbox Code Playgroud)
没有错误显示但是只有首先放置的目标显示在打印页面中。
这样做:
<p:printer target="area1 area2" />
Run Code Online (Sandbox Code Playgroud)
导致错误。
有人可以告诉我如何在 Primefaces 中为打印机命令设置多个目标吗?
谢谢你。
我想使用h:outputScript标签加载动态资源(生成的 JavaScript,技术上以 JSON 配置)作为动态资源。我知道我可以通过编写自己的 servlet 并通过普通标签脚本加载它来做到这一点,因为我更喜欢加载资源的“JSF 方式”。
有可能吗,怎么可能?
我有一个<p:panel>带有id X,我想从其内容中删除填充X_content为面板内容生成的HTML是:
<div id="X_content" class="ui-panel-content ui-widget-content"> 并且元素出现在chrome开发人员工具中以获得填充:
padding:0.5em 1em;
Run Code Online (Sandbox Code Playgroud)
我制作了一个嵌入式样式表来覆盖primefaces中的那个,如下所示:
<h:head>
<style>
.ui-panel-content, .ui-widget-content{
padding:0px;
}
</style>
</h:head>
Run Code Online (Sandbox Code Playgroud)
但我没有工作,填充仍然存在,任何人都可以帮助我吗?
如何<p:menubar>在Primefaces中定义背景
<p:menubar rendered="#{loginBO.flag=='admin'}" autoSubmenuDisplay="True" style="background-image: url('images/ui-bg_gloss-wave_55_5c9ccc_500x100_png.png')">
<p:menuitem value="Home" url="/RMGHome.xhtml" icon="ui-icon-home" />
<p:menuitem value="Filter Search" action="#{leftMenuService.getMenuList}" icon="ui-icon-search" />
</p:submenu>
Run Code Online (Sandbox Code Playgroud) 如何使用CSS更改组件的属性?
假设我有两个按钮:
<p:commandButton id="mySmallButton" styleClass="smallButton">
<p:commandButton id="myButton">
Run Code Online (Sandbox Code Playgroud)
我希望我的所有按钮都有,font-size: 14px;所以我添加了这条规则:
.ui-button .ui-button-text{
font-size:14px;
}
Run Code Online (Sandbox Code Playgroud)
但我的smallButton应该有不同的大小,所以我补充说:
.smallButton{
font-size:11px;
}
Run Code Online (Sandbox Code Playgroud)
不幸的是,这不起作用.这是HTML生成的:
<button class="ui-button ui-widget ui-state-default ui-corner-all
ui-button-text-only smallButton" (...)>
<span class="ui-button-text ui-c">MY TEXT</span>
</button>
Run Code Online (Sandbox Code Playgroud)
此按钮上的文字大小为14px.CSS应该如何拥有我的所有smallButton font-size: 11px?
我正在尝试使用 JSF 和 primefaces 实现一个简单的接口。我需要一个问题列表,对于每个问题,用户将能够在不同的选项之间进行选择。这些选项很长,我对单选按钮的对齐有问题。
其中一个问题的代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
<h:form>
<div class="ui-g">
<div class="ui-g-1"></div>
<div class="ui-g-10">
<p:panelGrid columns="1" layout="grid"
styleClass="showcase-text-align-center">
<h2>Domanda 1</h2>
<p:selectOneRadio id="domanda1" layout="pageDirection">
<f:selectItem itemLabel="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " itemValue="1" />
<f:selectItem itemLabel="Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex …Run Code Online (Sandbox Code Playgroud)