Custom Fields FormData [message #1753015] |
Wed, 01 February 2017 06:59 |
Matt G.. Messages: 2 Registered: February 2017 |
Junior Member |
|
|
Hi,
My scout app's goal is to let users build a database of questions to then be asked on a form. I want them to be able to add new ones, edit, and delete the questions at runtime. So 2 forms, one for the questions & assoc tablePage, and one "live" form. This is a simple proof of concept.
The plan is to generate the "live" form fields and associated tablePage columns from the list of questions. However, it seems formdata and tabledata are generated pre-runtime. I am thus unable to get my sql bind bases to recognize custom fields and columns.
The class name of the anonymous class I'm creating ends up being "...$MainBox$1". From what I have observed, that fact renders my overriding efforts null && void. I have looked through a ton of the super, super super, even more super super class methods and variables and I'm at a loss as to what else I can set and how. As far as I can tell, trying to change the class name of the anonymous class would be some kind of post-compile hack if at all possible. Not into that.
The tablePage is currently set up with regular old columns, and the database is pre-populated. It shows up just fine, but the app hangs when attempting to open the form to edit a row.
"Cannot find output for 'ValueOutputToken[Prompt parsed ':Prompt', replaced ':Prompt' into]' in bind base."
I've seen this error before with typos in the field name. But in this case it is because the formdata doesn't have methods to access this field. Any ideas?
Anything would be useful. Thanks.
@Override
protected void injectFieldsInternal(OrderedCollection<IFormField> fieldList) {
fieldList.addLast(createCustomField("Prompt"));
}
//figured I'd try but I'm pretty sure this @FormData did nothing
@FormData
private IFormField createCustomField(String fieldName) {
return new AbstractStringField() {
@Override
public String classId() { //This method never gets called
return fieldName; //Why?
}
@Override
protected String getConfiguredLabel() {
return fieldName;
}
@Override
protected boolean getConfiguredVisible() {
return false;
}
};
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.03019 seconds