users@woodstock.java.net

Re: Asynchroneous Refresh: different behavior between build 14 and build 15

From: Dan Labrecque <Dan.Labrecque_at_Sun.COM>
Date: Tue, 18 Dec 2007 13:26:17 -0500

Feel free. We had planned to integrate the ajaxTrandaction component
from Visual Web Pack. This component supports the multiple refresh
feature you're looking for, similar to the ajaxZone component of JSF
Extensions.

Dan

Rasha wrote:
> Hello Dan,
> Is it possible to open an RFE for having a function that does one submit
> with multiple refresh (in a single request) ?
> I think that this is the behavior that most developers would be interested
> in. In most cases, you want to do one action that has effect on multiple
> components on your web page, and not the other way around.
>
> Note that I am asking for this because doing this in a twisted way (using
> the ajaxZone and fireAjaxTransaction ) seem to be throwing exceptions with
> the woodstock components especially in builds 15 and build 4.1.1.
>
> Thanks
>
>
> Dan Labrecque wrote:
>
>> The refresh function is intended to update only one widget; however, you
>> can use this to submit multiple component values. If you want to refresh
>> multiple widgets at the same time, you could continue to use the
>> DynaFaces.fireAjaxTransaction function. However, the ajaxZone tag may be
>> easier to use -- both are provided by JSF Extensions. There is also an
>> ajaxTransaction component available in Netbeans Visual Web Pack, also
>> based on JSF Extensions.
>>
>>
>> https://jsf-extensions.dev.java.net/nonav/mvn/ajax/tlddocs/jsfExt/ajaxZone.html
>>
>> Dan
>>
>> Rasha wrote:
>>
>>> Hello Dan,
>>> Clarification on why I am using fireAjaxTransaction and not refresh
>>> feature.
>>>
>>> In a typical case where I want to submit one component and refresh
>>> multiple
>>> one.
>>> If I register to a webui.suntheme.widget.textField.event.submit.endTopic
>>> and
>>> make all components that need to get refreshed call the refresh function,
>>> I
>>> will be generating x + 1 number of requests to the server, where x is the
>>> number of components to refresh.
>>> This is obvisouly an overhead, especially when the fireAjaxTransaction
>>> allows me to do the refresh in a single request to the server.
>>> Moreover: the table component does not expose the refresh API, so I
>>> cannot
>>> asynchronsouly update it. Which I was able to do with fireAjaxTransation.
>>>
>>>
>>> Am I missing something? is there a way I can use on ajax call to update
>>> all
>>> the components I want in a single request?
>>>
>>> PS: this is a code snippet (i took your woodstock example of validation
>>> and
>>> modified it a bit for demonstration purpose):
>>> <webuijsf:script type="text/javascript">
>>> function TextfieldListener(srcID) {
>>> this.srcID = srcID;
>>> }
>>>
>>> function TextfieldNotify(props) {
>>> // Ensure we have the correct event.
>>>
>>> (props.id != this.srcID) { return; }
>>>
>>> //this is egenrating 3 different requests
>>> document.getElementById('txtName').refresh();
>>> document.getElementById('txtToken').refresh();
>>> document.getElementById('txtSchool').refresh();
>>> }
>>> TextfieldListener.prototype.notify = TextfieldNotify;
>>>
>>> function init() {
>>> // Subscribe to validation event for credit card number.
>>> var listener = new
>>> TextfieldListener("sessionForm:content:sheet:general:generalInfo:txtID");
>>> dojo.event.topic.subscribe(
>>> webui.suntheme.widget.textField.event.submit.endTopic,
>>> listener, listener.notify);
>>>
>>> }
>>> </webuijsf:script>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Dan Labrecque wrote:
>>>
>>>
>>>> I'm not sure how you're using the fireAjaxTransaction function of JSF
>>>> Extensions. However, this is typically used to render a component
>>>> server-side and completely replace previously existing HTML elements.
>>>> The Woodstock refresh feature also uses fireAjaxTransaction, but only to
>>>> obtain new widget properties. The component is not rendered again, but
>>>> selectively updated client-side. If you're not using the Woodstock
>>>> refresh feature, I'm not certain we can help you. However, perhaps you
>>>> can explain how you're updating widgets via fireAjaxTransaction? You
>>>> might also try your question on users_at_jsf-extensions.dev.java.net.
>>>>
>>>> Dan
>>>>
>>>> Rasha wrote:
>>>>
>>>>
>>>>> Hello,
>>>>> I just upgraded to build 15, and I noticed a difference in the behavior
>>>>> of
>>>>> components when refreshing asynchroneously the components.
>>>>> In build 15, the components being refreshed disappear for few seconds
>>>>> from
>>>>> the page and then are redrawn, which is noticeable by the user, and we
>>>>> do
>>>>> not want this behavior.
>>>>> In build 14, the components being refreshed do not disappear, and for
>>>>> the
>>>>> end user it seems that only the text values have changed. Which is the
>>>>> correct behavior.
>>>>>
>>>>> Note that I am using fireAjaxTransaction method to aynchroneously
>>>>> submit
>>>>> and
>>>>> refresh my components. And not refresh() and submit() functions.
>>>>>
>>>>> Is there any particular reason for this difference in the behavior, and
>>>>> if
>>>>> so, is there a way we can make components behave as in build 14?
>>>>>
>>>>> Thanks
>>>>> Rasha
>>>>>
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe_at_woodstock.dev.java.net
>>>> For additional commands, e-mail: users-help_at_woodstock.dev.java.net
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>