1

特にcommandButtonを含むFaceletsCompositeコンポーネントがあります。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<ui:component xmlns="http://www.w3.org/1999/xhtml" 
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:cc="http://java.sun.com/jsf/composite" 
          xmlns:ice="http://www.icesoft.com/icefaces/component"
          xmlns:nc="http://compositecomps.sss.evla.nrao.edu/jsf"
          xmlns:opt="http://java.sun.com/jsf/composite/components/opt"
          xmlns:undo="http://undo.sss.evla.nrao.edu/jsf"
          xmlns:n="http://sss.evla.nrao.edu/jsf"
          xmlns:f="http://java.sun.com/jsf/core">
<cc:interface>
  <cc:attribute name="value" type="edu.nrao.sss.tools.obsprep.bulkedit.BulkEditor"                      required="true"/>
  <cc:attribute name="loop"  type="edu.nrao.sss.tools.obsprep.uiactions.project.scan.ScanLoopUIActions" required="true"/>
</cc:interface>

<cc:implementation>
  <ui:param name="loop" value="#{cc.attrs.loop}"/>
  <ui:param name="val"  value="#{cc.attrs.value}"/>

  <ice:panelGroup id="wizStep1"
                  rendered="#{val.readyToSelect}">
    <nc:header value="select fields to filter on"/>
    <ice:commandButton value="#{val.nameField.value}" action="#{val.select}"/>
    <table cellpadding="5">
      <thead>
        <tr>
          <th></th><th>Field</th><th>Search For</th><th></th>
        </tr>
      </thead>
      <tbody>
        <opt:bulkEditField value="#{val.nameField}">
          <f:facet name="summary">
            <ice:inputText value="#{val.nameField.value}"/>
          </f:facet>
        </opt:bulkEditField>
      </tbody>
    </table>
    <ice:commandButton value="Select" action="#{val.select}"/>
  </ice:panelGroup>
</cc:implementation>
</ui:component>

val.nameField.value問題を示すために、最初のコマンドボタンのラベルとして使用するコードを変更しました。

このコンポーネントをページで使用すると、ボタンとその下の検索可能なフィールドのリストが表示されます。名前フィールドの値を変更すると、ボタンのラベルが変更されます。

ただし、ボタンをクリックすると、ターゲットに到達できない例外が発生します。

Caused by: javax.el.PropertyNotFoundException: /resources/components /opt/bulkEdit.xhtml @25,79 action="#{val.select}": Target Unreachable, identifier 'val' resolved to null

これらの複合コンポーネントがどのように機能するかについての基本的な何かが欠けているに違いないと感じています。これは、facelets /JSF1.2でタグファイルとして正常に機能しました。JSF 2.0にアップグレードする過程で、インターフェイスを定義できるように、複合コンポーネントの使用に移りたいと思いました。

使用をやめて直接<ui:param/>入れると、 nullと表示されます。cc.attrs.valuecc

これはicefacesのバグかもしれないと思いましたが、プレーンに切り替えると<h:commandButton/>同じことが起こります。

あなたが持っているかもしれないどんなアドバイスにも感謝します。

4

1 に答える 1

0

これは ICEfaces 2.0 のバグです。複合コンポーネントを含む UISeries (panelTabSet または dataTable) があります。http://jira.icesoft.org/browse/ICE-7142を参照してください。3.0で修正されました。

于 2012-06-20T17:13:31.940 に答える