<p:growl>导致“表单组件需要在其祖先中拥有UIForm”

时间:2016-03-27 14:02:25

标签: forms jsf jsf-2 primefaces

根据this回答,在启用开发模式时,可以消除该弹出窗口。

class Solution:
# @param n: An integer.
# return : A list of integer storing 1 to the largest number with n digits.
def setOnebyOne(self,numList,number,n,index):
    if index == n-1:
        print 'index = n-1',n-1,number
        numList.append(number)
        return numList

    print index,'setting',number

    for i in range(10):
        if i == 0:
            number.append(i)
        else:
            number[index+1] = i
        print number
        self.setOnebyOne(numList, number,n,index+1)  

def numbersByRecursion(self, n):
    # write your code here
    if n <1:
        return None
    numList = []
    for i in range(10):
        print i
        number =[]
        print number
        number.append(i)
        print 'number[0]= ',number
        self.setOnebyOne(numList, number,n,0)

但是当我添加<h:form id="f1" prependId="false" onsubmit="document.getElementById('f1').action='j_security_check';"> ... </h:form>

时,它对我不起作用
<p:growl>

我该如何解决?

我的配置:Wildfly 8,Mojara 2.2.x(服务器运行时),PrimeFaces 5.3

1 个答案:

答案 0 :(得分:0)

在我的情况下,以下解决了这个问题:

<p:menubar id="pmenubar">
    <p:menuitem value="Inicio" url="${facesContext.externalContext.requestContextPath}/hola.xhtml"
                    icon="ui-icon-home" />
</p:menubar>

我忘了关闭这个组件。您可能已经注意到,该组件既没有actionListener也没有action,因此您需要将其括在一个表单中:

<h:form>
    <p:menubar id="pmenubar">
        <p:menuitem value="Inicio" url="${facesContext.externalContext.requestContextPath}/productos/crear-producto.xhtml"
                    icon="ui-icon-home" />
    </p:menubar>
</h:form>