You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by sharath reddy <sh...@yahoo.com> on 2006/04/17 14:19:26 UTC

JIRA Issues TOMAHAWK-245 and 246

The issues pertain to exceptions while accessing the
Simple examples for Tree and PanelStack.

Both these issues are related to the Tree component
(the older one).

HtmlTreeImageCommandLinKRenderer extends
HtmlLinkRendererBase, and calls the method
'super.renderCommandLinkStart', which in turn
internally calls 'renderJavaScriptAnchorStart'.

The code in this method is as follows:
FormInfo formInfo = findNestingForm(component,
facesContext);
if (formInfo == null)
{
  throw new IllegalArgumentException("Component " +
clientId + " must be embedded in an form");
}

This is the exception that shows up in the stack
trace. 

The issues can be fixed simply, by replacing:

FormInfo formInfo = findNestingForm(component,
facesContext);

with:

FormInfo formInfo =
DummyFormUtils.findNestingForm(component,
facesContext);

The difference is that if the second method fails to
find an enclosing form, it sets a parameter informing
MyFaces to render the dummy form, and returns the
dummy form information. Many Tomahawk components
already do this check and set the necessary parameter.


HOWEVER:
The same method is also used by the core components
(HtmlCommandLink, etc) and I am assuming that they
should have no knowledge of the MyFaces dummy form.

So is it OK to go ahead with this change, or is there
a better solution?

Regards,
Sharath

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com