dev@javaserverfaces.java.net

Re: Review: Fix for JSF Portlet issue.

From: Ed Burns <Ed.Burns_at_Sun.COM>
Date: Wed, 13 Oct 2004 06:11:27 -0700

>>>>> On Tue, 12 Oct 2004 13:20:09 -0700, Jayashri Visvanathan <Jayashri.Visvanathan_at_Sun.COM> said:

JV> Hi Ed,
JV> There is no change in the logic related to invoking setProperties,
JV> its same as in old version. We call setProperties() only once, only if

JV> if (null == parentComponent.getAttributes().get(CURRENT_VIEW_ROOT)) evaluates to true.
JV> The only change we are making to fix the portlet issue, is to not use the request scope to look up UIViewRoot. Hope this answers your question.

But there is a change in this diff:

JV> // see if this is the first time this tag instance is trying
JV> // to be bound to the UIViewRoot
JV> - if (null == (parentComponent = (UIComponent)
JV> - pageContext.getAttribute(CURRENT_VIEW_ROOT,
JV> - PageContext.REQUEST_SCOPE))){
JV> - parentComponent = context.getViewRoot();
JV> - pageContext.setAttribute(CURRENT_VIEW_ROOT, parentComponent,
JV> - PageContext.REQUEST_SCOPE);
JV> - // Has this UIViewRoot instance had a tag bound to it
JV> - // before?
JV> - if (null ==
JV> - parentComponent.getAttributes().get(CURRENT_VIEW_ROOT)) {
JV> - // No it hasn't.
JV> -
JV> - // make sure setProperties() and setId() are called
JV> - // once per UIViewRoot instance.

No setProperties() call in the old version.

JV> - if (null != this.id) {
JV> - parentComponent.setId(this.id);
JV> - }
JV> - parentComponent.getAttributes().put(CURRENT_VIEW_ROOT,
JV> - CURRENT_VIEW_ROOT);
JV> - }
JV> - else if (binding == null) {
JV> - setProperties(parentComponent);
JV> - }
JV> + parentComponent = context.getViewRoot();
JV> + // Has this UIViewRoot instance had a tag bound to it
JV> + // before?
JV> + if (null ==
JV> + parentComponent.getAttributes().get(CURRENT_VIEW_ROOT)) {
JV> + // No it hasn't.
JV> +
JV> + // make sure setProperties() and setId() are called
JV> + // once per UIViewRoot instance.
JV> + setProperties(parentComponent);

Look at this---------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

>>
>> Why are we calling setProperties unconditionally here? The old version
>> didn't do this. Why must we do it now? This looks like a bugfix that
>> is orthogonal to the portlet problem, is it not?
>>

Ed

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net