I have a Facelets Composite component that includes, among other things, a commandButton:
<?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>
I’ve changed the code to use val.nameField.value as the label for the first command button to demonstrate the problem.
When I use this component in a page, it renders the button and a list of searchable fields below it. If I change the value of the name field, the button label changes.
However, if I click the button, I get a target unreachable exception:
Caused by: javax.el.PropertyNotFoundException: /resources/components /opt/bulkEdit.xhtml @25,79 action="#{val.select}": Target Unreachable, identifier 'val' resolved to null
I feel like I must be missing something fundamental to how these composite components work. This worked fine as a tag file under facelets/JSF 1.2. In the process of upgrading to JSF 2.0, I wanted to move on to using composite components so I can have a defined interface.
If I stop using <ui:param/> and put cc.attrs.value in directly, it tells me that cc is null.
I thought this could be a bug in icefaces, but switching to plain <h:commandButton/> does the same thing.
Thanks for any advice you may have.
This is a bug in ICEfaces 2.0. You have a UISeries (panelTabSet or dataTable) that contains the composite component. See http://jira.icesoft.org/browse/ICE-7142. It’s fixed in 3.0.