The following test illustrates the problem and is added as succeed-web test ( …/test/succeed-web/ajax-dynamic-replace-ref-var-elements-issue.app ).

The plain:-output will update correctly, while the wrapped decorated:-output gets updated with the outdated initial string "old".

	  define page root(){    
	    var someString := "old";
	    
	    placeholder "MYPH" { showString( someString ) }
	    inputTemplate( someString )
	  }
	  
	  template inputTemplate( stringRef : Ref<String>){
	    var i := ""
	    form{  input(i)[onkeyup=update(), class="input1"] }    
	    action update(){ stringRef := i; replace("MYPH"); }
	  }
	  
	  template showString( str : String ){
	    decorate { output(str) }
	    "plain: " output(str)
	  }
	  
	  ajax template decorate() {
	    <h1> "decorated: " elements </h1>    
	  }
	    
	  test {
	    var d : WebDriver := getFirefoxDriver();
	    d.get(navigate(root()));
	    sleep(2000);
	    assert(d.getPageSource().contains("decorated: old"));
	    var i1 : WebElement := d.findElement(SelectBy.className("input1"));
	    i1.sendKeys("new");
	    sleep(2000);
	    assert(d.getPageSource().contains("decorated: new"));
	  }
Submitted by Elmer van Chastelet on 13 May 2013 at 14:53

On 19 March 2014 at 14:38 Danny Groenewegen commented:

r5887


On 19 March 2014 at 14:38 Danny Groenewegen closed this issue.

Log in to post comments