-2

私はこの問題に保護された属性を含むクラスを取得しました:

テストクラス:

abstract public class Test extends WithAttachment{
static ISQLTest pISQLTest = null;

// Ajour une refence au campagne ??? pour resoudre le Warning

/**
 * Date de creation du test
 */
protected Date creationDate;

/**
 * Nom complet du concepteur du test
 */
protected String conceptorName;

/**
 * Login du concepteur du test
 */
protected String conceptorLogin;
.....}

マネージドBean:

    private Test selectedTest; // with getters and setters

xhtmlページ:

 <h:panelGrid columns="2" cellpadding="4" header="Test Details">

                                  <h:outputText value="Name of The Test :" />  
                                  <h:outputText value="#{projectTestManagementMB.selectedTest.name}" /> 

                                  <h:outputText value="Creation Date :" />  
                                  <h:outputText value="#{projectTestManagementMB.selectedTest.creationDate}" /> 

                                  <h:outputText value="Executed :" />  
                                  <h:outputText value="#{projectTestManagementMB.testExecutedFlag}" /> 

                                  <h:outputText value="Owner :" /> 
                                  <h:outputText value="#{projectTestManagementMB.selectedTest.conceptorName} #{projectTestManagementMB.selectedTestconceptorLogin}" /> 


  </h:panelGrid>

したがって、EL式のxhtmlページでそれらにアクセスしようとすると、このエラーが発生します。t attribute name can no be resolved as member of selectedTest

したがって、クラスTest属性のアクセスタイプ(保護)を変更せずにこの問題を解決する可能性はありますか。

どんな助けでもありがたいです

4

2 に答える 2

2

まあ、それが言うように-あなたが私たちに見せていないTestのでない限り、には「名前」属性はWithAttachmentありません。

あなたは持っていますがconceptorName、持っていませんname。確かに、保護されたフィールドを持つことがとにかく十分であるかどうかはわかりません-私はプライベートフィールドとパブリックプロパティを期待します。getName()

于 2012-10-03T09:10:51.267 に答える
0
#{projectTestManagementMB.selectedTest.name}

あなたの属性はどこにありますnameか?クラスでTest..

于 2012-10-03T09:12:37.710 に答える