pp additionsbeispiel; import Webapp; import HTMLDocument; ElementTree BaueFormular() { formular = addLocalForm(anonymousBlock); felder = addFieldset(formular,"Addition von zwei Zahlen"); eingabefeld1 = addLabelledInput(felder, "Erste Zahl:", InputText, "erstezahl", "", 3); eingabefeld2 = addLabelledInput(felder, "Zweite Zahl:", InputText, "zweitezahl", "", 3); submit = addLocalControlInput(felder,"Addiere!",OnAddiere,"Addition"); return formular; } HTMLDocument webmain() { doc = new(HTML4Strict, "Additionsbeispiel"); result = runHandler(@BaueFormular); appendExisting(doc.body,result); return doc; } ElementTree OnAddiere(String message) { if (incomingExists("erstezahl",DataPost) && incomingExists("zweitezahl",DataPost)) { ergebnis= Int(incomingValue("erstezahl",DataPost)) + Int(incomingValue("zweitezahl",DataPost)); return addParagraph(anonymousBlock,"Ergebnis:"+String(ergebnis)); } else { return addParagraph(anonymousBlock, "Ein Fehler ist aufgetreten"); } }