プレーンなcommandLinkを機能させようとしています。このページのコードスニペットは次のとおりです。
<div class="item-single">
<h:graphicImage value="image/screenshots/#{collectionListBean.collectionListTeaser[0].screenshot}" alt="Screenshot #{collectionListBean.collectionListTeaser[0].title}"/>
<div class="item-title">
<h:form id="teaser0">
<h:commandLink value="#{collectionListBean.collectionListTeaser[0].title}" action="#{collectionBean.showCollection(collectionListBean.collectionListTeaser[0].id)}" />
</h:form>
</div>
<div class="item-description">
<p>
<h:outputText value="#{collectionListBean.collectionListTeaser[0].persons.get(0).person.getFullName()}" />
</p>
</div>
</div>
タイトルが正しく表示されるため、バッキングBeanとリストが使用可能でアクセス可能です。CollectionBeanも利用可能でアクセス可能です。リストのサイズは固定されており、javascriptギャラリー内で使用されます。これが、ui:repeatまたはh / p:dataTable要素を使用しなかった理由です。
BalusCの一般的な問題のリストも確認しました
アクションはバッキングBeanで呼び出されていません。ブラウザー・コンソールで次のjavascriptエラーが発生します。
Uncaught TypeError: Cannot read property 'teaser0:_idcl' of undefined
バッキングBean(collectionBean)の関連コードは次のとおりです。
@Named("collectionBean")
@Scope("access")
@ViewController(viewIds = {ViewIds.EDIT_COLLECTION, ViewIds.SHOW_COLLECTION, ViewIds.EDIT_COLLECTION, ViewIds.METADATA_COLLECTION_ADMIN, ViewIds.EDIT_COLLECTION_EXISTING, ViewIds.COLLECTION_LIST, ViewIds.HOME})
public class CollectionBean extends CollectionBeanBase {
.
.
.
public String showCollection(long id) {
//Check if user is admin, if yes, allow to edit metadata
Authentication auth=SecurityContextHolder.getContext().getAuthentication();
this.collection = collectionService.findById(id);
if (!(auth instanceof AnonymousAuthenticationToken)){
role=auth.getAuthorities().iterator().next().getAuthority();
if(role.equalsIgnoreCase("ROLE_ADMIN")) {
this.collection.setEdit_flag(true);
return ViewIds.EDIT_COLLECTION;
}
}
return ViewIds.SHOW_COLLECTION;
}
誰かが問題が何であるかについての考えを持っていますか?ヒントは大歓迎です!よろしくお願いします!