小编Ton*_*ero的帖子

如何从资源文件夹引用p:graphicImage中的img

我在以下路径中有一张图片:

resources
\_____img
 \_______sites
  \_______reddit.png
Run Code Online (Sandbox Code Playgroud)

我使用以下命令行来引用它:

<p:graphicImage library="img" name="/sites/reddit.png"/>
Run Code Online (Sandbox Code Playgroud)

但在开发控制台中却说:

GET http://localhost:8080/RES_NOT_FOUND 404 ()
Run Code Online (Sandbox Code Playgroud)

并且不会渲染图像。

怎么了?

jsf primefaces graphicimage

3
推荐指数
1
解决办法
2963
查看次数

如何正确设置 p:autoComplete 宽度以填充面板

如何设置自动完成宽度以正确填充面板?

自动完成

如您所见,使用:

.ui-autocomplete input {
        width: 100%;
    }
Run Code Online (Sandbox Code Playgroud)

将箭头移出面板

编辑:panelGrid

<p:panelGrid columns="3" style="border: hidden; width: 100%" styleClass="ui-panelgrid-blank">
                        <p:panelGrid>
                            <p:outputLabel value="Item name" for="haveName" />
                            <br/>
                            <p:autoComplete id="haveName" effect="fade" dropdown="true" forceSelection="true"/>
                        </p:panelGrid>

                        <p:panelGrid>
                            <p:outputLabel value="Paint" for="havePaint" />
                            <br/>
                            <p:autoComplete id="havePaint" effect="fade" dropdown="true" forceSelection="true"/>
                        </p:panelGrid>

                        <p:panelGrid>
                            <p:outputLabel value="Certification" for="haveCert" />
                            <br/>
                            <p:autoComplete id="haveCert" effect="fade" dropdown="true" forceSelection="true"/>
                        </p:panelGrid>
                    </p:panelGrid>
Run Code Online (Sandbox Code Playgroud)

EDIT2:这就是我style="width: 100%"在 autoComplete 标签中设置时发生的情况:

自动完成宽度

EDIT3:当我结合两者时会发生这种情况:

两个CSS

css autocomplete width primefaces

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

使用单个 if 条件表达真值表

我的代码如下所示:

/*
 * A B
 * 0 0 -> 1
 * 0 1 -> 0
 * 1 0 -> 0
 * 1 1 -> 0
 */

#define A condition_1
#define B condition_2

if (A) {
    // do nothing
} else {
    if (B) {
        // do nothing
    } else {
        // do something
    }
}
Run Code Online (Sandbox Code Playgroud)

上面我已经报告了1istrue0is两个条件的真值表false,有没有办法将真值表表达为单个 if 条件?

c++ if-statement truthtable conditional-statements

0
推荐指数
1
解决办法
57
查看次数