failure to resolve method when used in tag files
pappy Mar 13, 2007 5:58 AMHi,
I'm trying to use ajax4jsf from a tag file. When I issue a click on a link whose action is a method, the server logs the error "Target Unreachable, identifier 'value' resolved to null" causing "internal server error" message box on the browser.
I'm using glassfish-9.0 (b48) with JSF-1.2_03, but I don't think it is a JSF related issue, normal JSF commands work well from tag.
I'm digging into this for several days and cannot figure what is hapenning...
Here is the tag I'm using:
<%@ tag display-name="t" isELIgnored="false" body-content="empty"%> <%@ attribute name="value" required="true" deferredValue="true" deferredValueType="samples.Bean"%> <%@ taglib prefix="a" uri="https://ajax4jsf.dev.java.net/ajax"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <f:subview id="t"> <h:panelGrid id="grid" columns="8" border="1" columnClasses="display"> <h:outputText value="#{value.value}" /> <h:outputText value="#{value.editable ? 'T' : 'F'}" /> <h:commandButton value="TE" action="#{value.toggleEdit}" /> <a:commandLink value="FF" action="#{value.toggleEdit}" reRender="grid" ajaxSingle="false" immediate="false" /> <a:commandLink value="FT" action="#{value.toggleEdit}" reRender="grid" ajaxSingle="false" immediate="true" /> <a:commandLink value="TF" action="#{value.toggleEdit}" reRender="grid" ajaxSingle="true" immediate="false" /> <a:commandLink value="TT" action="#{value.toggleEdit}" reRender="grid" ajaxSingle="true" immediate="true" /> </h:panelGrid> </f:subview>
Here is the tag invocation:
<a:form> <q:t value="#{b1}"/> <q:t value="#{b2}"/> </a:form>
... and here is the bean
package samples; import java.util.Formatter; import java.util.logging.Logger; @SuppressWarnings( "nls" ) public class Bean { private final String id = IdGen.next(); private boolean editable; private String value = "this is my value..."; public Bean() { } public Bean( String value ) { setValue( value ); } static Bean valueOf( String value ) { return new Bean( value ); } public String getId() { return id; } public boolean isEditable() { return editable; } public void setEditable( boolean editable ) { this.editable = editable; } public String getValue() { return this.value; } public void setValue( String value ) { this.value = value; } @Override public String toString() { return getId() + ": " + getValue(); } public String toggleEdit() { setEditable( !isEditable() ); return null; } }
Thanks for any help...
--
pappy