myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Volker Weber <users.myfa...@weber-oldenburg.de>
Subject Re: Which Javascript library to use for AJAX components?
Date Tue, 18 Apr 2006 11:42:08 GMT
Hi,

dojo.io.bind is a replacment for prototypes Ajax.Request.

the Ajax.Updater replaces the content of a html element with the
response of a ajax request, including optional evaluating of javascript
content.

e.g

---------- begin html ----------------

<div id="divId" >
  [ any content. e.g. complete tobago sheet]
</div>

<button onclick="replaceDivContent('divId')"> Do ajax request</button>

---------- end html ----------------

---------- begin javascript ----------------

function replaceDivContent(id) {

  var options = {
    method: 'post',
    asynchronous: true,
    parameters: '',
    evalScripts: true
  };

  var div = document.getElementById('id');

  // Tobago.form is the html form element
  var url = Tobago.form.action + "?affectedAjaxComponent="
    + id + '&' + Form.serialize(Tobago.form);

  new Ajax.Updater(container, url, options);
}

---------- end javascript ----------------



Regards,
  Volker


Gerald Müllan wrote:
> Hi Volker,
> 
> Yes, sure. I can not remember the Ajax.Updater functionality exactly,
> but dojo provides a really easy to use Ajax api. I think the
> dojo.io.bind stuff should be the one, you are searching for.
> 
> Just code:
> 
> dojo.io.bind({
>     url: "...",
>     load: function(type, evaldObj){ /* do something */ },
>     mimetype: "text/plain",
>     transport: "XMLHTTPTransport"
> });
> 
> A pretty good intro about dojo.io.bind can be found at:
> 
> http://dojotoolkit.org/docs/intro_to_dojo_io.html
> 
> Hope that helps,
> 
> regards,
> 
> Gerald
> 
> On 4/18/06, Volker Weber <users.myfaces@weber-oldenburg.de> wrote:
> 
>>Hi Gerald,
>>
>>is there a equivalent for Ajax.Updater from prototype.js in dojo?
>>
>>I like to test replacement of prototype.js in tobago, but i don't like
>>to reimplement this.
>>
>>Regards,
>>  Volker
>>
>>
>>Gerald Müllan wrote:
>>
>>>Hi,
>>>
>>>you should use the dojo library in all future components wherever possible.
>>>
>>>We want to completely left out prototype and other js libraries in the future.
>>>
>>>Which component you wanna realize?
>>>
>>>cheers,
>>>
>>>Gerald
>>>
>>>On 4/18/06, sharath reddy <sharathreddy@yahoo.com> wrote:
>>>
>>>
>>>>Hello,
>>>>
>>>>I am planning to develop an AJAX component for
>>>>MyFaces. I looked at the exising components to see
>>>>which Javascript libary they used.
>>>>
>>>>Some components use Dojo. Others use Prototype!
>>>>
>>>>Which one is the standard going 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
>>>
>>
>>--
>>Don't answer to From: address!
>>Mail to this account are droped if not recieved via mailinglist.
>>To contact me direct create the mail address by
>>concatenating my forename to my senders domain.
>>
> 
> 
> 
> --
> Gerald Müllan
> Schelleingasse 2/11
> 1040 Vienna, Austria
> 0043 699 11772506
> Bierbrauen@gmail.com
> 

-- 
Don't answer to From: address!
Mail to this account are droped if not recieved via mailinglist.
To contact me direct create the mail address by
concatenating my forename to my senders domain.

Mime
View raw message