小编Jas*_*ies的帖子

在 PrimeNG 中过滤数据表

如何在数据表中使用 PrimeNG 的默认过滤器过滤后获取行数。

[totalRecords]="totalRecords"始终显示最初获取的记录数。

即使经过过滤,totalRecords值仍然保持不变并且过滤后不会改变。

例如:最初totalRecords是50,过滤后,数据表中显示的记录数是15。但是我无法得到值15,而是得到50。

有什么办法吗?

primeng primeng-datatable angular5

6
推荐指数
1
解决办法
2万
查看次数

在两个p:growl中显示基于Severity的消息

我正在使用PrimeFaces p:咆哮.

<p:growl id="msgsInfo"
         rendered="true"
         showDetail="true" />
<p:growl id="msgsError"
         globalOnly="true"
         showDetail="true"
         sticky="true" />
Run Code Online (Sandbox Code Playgroud)

我需要在第一个咆哮中显示Info消息,而在第二个我需要显示Error消息.使用globalOnly当我添加错误消息时,显示2次.

任何的想法?

message growl primefaces

5
推荐指数
1
解决办法
5943
查看次数

根据区域设置确定日期时间模式

我有以下JSF代码来显示使用某种模式的日期.

<f:convertDateTime pattern="E, d MMM, yyyy" timeZone="#{localeBean.timeZone}" />
Run Code Online (Sandbox Code Playgroud)

我想通过localeBean将模式传递给它.有没有办法根据区域设置确定特定模式?

public LocaleBean() {
  this.defaultTimeZone = TimeZone.getDefault();
  this.strLocale = Locale.getDefault().toString();
  this.timeZone = defaultTimeZone.getDisplayName();
}
Run Code Online (Sandbox Code Playgroud)

java jsf datetime

5
推荐指数
2
解决办法
3674
查看次数

如何在不影响Primefaces输出标签的情况下将inputText设置为必需?

当我将inputText设置为required时,我与inputText关联的outputLabel会自动添加一个星号.如何防止出现星号?

<p:outputLabel value="Target Species" for="idInputText" />  
<p:inputText id="idInputText" required="true" value="#{controller.string}"/>
Run Code Online (Sandbox Code Playgroud)

我正在使用PrimeFaces 4.0

jsf primefaces

5
推荐指数
3
解决办法
9313
查看次数

在更新时将p:消息滚动到视图中并且(错误)消息存在

我正在使用PrimeFaces消息,我希望我的整个页面在p:messages渲染时滚动到顶部.

scroll primefaces

5
推荐指数
2
解决办法
9548
查看次数

多个UITableViewCell子类使用相同的xib?

如何xib在多个UITableViewCell子类中共享一个?

它们都具有相同的视图界面,​​因此我不希望多次重复相同的xib更改单元类.

- (void)viewDidLoad
{
    [super viewDidLoad];

    [self.tableView registerNib:[UINib nibWithNibName:@"BaseCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"BaseCell"];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    BaseCell *baseCell = [tableView dequeueReusableCellWithIdentifier:@"BaseCell" forIndexPath:indexPath];

    ...
Run Code Online (Sandbox Code Playgroud)

我需要的是我的一个实例ChildCell- 这是我的一个子类BaseCell.有任何想法吗?

objective-c uitableview xib ios

5
推荐指数
1
解决办法
1009
查看次数

过滤JSF表

我想为JSF表添加过滤器,并根据过滤器值限制值.

<h:inputText id="search" value="#{accounts.searchString}"></h:inputText>

<h:commandButton value="Search" action="#{accounts.search()}">
    <f:ajax execute="search" render="output"></f:ajax>
</h:commandButton>
Run Code Online (Sandbox Code Playgroud)

我想最好的方法是将过滤器值添加到SQL查询中:

SELECT * FROM CUSTOMERS ORDER BY %S %S offset ? limit ?
Run Code Online (Sandbox Code Playgroud)

完整代码:http://pastebin.com/eEeTWEqK

我如何将代码实现为链接?

PS.我这样修改了代码:

<div class="div_input_style">
    <h:inputText id="search" class="input_style" value="#{accounts.searchString}"></h:inputText>

    <h:commandButton class="theSpan" value="Search by title">
        <f:ajax execute="search" render="output"></f:ajax>
    </h:commandButton>
</div>
Run Code Online (Sandbox Code Playgroud)
public List<AccountsObj> list(int firstRow, int rowCount, String sortField, boolean sortAscending) throws SQLException
    {
        String SqlStatement = null;

        if (ds == null)
        {
            throw new SQLException();
        }

        Connection conn = ds.getConnection();
        if (conn == null) …
Run Code Online (Sandbox Code Playgroud)

jsf jsf-2

5
推荐指数
0
解决办法
491
查看次数

如何在p:menuitem中使用堆叠的Font Awesome图标?

我正在使用Font Awesome PrimeFaces集成(使用常规图标)并且效果很好.

现在我试图通过以下方式使堆叠图标工作:

<span class="fa-stack fa-lg">
   <i class="fa fa-square-o fa-stack-2x"></i>
   <i class="fa fa-twitter fa-stack-1x"></i>
</span>
Run Code Online (Sandbox Code Playgroud)

在我使用PrimeFaces的代码示例中,我有类似的东西

<p:submenu expanded="true" label="Request" styleClass="groupmenu">
    <p:menuitem value="Annual Forecast" outcome="coursesList.xhtml" icon="fa fa-pencil" />
    <p:menuitem value="Forecast History" outcome="annualList.xhtml" icon="fa fa-eye"  />
</p:submenu>
Run Code Online (Sandbox Code Playgroud)

我想,以取代fa-pencilfa-eye一些堆积图标

我怎样才能实现它?谢谢

css primefaces font-awesome jsf-2.2

5
推荐指数
0
解决办法
1026
查看次数

如何在新标签页中打开 PDF 文件

我正在使用 JSF,我想在单击按钮时在新选项卡中打开 PDF 文件。

XHTML

<p:commandButton onclick="this.form.target = '_blank'"
                 actionListener="#{managedBean.openFile(file)}"
                 ajax="false" />
Run Code Online (Sandbox Code Playgroud)

托管bean

public void openFile( File file ) {
FacesContext facesContext = FacesContext.getCurrentInstance();
        ExternalContext externalContext = facesContext.getExternalContext();
        HttpServletResponse response = (HttpServletResponse) externalContext.getResponse();
        BufferedInputStream input = null;
        BufferedOutputStream output = null;

        try {
            // Open file.
            input = new BufferedInputStream(new FileInputStream(file), 10240);

            // Init servlet response.
            response.reset();
            // lire un fichier pdf
            response.setHeader("Content-type", "application/pdf"); 
            response.setContentLength((int)file.length());

            response.setHeader("Content-disposition", "attachment; filename=" + node.getNomRepertoire());
            response.setHeader("pragma", "public");
            output = new BufferedOutputStream(response.getOutputStream(), 10240);

            // Write file …
Run Code Online (Sandbox Code Playgroud)

pdf jsf primefaces

5
推荐指数
1
解决办法
9675
查看次数

如何从 FreeMarker 中的即时时间获取日期(例如:星期一)

所以我在Java中得到了这个即时日期:“2018-05-19T22:00:00Z”。

我怎样才能获得星期几?就像星期一..

我正在尝试这个,但它不起作用:

${date?string["EEEE"]}
Run Code Online (Sandbox Code Playgroud)

谢谢

java freemarker date

5
推荐指数
1
解决办法
2713
查看次数