You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Gerald Müllan <bi...@gmail.com> on 2006/04/29 13:59:28 UTC

Re: AJAX functionality in MyFaces

Hi Sharath,

it`s good that you are thinking of some improvements to the myfaces
ajax api, I also
wanted to do some changes to it, but didn`t had time anyway.

The issue that the code inside AjaxDecodePhaseListener is kind of
disordered, lays in the fact that we were experimenting with our ajax
components and in order to achieve a quick
result everyone has put his corresponding component code inside it.

I did this ugly stuff with if ..(component instanceof SuggestAjax)..
in order to get a quickfix
for the problem you mentioned (only xml like responses will work;
special <response> treatment). TableSuggestAjax only works with plain
text/html, therefore i needed this.

So, i completely agree to reorganizing the code.

To my mind,the only ajax components which we have alter to dojo are
the inputAjax ones.
Problem is, I think there is no directly counterpart (like a widget)
to rely on, so there is the need to use dojo`s ajax api and other dojo
packages. Seems to be much work for all the inputAjax components; we
should first concentrate on reordering the api and migrate this step
by step.

What we will need anyway is the UIComponentPerspective stuff,
otherwise we can not be sure to find components which are located
inside dataTables. No further processing could be done. I think it can
not be moved out of the phase listener.

If we rely on our "affectedAjaxComponent" approach (seeking comp and
calling methods on it) we are little bit restricted in coding. The
only real thing we can do, is calling encodeAjax() and decodeAjax()
from the phase listener (like it is now) and moving special handling
to the component. Other special response treatments - like defining a
different response format - could be done in the renderer.

Maybe we can introduce a special wrapper which is aware of handling
the ajax response format and which is treating it like we want to have
it.

Or shall we think of a completely new treatment of ajax components?

cheers,

Gerald


On 4/29/06, sharath reddy <sh...@yahoo.com> wrote:
> Hello,
>
> Martin and I discussed the existing state of the AJAX
> functionality in MyFaces. We came up with some
> suggestions for improvement. Below is a brief
> discussion of how AJAX requests are handled in
> MyFaces, which may be useful to some, followed by our
> comments.
>
> Every component that has Ajax functionality is
> expected to implement the following interface:
>
> public interface AjaxComponent
> {
>     void encodeAjax(FacesContext context) throws
> IOException;
>
>     void decodeAjax(FacesContext context);
>
> }
>
> As can be expected, 'decodeAjax' is reponsible for
> parsing the request and updating the component, and
> 'encodeAjax' generates the response to the browser.
>
> A specialised phase-listener is registered on the
> 'Apply Request Values' phase. The functionality of
> this class is implemented in the 'beforePhase' method.
>
>
> The phase listener searches the input parameters for a
> parameter called 'affectedAjaxComponent'. If found,
> then the value of this parameter is the component id
> of the component that generated the AJAX request. If
> this parameter is not found, the phase listener exits.
>
> The phase listener finds the component and calls the
> methods 'encodeAjax and decodeAjax.
>
> If the parameter 'updateOnly' is found, then only
> encodeAjax is called.
> (This is incorrect. As mentioned previously, updates
> to the component are done in the 'decodeAjax' method.
> I think this should be renamed to 'encodeOnly').
>
> If 'decodeAjax' is called, then the Phase Listener
> also calls the method
> 'facesContext.getViewRoot().processApplication(facesContext)',
> which executes any actions or actionListeners that may
> have been registered in the method 'decodeAjax'.
>
> String updateOnly = (String)
> facesContext.getExternalContext().getRequestParameterMap().get("updateOnly");
> if(updateOnly == null)
> {
> // then decode
> decodeAjax(ajaxComponent, facesContext);
> facesContext.getViewRoot().processApplication(facesContext);
> }
> encodeAjax(ajaxComponent, facesContext);
>
> If server-side state-saving is configured, then the
> state of the view is saved.
>
> context.responseComplete is called.
>
>
> Here are some of the inputs we came up with:
> 1. There are too many special cases in the Phase
> Listener code:
>
> if (component instanceof SuggestAjax) //do something
> if (component instanceof HtmlCommandButtonAjax) ....
> if (ajaxComponent instanceof UIComponentPerspective)
> ...
>
> In our opinion, all this logic should be moved into
> their respective components. The phase listener should
> not be aware of these distinctions.
>
> 2. The responsibility for rendering the response
> should lie entirely with the component. The current
> code does something like this:
>
>      out.print("<?xml version=\"1.0\"?>\n");
>
>      out.print("<response>\n");
>
>      ((AjaxComponent) component).encodeAjax(context);
>
>      out.print("</response>");
>
> Due to this approach, the component-writer has 2
> disadvantages:
> a. He is forced to render an xml response. Other
> options are ruled out.
> b. If he wants to use an XML API (say, JDOM) to render
> the response, he is contrained, as the root element
> 'response' has already been rendered in the output
> stream.
>
> 3. The existing component(s) ? that still use
> Prototype library should be converted to use Dojo.
>
> Obviously the existing components will have to be
> altered concurrently with the changes in the Phase
> Listener, so that they continue working. Anyone have a
> suggestion for the best way to go forward?
>
> Regards,
> Sharath
>
>
>
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>


--
Gerald Müllan
Schelleingasse 2/11
1040 Vienna, Austria
0043 699 11772506
Bierbrauen@gmail.com

Re: AJAX functionality in MyFaces

Posted by Adam Winer <aw...@gmail.com>.
On 5/1/06, Travis Reeder <tr...@gmail.com> wrote:
> I've already implemented something like this in the sandbox, it's the
> <s:listener> tag and it's currently usable on the sandbox inputText and am
> working on making this usable across the board without being intrusive to
> the other components (because I want to be able to update a datatable when
> other form elements change).  If you look at the current inputAjax.jsp, you
> will see the usage and a demo, but looks like this:
>
>            <s:outputText value="#{inputAjaxBean.waitingText2}">
>                 <s:listener on="formText2"/>
>                 <s:listener on="formText2"
> action="javascript:startPulse(this);"/>
>             </s:outputText>
>
> The reason why I didn't do it the ADF way is because it was limited to
> updates only and it was intrusive for the components that need to support it
> (every component would need the partialTriggers attribute).

FWIW, it isn't the case that everyone needs partialTriggers;  it's
just a convenience in lieu of calling APIs on AdfFacesContext
(which could be called from a listener tag, if you wanted).

> Using the
> Listener tag, any number of listeners can be used, they can do different
> actions like calling some other javascript, and the components don't
> necessarily need to know that they are listening or are being listened on
> (in theory anyways).

Where does this listener execute?  What sort of events is it
listening for, and on which tier?  (And perhaps it should be named
less generically than "listener"?)

Thanks,
Adam

>
> On 4/29/06, Ernst Fastl <er...@gmail.com> wrote:
>
> > Although it maybe out of scope of the current discussion, in order
> > to update more than one component with an ajax-request it would also
> > be possible to use something like the partialTriggers-Attribute in
> ADF-Faces
> > in future approaches. The value of this attribute is the ID or IDs of
> > other components.  When those components are updated trough ajax calls
> > the component which has their IDs set in the partialTriggers-Attribute
> > will also be updated. All rendered components in ADF Faces support the
> > partialTriggers attribute.
> >
> > further info is available on:
> >
> >
> http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps|adfcreate|af_appr~html/
> >
> > It maybe to early for that now, but what do you think of this idea in
> principle.
> >
> > regards
> >
> > Ernst
> >
> > On 4/29/06, Gerald Müllan <bi...@gmail.com> wrote:
> > > As far as i know we wanted to update only one component per request
> > > with our actual approach.
> > >
> > > I think we should separate the need of updating the model (like
> > > anywhere) and having an ajax response to show something special
> > > (visualisation etc.) on the client.
> > >
> > > cheers,
> > >
> > > Gerald
> > >
> > > On 4/29/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> > > > Hi!
> > > > > If we rely on our "affectedAjaxComponent" approach (seeking comp and
> > > > > calling methods on it) we are little bit restricted in coding.
> > > > If this mean that we can update only one component per request, then I
> > > > would like to see to at least extends this approach.
> > > >
> > > > Beside the fact that a component would like to update its own
> > > > data/layout/etc I would like to be able to update other components
> too.
> > > >
> > > > Say if you have a button "calculate" this should update the model and
> > > > then update the output of n other components.
> > > > Something like zones in ajaxanywhere (partial page rendering).
> > > >
> > > > Or is this wish out of scope of the current discussion?
> > > >
> > > > Ciao,
> > > > Mario
> > > >
> > > >
> > >
> > >
> > > --
> > > Gerald Müllan
> > > Schelleingasse 2/11
> > > 1040 Vienna, Austria
> > > 0043 699 11772506
> > > Bierbrauen@gmail.com
> > >
> >
>
>

Re: AJAX functionality in MyFaces

Posted by Travis Reeder <tr...@gmail.com>.
I've already implemented something like this in the sandbox, it's the
<s:listener> tag and it's currently usable on the sandbox inputText and am
working on making this usable across the board without being intrusive to
the other components (because I want to be able to update a datatable when
other form elements change).  If you look at the current inputAjax.jsp, you
will see the usage and a demo, but looks like this:

           <s:outputText value="#{inputAjaxBean.waitingText2}">
                <s:listener on="formText2"/>
                <s:listener on="formText2"
action="javascript:startPulse(this);"/>
            </s:outputText>

The reason why I didn't do it the ADF way is because it was limited to
updates only and it was intrusive for the components that need to support it
(every component would need the partialTriggers attribute).  Using the
Listener tag, any number of listeners can be used, they can do different
actions like calling some other javascript, and the components don't
necessarily need to know that they are listening or are being listened on
(in theory anyways).

Regards,
Travis


On 4/29/06, Ernst Fastl <er...@gmail.com> wrote:
>
> Although it maybe out of scope of the current discussion, in order
> to update more than one component with an ajax-request it would also
> be possible to use something like the partialTriggers-Attribute in
> ADF-Faces
> in future approaches. The value of this attribute is the ID or IDs of
> other components.  When those components are updated trough ajax calls
> the component which has their IDs set in the partialTriggers-Attribute
> will also be updated. All rendered components in ADF Faces support the
> partialTriggers attribute.
>
> further info is available on:
>
>
> http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps|adfcreate|af_appr~html/
>
> It maybe to early for that now, but what do you think of this idea in
> principle.
>
> regards
>
> Ernst
>
> On 4/29/06, Gerald Müllan <bi...@gmail.com> wrote:
> > As far as i know we wanted to update only one component per request
> > with our actual approach.
> >
> > I think we should separate the need of updating the model (like
> > anywhere) and having an ajax response to show something special
> > (visualisation etc.) on the client.
> >
> > cheers,
> >
> > Gerald
> >
> > On 4/29/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> > > Hi!
> > > > If we rely on our "affectedAjaxComponent" approach (seeking comp and
> > > > calling methods on it) we are little bit restricted in coding.
> > > If this mean that we can update only one component per request, then I
> > > would like to see to at least extends this approach.
> > >
> > > Beside the fact that a component would like to update its own
> > > data/layout/etc I would like to be able to update other components
> too.
> > >
> > > Say if you have a button "calculate" this should update the model and
> > > then update the output of n other components.
> > > Something like zones in ajaxanywhere (partial page rendering).
> > >
> > > Or is this wish out of scope of the current discussion?
> > >
> > > Ciao,
> > > Mario
> > >
> > >
> >
> >
> > --
> > Gerald Müllan
> > Schelleingasse 2/11
> > 1040 Vienna, Austria
> > 0043 699 11772506
> > Bierbrauen@gmail.com
> >
>

Re: AJAX functionality in MyFaces

Posted by Jacob Hookom <ja...@hookom.net>.
Give me a few days to publish a demo :-)

There are a few parts to it though:

1) A solution for rendering multiple parts of the page at once as 
specified by the client or from java/faces code

2) A generic AJAX event system, instead of 'ajaxXXX(...)' 
hooks/contracts on components

3) Currently exploring automatic JSON integration and DojoComponents


Martin Marinschek wrote:
> There is also one approach shown to me by Jacob. - Hmm, Jacob, can I
> go out and tell about it, or do you want to do that only on J1?
>
> regards,
>
> Martin
>
> On 4/29/06, Ernst Fastl <er...@gmail.com> wrote:
>> Although it maybe out of scope of the current discussion, in order
>> to update more than one component with an ajax-request it would also
>> be possible to use something like the partialTriggers-Attribute in 
>> ADF-Faces
>> in future approaches. The value of this attribute is the ID or IDs of
>> other components.  When those components are updated trough ajax calls
>> the component which has their IDs set in the partialTriggers-Attribute
>> will also be updated. All rendered components in ADF Faces support the
>> partialTriggers attribute.
>>
>> further info is available on:
>>
>> http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps|adfcreate|af_appr~html/ 
>>
>>
>> It maybe to early for that now, but what do you think of this idea in 
>> principle.
>>
>> regards
>>
>> Ernst
>>
>> On 4/29/06, Gerald Müllan <bi...@gmail.com> wrote:
>> > As far as i know we wanted to update only one component per request
>> > with our actual approach.
>> >
>> > I think we should separate the need of updating the model (like
>> > anywhere) and having an ajax response to show something special
>> > (visualisation etc.) on the client.
>> >
>> > cheers,
>> >
>> > Gerald
>> >
>> > On 4/29/06, Mario Ivankovits <ma...@ops.co.at> wrote:
>> > > Hi!
>> > > > If we rely on our "affectedAjaxComponent" approach (seeking 
>> comp and
>> > > > calling methods on it) we are little bit restricted in coding.
>> > > If this mean that we can update only one component per request, 
>> then I
>> > > would like to see to at least extends this approach.
>> > >
>> > > Beside the fact that a component would like to update its own
>> > > data/layout/etc I would like to be able to update other 
>> components too.
>> > >
>> > > Say if you have a button "calculate" this should update the model 
>> and
>> > > then update the output of n other components.
>> > > Something like zones in ajaxanywhere (partial page rendering).
>> > >
>> > > Or is this wish out of scope of the current discussion?
>> > >
>> > > Ciao,
>> > > Mario
>> > >
>> > >
>> >
>> >
>> > --
>> > Gerald Müllan
>> > Schelleingasse 2/11
>> > 1040 Vienna, Austria
>> > 0043 699 11772506
>> > Bierbrauen@gmail.com
>> >
>>
>
>
> -- 
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>


-- 
--------------------------
Sent from my FrankenBerry Wireless Handheld


Re: AJAX functionality in MyFaces

Posted by Martin Marinschek <ma...@gmail.com>.
There is also one approach shown to me by Jacob. - Hmm, Jacob, can I
go out and tell about it, or do you want to do that only on J1?

regards,

Martin

On 4/29/06, Ernst Fastl <er...@gmail.com> wrote:
> Although it maybe out of scope of the current discussion, in order
> to update more than one component with an ajax-request it would also
> be possible to use something like the partialTriggers-Attribute in ADF-Faces
> in future approaches. The value of this attribute is the ID or IDs of
> other components.  When those components are updated trough ajax calls
> the component which has their IDs set in the partialTriggers-Attribute
> will also be updated. All rendered components in ADF Faces support the
> partialTriggers attribute.
>
> further info is available on:
>
> http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps|adfcreate|af_appr~html/
>
> It maybe to early for that now, but what do you think of this idea in principle.
>
> regards
>
> Ernst
>
> On 4/29/06, Gerald Müllan <bi...@gmail.com> wrote:
> > As far as i know we wanted to update only one component per request
> > with our actual approach.
> >
> > I think we should separate the need of updating the model (like
> > anywhere) and having an ajax response to show something special
> > (visualisation etc.) on the client.
> >
> > cheers,
> >
> > Gerald
> >
> > On 4/29/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> > > Hi!
> > > > If we rely on our "affectedAjaxComponent" approach (seeking comp and
> > > > calling methods on it) we are little bit restricted in coding.
> > > If this mean that we can update only one component per request, then I
> > > would like to see to at least extends this approach.
> > >
> > > Beside the fact that a component would like to update its own
> > > data/layout/etc I would like to be able to update other components too.
> > >
> > > Say if you have a button "calculate" this should update the model and
> > > then update the output of n other components.
> > > Something like zones in ajaxanywhere (partial page rendering).
> > >
> > > Or is this wish out of scope of the current discussion?
> > >
> > > Ciao,
> > > Mario
> > >
> > >
> >
> >
> > --
> > Gerald Müllan
> > Schelleingasse 2/11
> > 1040 Vienna, Austria
> > 0043 699 11772506
> > Bierbrauen@gmail.com
> >
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: AJAX functionality in MyFaces

Posted by Ernst Fastl <er...@gmail.com>.
Although it maybe out of scope of the current discussion, in order
to update more than one component with an ajax-request it would also
be possible to use something like the partialTriggers-Attribute in ADF-Faces
in future approaches. The value of this attribute is the ID or IDs of
other components.  When those components are updated trough ajax calls
the component which has their IDs set in the partialTriggers-Attribute
will also be updated. All rendered components in ADF Faces support the
partialTriggers attribute.

further info is available on:

http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.jsf_apps|adfcreate|af_appr~html/

It maybe to early for that now, but what do you think of this idea in principle.

regards

Ernst

On 4/29/06, Gerald Müllan <bi...@gmail.com> wrote:
> As far as i know we wanted to update only one component per request
> with our actual approach.
>
> I think we should separate the need of updating the model (like
> anywhere) and having an ajax response to show something special
> (visualisation etc.) on the client.
>
> cheers,
>
> Gerald
>
> On 4/29/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> > Hi!
> > > If we rely on our "affectedAjaxComponent" approach (seeking comp and
> > > calling methods on it) we are little bit restricted in coding.
> > If this mean that we can update only one component per request, then I
> > would like to see to at least extends this approach.
> >
> > Beside the fact that a component would like to update its own
> > data/layout/etc I would like to be able to update other components too.
> >
> > Say if you have a button "calculate" this should update the model and
> > then update the output of n other components.
> > Something like zones in ajaxanywhere (partial page rendering).
> >
> > Or is this wish out of scope of the current discussion?
> >
> > Ciao,
> > Mario
> >
> >
>
>
> --
> Gerald Müllan
> Schelleingasse 2/11
> 1040 Vienna, Austria
> 0043 699 11772506
> Bierbrauen@gmail.com
>

Re: AJAX functionality in MyFaces

Posted by Jacob Hookom <ja...@hookom.net>.
I like the idea of convetion a lot more with components here-- because 
you aren't directly invoking your business model, you can do more with 
convention without security issues such that all you would have to do is:

// JAVA - on the Renderer
public Object onSuggest(FacesContext faces, UIComponent c) ...

// JAVA - on the Component
public Object onSuggest(FacesContext faces) ...

Then on the client:

new Faces.Event(clientId, "suggest", callback);

That should be it for wiring code and would allow any component any 
number of events it can use with it's client-side or Dojo representation.



Adam Winer wrote:
> The Renderer does certainly need to know that it is handling an
> AJAX request, but any Renderer that is capable of initiating
> an AJAX request would, just like they're already capable of
> detecting events to their components during decode().
>
> -- Adam
>
>
> On 4/29/06, Martin Marinschek <ma...@gmail.com> wrote:
>> The components are delegating the method calls to their corresponding
>> renderers - it's just like with the default lifecycle related methods.
>>
>> One question - how would you propose to handle special cases - e.g. an
>> inputSuggest components doesn't render itself normally on an ajax
>> request, but renders a list of suggested items?
>>
>> regards,
>>
>> Martin
>>
>> On 4/29/06, Adam Winer <aw...@gmail.com> wrote:
>> > Gerald,
>> >
>> > Once you start allowing multiple components to be updated,
>> > *a lot* of possibilities open up.
>> >
>> > My big concern with the approach being recommended here is
>> > that it treats Ajax requests as radically different from all
>> > other requests, which ends up defeating a lot of the benefits
>> > of the JSF lifecycle, and forces components to expose
>> > "too much".
>> >
>> > Why, for instance, do you need special "encodeAjax" or
>> > "decodeAjax" methods on the component?  What if a Renderer -
>> > independently of the component - wishes to add AJAX-style
>> > feedback?
>> >
>> > -- Adam
>> >
>> >
>> >
>> > On 4/29/06, Gerald Müllan <bi...@gmail.com> wrote:
>> > > As far as i know we wanted to update only one component per request
>> > > with our actual approach.
>> > >
>> > > I think we should separate the need of updating the model (like
>> > > anywhere) and having an ajax response to show something special
>> > > (visualisation etc.) on the client.
>> > >
>> > > cheers,
>> > >
>> > > Gerald
>> > >
>> > > On 4/29/06, Mario Ivankovits <ma...@ops.co.at> wrote:
>> > > > Hi!
>> > > > > If we rely on our "affectedAjaxComponent" approach (seeking 
>> comp and
>> > > > > calling methods on it) we are little bit restricted in coding.
>> > > > If this mean that we can update only one component per request, 
>> then I
>> > > > would like to see to at least extends this approach.
>> > > >
>> > > > Beside the fact that a component would like to update its own
>> > > > data/layout/etc I would like to be able to update other 
>> components too.
>> > > >
>> > > > Say if you have a button "calculate" this should update the 
>> model and
>> > > > then update the output of n other components.
>> > > > Something like zones in ajaxanywhere (partial page rendering).
>> > > >
>> > > > Or is this wish out of scope of the current discussion?
>> > > >
>> > > > Ciao,
>> > > > Mario
>> > > >
>> > > >
>> > >
>> > >
>> > > --
>> > > Gerald Müllan
>> > > Schelleingasse 2/11
>> > > 1040 Vienna, Austria
>> > > 0043 699 11772506
>> > > Bierbrauen@gmail.com
>> > >
>> >
>>
>>
>> -- 
>>
>> http://www.irian.at
>>
>> Your JSF powerhouse -
>> JSF Consulting, Development and
>> Courses in English and German
>>
>> Professional Support for Apache MyFaces
>>
>


-- 
--------------------------
Sent from my FrankenBerry Wireless Handheld


Re: AJAX functionality in MyFaces

Posted by Adam Winer <aw...@gmail.com>.
The Renderer does certainly need to know that it is handling an
AJAX request, but any Renderer that is capable of initiating
an AJAX request would, just like they're already capable of
detecting events to their components during decode().

-- Adam


On 4/29/06, Martin Marinschek <ma...@gmail.com> wrote:
> The components are delegating the method calls to their corresponding
> renderers - it's just like with the default lifecycle related methods.
>
> One question - how would you propose to handle special cases - e.g. an
> inputSuggest components doesn't render itself normally on an ajax
> request, but renders a list of suggested items?
>
> regards,
>
> Martin
>
> On 4/29/06, Adam Winer <aw...@gmail.com> wrote:
> > Gerald,
> >
> > Once you start allowing multiple components to be updated,
> > *a lot* of possibilities open up.
> >
> > My big concern with the approach being recommended here is
> > that it treats Ajax requests as radically different from all
> > other requests, which ends up defeating a lot of the benefits
> > of the JSF lifecycle, and forces components to expose
> > "too much".
> >
> > Why, for instance, do you need special "encodeAjax" or
> > "decodeAjax" methods on the component?  What if a Renderer -
> > independently of the component - wishes to add AJAX-style
> > feedback?
> >
> > -- Adam
> >
> >
> >
> > On 4/29/06, Gerald Müllan <bi...@gmail.com> wrote:
> > > As far as i know we wanted to update only one component per request
> > > with our actual approach.
> > >
> > > I think we should separate the need of updating the model (like
> > > anywhere) and having an ajax response to show something special
> > > (visualisation etc.) on the client.
> > >
> > > cheers,
> > >
> > > Gerald
> > >
> > > On 4/29/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> > > > Hi!
> > > > > If we rely on our "affectedAjaxComponent" approach (seeking comp and
> > > > > calling methods on it) we are little bit restricted in coding.
> > > > If this mean that we can update only one component per request, then I
> > > > would like to see to at least extends this approach.
> > > >
> > > > Beside the fact that a component would like to update its own
> > > > data/layout/etc I would like to be able to update other components too.
> > > >
> > > > Say if you have a button "calculate" this should update the model and
> > > > then update the output of n other components.
> > > > Something like zones in ajaxanywhere (partial page rendering).
> > > >
> > > > Or is this wish out of scope of the current discussion?
> > > >
> > > > Ciao,
> > > > Mario
> > > >
> > > >
> > >
> > >
> > > --
> > > Gerald Müllan
> > > Schelleingasse 2/11
> > > 1040 Vienna, Austria
> > > 0043 699 11772506
> > > Bierbrauen@gmail.com
> > >
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>

Re: AJAX functionality in MyFaces

Posted by Martin Marinschek <ma...@gmail.com>.
The components are delegating the method calls to their corresponding
renderers - it's just like with the default lifecycle related methods.

One question - how would you propose to handle special cases - e.g. an
inputSuggest components doesn't render itself normally on an ajax
request, but renders a list of suggested items?

regards,

Martin

On 4/29/06, Adam Winer <aw...@gmail.com> wrote:
> Gerald,
>
> Once you start allowing multiple components to be updated,
> *a lot* of possibilities open up.
>
> My big concern with the approach being recommended here is
> that it treats Ajax requests as radically different from all
> other requests, which ends up defeating a lot of the benefits
> of the JSF lifecycle, and forces components to expose
> "too much".
>
> Why, for instance, do you need special "encodeAjax" or
> "decodeAjax" methods on the component?  What if a Renderer -
> independently of the component - wishes to add AJAX-style
> feedback?
>
> -- Adam
>
>
>
> On 4/29/06, Gerald Müllan <bi...@gmail.com> wrote:
> > As far as i know we wanted to update only one component per request
> > with our actual approach.
> >
> > I think we should separate the need of updating the model (like
> > anywhere) and having an ajax response to show something special
> > (visualisation etc.) on the client.
> >
> > cheers,
> >
> > Gerald
> >
> > On 4/29/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> > > Hi!
> > > > If we rely on our "affectedAjaxComponent" approach (seeking comp and
> > > > calling methods on it) we are little bit restricted in coding.
> > > If this mean that we can update only one component per request, then I
> > > would like to see to at least extends this approach.
> > >
> > > Beside the fact that a component would like to update its own
> > > data/layout/etc I would like to be able to update other components too.
> > >
> > > Say if you have a button "calculate" this should update the model and
> > > then update the output of n other components.
> > > Something like zones in ajaxanywhere (partial page rendering).
> > >
> > > Or is this wish out of scope of the current discussion?
> > >
> > > Ciao,
> > > Mario
> > >
> > >
> >
> >
> > --
> > Gerald Müllan
> > Schelleingasse 2/11
> > 1040 Vienna, Austria
> > 0043 699 11772506
> > Bierbrauen@gmail.com
> >
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: AJAX functionality in MyFaces

Posted by Adam Winer <aw...@gmail.com>.
Gerald,

Once you start allowing multiple components to be updated,
*a lot* of possibilities open up.

My big concern with the approach being recommended here is
that it treats Ajax requests as radically different from all
other requests, which ends up defeating a lot of the benefits
of the JSF lifecycle, and forces components to expose
"too much".

Why, for instance, do you need special "encodeAjax" or
"decodeAjax" methods on the component?  What if a Renderer -
independently of the component - wishes to add AJAX-style
feedback?

-- Adam



On 4/29/06, Gerald Müllan <bi...@gmail.com> wrote:
> As far as i know we wanted to update only one component per request
> with our actual approach.
>
> I think we should separate the need of updating the model (like
> anywhere) and having an ajax response to show something special
> (visualisation etc.) on the client.
>
> cheers,
>
> Gerald
>
> On 4/29/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> > Hi!
> > > If we rely on our "affectedAjaxComponent" approach (seeking comp and
> > > calling methods on it) we are little bit restricted in coding.
> > If this mean that we can update only one component per request, then I
> > would like to see to at least extends this approach.
> >
> > Beside the fact that a component would like to update its own
> > data/layout/etc I would like to be able to update other components too.
> >
> > Say if you have a button "calculate" this should update the model and
> > then update the output of n other components.
> > Something like zones in ajaxanywhere (partial page rendering).
> >
> > Or is this wish out of scope of the current discussion?
> >
> > Ciao,
> > Mario
> >
> >
>
>
> --
> Gerald Müllan
> Schelleingasse 2/11
> 1040 Vienna, Austria
> 0043 699 11772506
> Bierbrauen@gmail.com
>

Re: AJAX functionality in MyFaces

Posted by Gerald Müllan <bi...@gmail.com>.
As far as i know we wanted to update only one component per request
with our actual approach.

I think we should separate the need of updating the model (like
anywhere) and having an ajax response to show something special
(visualisation etc.) on the client.

cheers,

Gerald

On 4/29/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> Hi!
> > If we rely on our "affectedAjaxComponent" approach (seeking comp and
> > calling methods on it) we are little bit restricted in coding.
> If this mean that we can update only one component per request, then I
> would like to see to at least extends this approach.
>
> Beside the fact that a component would like to update its own
> data/layout/etc I would like to be able to update other components too.
>
> Say if you have a button "calculate" this should update the model and
> then update the output of n other components.
> Something like zones in ajaxanywhere (partial page rendering).
>
> Or is this wish out of scope of the current discussion?
>
> Ciao,
> Mario
>
>


--
Gerald Müllan
Schelleingasse 2/11
1040 Vienna, Austria
0043 699 11772506
Bierbrauen@gmail.com

Re: AJAX functionality in MyFaces

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
> If we rely on our "affectedAjaxComponent" approach (seeking comp and
> calling methods on it) we are little bit restricted in coding.
If this mean that we can update only one component per request, then I
would like to see to at least extends this approach.

Beside the fact that a component would like to update its own
data/layout/etc I would like to be able to update other components too.

Say if you have a button "calculate" this should update the model and
then update the output of n other components.
Something like zones in ajaxanywhere (partial page rendering).

Or is this wish out of scope of the current discussion?

Ciao,
Mario