dev@jsf-extensions.java.net

Re: [JSF-EXT] Avatar Status (Jacob, Dan and Craig, please read)

From: Dan Labrecque - Sun Microsystems <Dan.Labrecque_at_Sun.COM>
Date: Tue, 20 Jun 2006 15:43:13 -0400

Ed Burns wrote:
>
> EB> com.sun.faces.lifecycle.RunThru
>
> DL> Can the RunThru header indicate validation without update? I'm wondering
> DL> what will happen to queued, value change events? I'm thinking of the
> DL> scenario where I want to validate a text field value, but not update it
> DL> until the user clicks an OK button, for example.
>
> Yes, it can.
>

Just curious, but what happens to value change events in this scenario?
If components run through validation, but not the update phase, are
value change events still invoked?

> EB> <!-- additional cells omitted -->
> EB> </tr><input type="hidden" name="form:scroller_action"/>
> EB> <input type="hidden" name="form:scroller_curPage"/></table>
> EB>
> EB> <script type='text/javascript'>
> EB> document.forms[0].submit = function() {};
> EB> var a = $('form:subview2').getElementsByTagName('a');
> EB> $A(a).each(function(e) {
> EB> new Faces.Command(e, 'mousedown', { subtrees: 'form:table,form:subview2' });
> EB> });
> EB> </script>
> EB> </div>]]></render>
> EB> <state>
> EB> <![CDATA[j_id3:j_id4]]>
> EB> </state>
> EB> </async-response>
>
> DL> Avatar request? In some cases (e.g., the progress bar component), we
> DL> will need to continuously poll for data without any Javascript event. I
> DL> was thinking that we could use a Dojo subscribe/publish event here, but
> DL> I'm wondering if the API can also generate the request immediately? For
> DL> example:
>
> DL> new Faces.Command(e, null, { subtrees: 'form:table,form:subview2' });
>
> How about using setTimeout() to kick off the Faces.Command requests
> periodically?
>
 Do you mean something like this?

  setTimeout('new Faces.Command(e, null, { subtrees:
'form:table,form:subview2' })', 2)

This would work if null is a valid value; however, I'm just asking if
the Faces.Command needs an event? I just want to make sure we can kick
off Avatar requests without providing an "mousedown" event, for example.

> EB> Another idea is to make the rendering of the response pluggable so
> EB> that one could send the response back in JSON instead of hard
> EB> coded XML. Perhaps Dan Labreque can help with this.
>
> DL> The main thing I'm looking for is to bypass the mechanism which replaces
> DL> HTML. I expect that our components will need to return both XML and
> DL> JSON, but we will not always replace newly rendered HTML. I just need a
> DL> simple hook to process the data from the response myself.
>
> DL> If the response is wrapped in XML, my Javascript function could parse
> DL> out the data, but it's extra processing. With the previous Avatar
> DL> source, the custom UIViewRoot wrapped the output, of each
> DL> avatarZoneRenderer, in XML. However, this forced my component renderers
> DL> to wrap JSON in the same XML format used by the ajaxZoneRenderer.
>
> DL> I'm not really looking for a pluggable rendering solution here, I just
> DL> don't want my response to be wrapped in XML. If I want to return XML, I
> DL> can easily set the response myself in my own renderer. However, I'm just
> DL> looking to set a simple flag indicating that the custom UIViewRoot/life
> DL> cycle should not wrap the response in XML.
>
> Well, that's easy enough to do. We could have another header,
> com.sun.faces.ResponseContentType. If absent, it's XML. If present, it
> sets the content type blindly and lets the renderer do the thing.
>
That would be perfect!
> DL> That said, I'm willing to help if I can. For example, I can take your
> DL> latest source and apply it to our components. Although, I'm not certain
> DL> my last example was useful to you? Want to meet tomorrow afternoon and
> DL> discuss possible solutions?
>
> I'd like to get Adam's issues straightened out first before we talk. Is
> that ok?
>
>
Okay. I'm off the 29th and 30th, anyway.

Thanks,
Dan