0

「不明な ID ':commentTextArea' が含まれています - コンポーネント commentLink のコンテキストでそれを見つけることができません」というエラーが表示されるのはなぜですか?

メジャー 2.1.7

commentTextArea をレンダリングする方法。

<ui:repeat var="parentComment" value="#{commentTree.parentCommentsWrapper}"> ....
                          <h:form>

                            <h:commandLink id="commentLink" value="comment"
                                style="height:20px;width:20px;padding: 0; margin: 0;"
                                action="#{parentComment.changeEditable}">
                                **<f:ajax render=":commentTextArea"></f:ajax>**
                            </h:commandLink>

                            </h:form>        <h:panelGroup id="commentTextArea">
                                <br />
                                <h:panelGroup rendered="#{parentComment.editable}">
                                    <h:form >
                                    <h:inputTextarea rows="2" cols="20"
                                        value="#{commentTree.newCommentText}" 
                                        style="font-family:Arial,Helvetica;font-size:12px;width:365px;margin-right: 4px;margin-left: -1px;">
                                    </h:inputTextarea>
                                    <h:commandButton id="newCommentButton" value="+"
                                        style="height:20px;width:20px;padding: 0; margin: 0;"
                                        action="#{commentTree.saveChildComment(parentComment.comment)}" >
                                    </h:commandButton>
                                    </h:form>
                                </h:panelGroup>
                            </h:panelGroup>
</ui:repeat>

'

4

1 に答える 1

0

ID:commentTextAreaは絶対 ID であり、ビュー ルートに相対的です。ただし、ui:repeatNamingContainer であり、あなたのcommentTextArea. (ブラウザーで html ソースをチェックして、生成された ID を確認してください)

簡単な解決策は、「ui:repeat」で 1 つのフォームのみを使用することです。次に、相対ID

<f:ajax render="commentTextArea">

(なし:)が機能します。

于 2012-05-21T09:43:41.600 に答える