Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Custom Fields FormData(Custom Fields FormData - How do I generate it?)
Custom Fields FormData [message #1753015] Wed, 01 February 2017 06:59 Go to next message
Matt G.. is currently offline Matt G..Friend
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;
			}
		};
	}

Re: Custom Fields FormData [message #1753248 is a reply to message #1753015] Fri, 03 February 2017 02:25 Go to previous message
Matt G.. is currently offline Matt G..Friend
Messages: 2
Registered: February 2017
Junior Member
Well I figured it out. I wanted the built in way to try and stay update-proof, and I believe I found it. This is working.

public class FormsListService implements IFormsListService {

	@Override
	public FormsListTablePageData getFormsListTableData(SearchFilter filter) {
		FormsListTablePageData pageData = new FormsListTablePageData();
		
		Object[][] rawPageData = SQL.select(DerbySql.TablePageSelect("FORMS"));              
                          //DerbySql generates an SQL statement to select the whole table
		
		for (int i = 0; i < rawPageData.length; i++) {
			FormsListTableRowData r = pageData.addRow();
                                                                                           //set static columns
			r.setFormid((String) rawPageData[i][0]); 
			r.setProject((String) rawPageData[i][1]);
			r.setFormname((String) rawPageData[i][2]);
			
			for (int j = 3; j < rawPageData[i].length; j++) {                    //set custom columns
                                 r.setCustomValue(DerbySql.getColumns("FORMS").get(j), rawPageData[i][j]);   
			}
		}
				
		return pageData;
	}
}
Previous Topic:[NEON] Table page with detail view
Next Topic:[oxygen] Search Form Behavior
Goto Forum:
  


Current Time: Sat May 27 15:42:10 GMT 2017

Powered by FUDForum. Page generated in 0.03729 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software