ajaxtemplate editableString(x : Ref<String>) {
  placeholder showString showString(x)
}

ajaxtemplate showString(x : Ref<String>) {
  action edit(){ replace(showString, editString(x)); }
  output(x) " "
  submitlink edit() { "[edit]" }
}

ajaxtemplate editString(x : Ref<String>) {
  action save() { 
    replace(showString, showString(x)); 
  }
  action cancel() { replace(showString, showString(x)); }
  form{ 
    input(x) 
    submit save() { "Save" } 
  }
  submit cancel() { "Cancel" }
}

entity Project{
  name : String
}
var p := Project{}

page root(){
  var s := ""
  editableString(s) // error
  editableString(p.name) // ok
}
Submitted by Danny Groenewegen on 20 December 2013 at 13:56

Log in to post comments