vaadin 7.1+scala: how to perform an asynchronous call?

hello

I would like to use vaadin 7 + scala in order to display a page in which there is a label(with a default text), and a button.When one clicks the button, the text of the label changes. Initially the click event of the button has for purpose to call a method that makes a long time to execute(it’s a database datas retrieving). I thought the problem came from the long time of the method, but I saw that even without the database query there was an error.

here is some code:
the page:

package com.example.scaladinchat

import com.github.nscala_time.time.Imports._
import vaadin.scala.UI
import vaadin.scala.VerticalLayout
import vaadin.scala.Label
import vaadin.scala.server.ScaladinRequest
import vaadin.scala.Button
import metier.Objets.Rdv
import models.{oracle => myOracle}



class N02Parameters extends UI with myOracle with LabelUpdater{ app =>

  val l=Label("zigouigoui")
 
  def updateLabel(string:String){
    
    access{
        l.value=string
    }
    
  }
 
 
 
  override def init(request: ScaladinRequest) {
    
    def moi=this
    content = new VerticalLayout {

      
      add(l)
     
      val b=Button("Click me!")
      b.clickListeners+= {e=>
          val manager=new OracleManager
          manager.fetchAndUpdateDataWith(moi)
      }
      add(b)
      
      
      
    }
  }

}

a trait:

package com.example.scaladinchat

trait LabelUpdater {

  def updateLabel(string:String)
 
}
[/code]the core class[code]
package com.example.scaladinchat

import com.github.nscala_time.time.Imports._
import metier.Objets.Rdv
import models.{oracle => myOracle}


class OracleManager extends myOracle{

  def grab_rdv:List[Rdv]
={
        //oracle_litRDVs((DateTime.tomorrow.plusDays(1)).toDate(), (DateTime.tomorrow.plusDays(3)).toDate())
    Nil
  }
 
  def fetchAndUpdateDataWith(lu : LabelUpdater){
    
    val listeOracle=grab_rdv
    //lu.updateLabel(listeOracle.size.toString)
    lu.updateLabel("abc")
  }
 
 
}

this code comes from
https://vaadin.com/blog/-/blogs/anticipating-7-1-0-server-push
.
can you help me?

thanks,

olivier SAINT-EVE.

I forgot to give you the error message:

Communication problem

Take note of any unsaved data, and click here to continue.(SyntaxError) stack: Ica@http://localhost:8080/N02:330 HR@http://localhost:8080/N02:315 _.Sc@http://localhost:8080/N02:338 _.Qc@http://localhost:8080/N02:123 hH/a.onreadystatechange<@http://localhost:8080/N02:299 pu/<@http://localhost:8080/N02:1957 fileName: http://localhost:8080/N02 lineNumber: 331 columnNumber: 0: syntax error - Original JSON-text: html> 

Do you have enabled push features in scaladin configuration? Do you add push dependency?

vaadin-push is added to the sbt dependencies, but I have not modified the scaladin configuration.
Do you have an example?
thanks

ok, I 've seen part of the vaadin book and here is my web.xml:

[code]

<?xml version="1.0" encoding="UTF-8"?>

<web-app id=“VaadinScala” version=“2.4”
xmlns=“http://java.sun.com/xml/ns/j2ee” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd>

Scaladin Chat


Vaadin production mode
productionMode
false


Scaladin Chat
vaadin.scala.server.ScaladinServlet

ScaladinUI
com.example.scaladinchat.ScaladinChatUI



Scaladin Chat
/N00

<servlet>
    <servlet-name>N01</servlet-name>
    <servlet-class>vaadin.scala.server.ScaladinServlet</servlet-class>
    <init-param>
        <param-name>ScaladinUI</param-name>
        <param-value>com.example.scaladinchat.N01createBasicApp</param-value>
    </init-param>
</servlet>
<servlet-mapping>
    <servlet-name>N01</servlet-name>
    <url-pattern>/N01</url-pattern>
</servlet-mapping>

<servlet>
    <servlet-name>N02</servlet-name>
    <servlet-class>vaadin.scala.server.ScaladinServlet</servlet-class>
    <init-param>
        <param-name>ScaladinUI</param-name>
        <param-value>com.example.scaladinchat.N02Parameters</param-value>
    </init-param>
    <init-param>
        <param-name>pushmode</param-name>
        <param-value>automatic</param-value>
    </init-param>
    <async-supported>true</async-supported>
</servlet>
<servlet-mapping>
    <servlet-name>N02</servlet-name>
    <url-pattern>/N02</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>N01</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>N01</servlet-name>
    <url-pattern>VAADIN/*</url-pattern>
</servlet-mapping>
[/code]it's a mix because I have v2.4 of the part "WebApp_ID"/"VaadinScala" (I kept v2.4 instead of 3.0) and in the servlet I added the push configuration. Should I use WebApp_ID instead of VaadinScala?