p:galleria doesn't show after sign up, but directly yes

て烟熏妆下的殇ゞ 提交于 2019-12-12 00:57:08

问题


I am trying to display some picture in a primefaces galleria after signing in, in a new xhtml, but nothing happens.

This is the "sing in" page (index.xhtml, "Bejelentkezés" means "Sign in" in hungarian):

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:

If I write "localhost:8080/Primefaces_test1/home.xhtml" into the browser, ENTER, see a miracle, I got this:

As you can see, the names of the pictures are there every time. How could it be possible? My home.xhtml:

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;
    }

}

The project:

Any ideas?

And an another question.. Why don't the pictures in the galleria show the right size, like the lonely picture under?


回答1:


Try to set ajax="false" in the p:commandButton element.



来源:https://stackoverflow.com/questions/15256502/pgalleria-doesnt-show-after-sign-up-but-directly-yes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!