AVIO Consulting

ADF Blank Input Form

Mar 5, 2013 | ADF

Every process needs an initiator, these come in all sorts of possibilities.  One of the most common is an Input Form.  An end user will have to fill out a form to initiate the process.  The problem with BPM is that you don’t want to have to create an instance until the actual form is submitted.  One option is to build an ADF form that is available to anyone, and have that initiate the process.

Once you get your business components detailed, and the page designed, there a small trick to create a blank entry for the user to input.  ADF is designed such that it displays the values from within a database (or other data source).  The problem here is we don’t want to display these values, we want to input blank ones.

The trick that I’ve learned to assist ADF in creating a blank form is to initialize your view objects and create a blank row when they get instantiated. 

private boolean initialized = false; . . . protected void executeQueryForCollection(Object qc, Object[] params, int noUserParams) { super.executeQueryForCollection(qc, params, noUserParams); if(!initialized){ initFirstRow(); initialized=true; } } private void initFirstRow(){ Row r = this.createRow(); this.insertRow(r); }


Now when the page loads, all the fields are blank and the user can enter their data and submit as needed!