dev@javaserverfaces.java.net

Re: Review: Fix for JSF Portlet issue.

From: Jayashri Visvanathan <Jayashri.Visvanathan_at_Sun.COM>
Date: Wed, 13 Oct 2004 09:52:41 -0700

Hi Ed,
   Please have a look at my orginial diffs, The old version does have a
call to setProperties. Here it is

if (null ==
- parentComponent.getAttributes().get(CURRENT_VIEW_ROOT)) {
- // No it hasn't.
-
- // make sure setProperties() and setId() are called
- // once per UIViewRoot instance.
- setProperties(parentComponent);
- if (null != this.id) {


Thanks
-Jayashri

Ed Burns wrote:

>>>>>>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
>
>
>


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