p:galleria在注册后没有显示,但直接是 [英] p:galleria doesn't show after sign up, but directly yes
问题描述
我尝试在新的xhtml中登录后在primefaces画廊中显示一些图片,但是什么也没发生.
I am trying to display some picture in a primefaces galleria after signing in, in a new xhtml, but nothing happens.
这是唱歌"页面(index.xhtml,Bejelentkezés"在匈牙利语中的意思是登录")
This is the "sing in" page (index.xhtml, "Bejelentkezés" means "Sign in" in hungarian):
当我用"viktor"(也包括用户名和密码)填充文本时,它导航到"home.xhtml",它将显示画廊的上方,中间的图片名称以及下方的图片.但是我明白了:
When I fill the texts with "viktor" (username and passw too), it navigates to "home.xhtml", which would show the galleria upside, the pictures' name in the middle, and one picture under. But I got this:
如果我在浏览器ENTER中输入"localhost:8080/Primefaces_test1/home.xhtml",看到一个奇迹,我明白了:
If I write "localhost:8080/Primefaces_test1/home.xhtml" into the browser, ENTER, see a miracle, I got this:
如您所见,图片的名称每次都存在.怎么可能呢?我的home.xhtml:
As you can see, the names of the pictures are there every time. How could it be possible? My home.xhtml:
GalleriaBean.java:
GalleriaBean.java:
@ManagedBean(name = "galleriaBean")
@SessionScoped
public class GalleriaBean {
private List<String> images;
private String image;
@PostConstruct
public void init() {
images = new ArrayList<>();
for(int i=1; i<=6; i++) {
images.add(i+".jpg");
}
image = images.get(0);
}
public List<String> getImages() {
return images;
}
public void setImages(List<String> images) {
this.images = images;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
}
项目:
有什么想法吗?
还有另一个问题..为什么画廊中的图片没有显示正确的尺寸,如下面的寂寞图片?
And an another question.. Why don't the pictures in the galleria show the right size, like the lonely picture under?
推荐答案
尝试在p:commandButton元素中设置ajax ="false".
Try to set ajax="false" in the p:commandButton element.
这篇关于p:galleria在注册后没有显示,但直接是的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!