template editCurrent( show: Placeholder ) {
  request var editing := false
  placeholder edit {
    form {
      boolStateHelper( editing )
      if( ! editing ){
        submitlink action{ editing := true; replace( edit ); }{ "edit " }
      }
      else {
        input( config.technicalInterests )
        submit action{ editing := false; replace( edit ); replace( show ); } { "save" }
      }
    }
  }
}

template boolStateHelper( b: ref Bool ){
  <input type  = "hidden"
         name  = id
         value = b />
  databind {
    b := getRequestParameter( id ) == "true";
  }
}

Submitted by Danny Groenewegen on 30 March 2022 at 15:59

Log in to post comments