我有我可以訪問重複外的userProfileBean但是當我做訪問bean在JSF
<ui:repeat id="reqlistID" var="reqlist" value="#{userProfileBean.friendRequestsList}">
jmeno: #{reqlist.jmeno} <br/> prijmeni: #{reqlist.prijmeni} <br/> id: #{reqlist.id} <br/>
<p:commandButton id="allowFriendButton"
action="#{userProfileBean.allowFriend()}"
value="Přidat"
update="reqlistID">
</p:commandButton>
然後allowFriend方法不會被調用和NetBeans說不明財產。我錯過了什麼嗎?
編輯:謝謝你的回覆。仍然不起作用。現在國家就是這樣。
<h:form>
<p:commandButton id="allson"
action="#{userProfileBean.testt()}"
value="Přidat"
ajax="false">
</p:commandButton>
</h:form>
<c:if test="#{principalBean.p.login == userProfileBean.name}">
Žádosti přidání do přátel:<br/>
<ui:repeat id="reqlistID" var="reqlist" value="#{userProfileBean.friendRequestsList}">
jmeno: #{reqlist.jmeno} <br/> prijmeni: #{reqlist.prijmeni} <br/> id: #{reqlist.id} <br/>
<h:form>
<p:commandButton id="allowFriendButton"
action="#{userProfileBean.testt()}"
value="Přidat"
ajax="false">
</p:commandButton>
</h:form>
<br/>
</ui:repeat>
</c:if>
第一<p:commandButton>
作品和正確調用該方法(使用頁面重載)。第二個按鈕重新加載頁面,但不調用該方法。問題似乎是從重複內部訪問userProfileBean。但我不能谷歌任何解釋。
* allowFriend方法沒有被調用,netbeans說未知的屬性*你檢查過這個方法是否存在於你的託管bean中,並且是'public'? – 2013-05-09 14:20:21