Thanks very much for the answer, very clear and simple.
We'll try it today.

Regards,
Jérôme
|----------->
|           |
|           |
|           |
|           |
|           |
|----------->
  
>--------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                                               |
  |                                                                             
                                                               |
  |  Message de : Bruce Porteous <rbp28...@gmail.com>                           
                                                               |
  |                        14/07/2011 09:21                                     
                                                               |
  |                                                                             
                                                               |
  |                                                                             
                                                               |
  |                                                                             
                                                               |
  |                                                                             
                                                               |
  |                                                                             
                                                               |
  |                                Veuillez répondre à "Jetspeed Users List" 
<jetspeed-user@portals.apache.org>                                |
  |                                                                             
                                                               |
  |                                                                             
                                                               |
  |                                                                             
                                                               |
  |                                                                             
                                                               |
  |                                                                             
                                                               |
  |                                                                             
                                                               |
  |                                                                             
                                                               |
  |                                                                             
                                                           Pour|
  |           Jetspeed Users List <jetspeed-user@portals.apache.org>            
                                                               |
  |                                                                             
                                                          Copie|
  |                                                                             
                                                               |
  |                                                                             
                                                          Objet|
  |           Re: Asynchronous field in portlet.                                
                                                               |
  |                                                                             
                                                               |
  
>--------------------------------------------------------------------------------------------------------------------------------------------|




You don't need another portlet -I believe the "proper" way to do what you
want is to use AJAX like you have been trying to do with option 2 but use
serveResource on your portlet to serve the AJAX calls.  Assuming you
subclass GenericPortlet then the responsibilities are something like:

*doView:*  Write the html framework of your portlet containing an empty div
where AJAX can put the content.  You need to give that div a namespaced id
e.g.
String id = response.getNamespace()+"outer";
writer.println("<div id=\"" + id + "\">");

doView also needs to start the JavaScript.  The JavaScript needs to be
given
the resourceURL (for the AJAX callbacks) and the id above (so it knows
which
piece of html to update).  e.g.
writer.write("<script type=\"text/javascript\">");
ResourceURL url = response.createResourceURL();
writer.write("window.setInterval(function(){updateContent('" +
url.toString() +"','" + id + "');},5000,'JavaScript');");
writer.write("</script>");

*serveResource:* return the html or XML to provide the information your
javascript needs to update its window.

2011/7/8 Roberto Rossi <roberto.ro...@cone.it>

> Take a look at this thread:
>
> http://markmail.org/message/**n666fhqhnlgcr7sx<
http://markmail.org/message/n666fhqhnlgcr7sx>
>
> You can invoke javascript AJAX code to retrieve content from another
> portlet.
> Hope this can help.
>
> ROb
>
> --
> *Roberto Rossi
> Cone consulting *
> *Marketing for a digital era*
> Via Sandro Totti 7A - 60131 Ancona
> Tel 071 2864 002
> Fax 071 2917 769
> eMail roberto.ro...@cone.it <mailto:roberto.ro...@cone.it>
> Web www.cone.it <http://www.cone.it/>
>
> Le informazioni contenute nel presente documento e relativi allegati sono
> riservate e destinate ad uso esclusivo del soggetto indicato come
> destinatario. La diffusione/distribuzione impropria di tale documento o
> qualsiasi utilizzo illecito dei dati in esso contenuti sono proibiti
> (articolo 616 codice penale e decreto legislativo 30 giugno 2003, n.
196).
> Se avete ricevuto questo documento per errore, siete pregati di
distruggerlo
> e, possibilmente, di volerne dare notizia al mittente.
>



Exposition  Enluminures en terre d?Islam entre abstraction et figuration  - 
jusqu'au 25 septembre 2011 - BnF - Richelieu / Galerie Mansart Avant 
d'imprimer, pensez à l'environnement. 
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscr...@portals.apache.org
For additional commands, e-mail: jetspeed-user-h...@portals.apache.org

Reply via email to