0

I am experiencing some issues when using an a:commandButtonin Internet Explorer. I am using an <a:commandButton> with an action to add a details object. This is working just fine when I use Chrome or Firefox. However, when clicking the add button in Internet Explorer, the context is destroyed and a new one is created.

Some code:
ListPage.xhtml

<a:commandButton action="#{articleDetail.add}"
                            value="Add" id="PopadArticleBtn"
                            reRender="#{facesContext.maximumSeverity eq null ? 'ArticlePanel' : 'PopArticle, errorMsg'}"
                            oncomplete="#{facesContext.maximumSeverity eq null ? 'Richfaces.hideModalPanel(\'addArticle\');' : ''}">                                

And finally the ArticleDetail.java class: (Getters & setters included)

@Name("articleDetail")
@Scope(ScopeType.CONVERSATION)
@AutoCreate
public class ArticleDetail extends EntityQuery<ArticleDetail> {
    private String fuuPm;
    private String fuuTm;
    private String fuuDc;
    private String fuuDn;
    private String fuuVc;
    private String fuuEc;
    private String fuuIc;
    private String fuuTc;
    private String fuuUc;

    public void add() {
    Boolean unique = Boolean.TRUE;
    Boolean empty = Boolean.FALSE;
    article = populateArticle(
            article,
            getEntityManager().find(
                    ArticleMaster.class,
                    new ArticleMasterId(Integer.parseInt(fuuPm), Integer
                            .parseInt(fuuTm), fuuDc, fuuDn, fuuVc, fuuEc,
                            fuuIc, fuuTc, fuuUc)));
}

So the problem: in chrome, when debugging, all the attributes have a value, in internet explorer all the values are null because of the nex context created

I really have no clue why other browsers seem to leave the conversation context intact and IE somehow causes a new context.

Similar question: https://stackoverflow.com/questions/2906774/a4jcommandbutton-causes-full-page-reload-on-ie7

Thanks in advance!

4

1 回答 1

0

发生此问题的原因是<a:commandButton>被放置在嵌套表单中。通过将表单和 commandButton 移出原来所在的表单,行为与预期一致。

似乎 IE 对表单的 W3C 规范比 Chrome 和 Firefox 更严格:W3C Forms Norms

每个表单都必须包含在一个 FORM 元素中。一个文档中可以有多个表单,但 FORM 元素不能嵌套。

于 2013-05-03T13:44:51.603 回答