public class Main extends WOComponent {
private String text1 = null, text2 = "foo", text3 = "bar";
public Main(WOContext context) {
super(context);
System.out.println("Main instanciated");
}
public WOActionResults submitAction() {
System.out.println("Main.submitAction, formValueKeys: " + context().request().formValueKeys());
return context().page();
}
public void setText1(String text1) {
System.out.println("Main.setText1(" + this.text1 + " -> " + text1 + ")");
this.text1 = text1;
}
public String text1() {
return text1;
}
public void setText2(String text2) {
System.out.println("Main.setText2(" + this.text2 + " -> " + text2 + ")");
// new RuntimeException("trace").printStackTrace(System.out);
this.text2 = text2;
}
public String text2() {
return text2;
}
public void setText3(String text3) {
System.out.println("Main.setText3(" + this.text3 + " -> " + text3 + ")");
// new RuntimeException("trace").printStackTrace(System.out);
this.text3 = text3;
}
public String text3() {
return text3;
}
}
WOTextFieldWithWorkaround.java:
public class WOTextFieldWithWorkaround extends WOTextField {
public WOTextFieldWithWorkaround(String arg0, NSDictionary arg1, WOElement arg2) {
super(arg0, arg1, arg2);
}
@Override
public void takeValuesFromRequest(WORequest worequest, WOContext wocontext) {
String name = nameInContext(wocontext, wocontext.component());
if (worequest.formValueKeys().containsObject(name)) {
super.takeValuesFromRequest(worequest, wocontext);
}
}
}