Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
Hi,
I am just evaluating joget (among others) - and I find it pretty much.
I have two issues/questions regarding the grid element in forms:
- Can the restriction to 5 columns lifted to 10 or 15?
- (How) is it possible to set initial values into the grid (i.e. populating grid cells with values from "outside")?
I would like to implement some order form processing where initial data is coming from an external system.
Kind regards,
Hans
6 Comments
Owen Ong
Hi Hans,
-The current implementation had been fixed. You can change it at the coding level if you wish.
-You can set the initial values only by javascript. Please refer to this page Sample Custom JavaScript in Form Builder for more information.
Regards,
Owen
Hans Pointner
Hi Owen,
can you give me some hints where in the code I can find grid related programming?
I just found a first place in the formbuilder index.jsp where the number of columns is selected.
Where are the procedures for saving resp. filling the grid at run-time?
And do you see any chance to mix up read-only and editable grid cells (I want to display item information and let just enter related quantities)?
Kind regards,
Hans
Owen Ong
Hi Hans,
You can actually add more columns and input types to the grid by modifying the gridSave() & changeColumn() javascript function in the formbuilder index.jsp
jack
Hi Owen,
In formbuilder index.jsp, i added some other input types to the grid,
such as radiobutton:
In gridSave():
case 'radio':
grid.addColumn(new RadioButton());
In changeColumn():
baseString +='<option value="radio"><fmt:message key="formbuilder.radio"/></option>;
when build a form by grid, it works normbly,
but when preview the form, the radiobutton is null.
what is the problem?
Regards.
Hugo
Hi there,
If you find that by modifying the coding may spell too much of trouble to you or if your form is complicated, you may consider using external form.
Here's a bit of read up you can do. Sample External Form Integration
Good luck!
Vlad
Ok, so starting from the problem "filling my grid with data from the database" I reached this place. Unfortunately thare was nothing usefull, so I started my own "research".
So basically when you put a grid on a form, in the database tabel the framework creates some columns. These columns are:
In order to populate your grid you must populate these column in the model. The way I did this was with the BeanShell plugin (a system task before the performer task).
Let me show you the code and then explain it:
So basically I write in the formData all the mentioned columns above with the required data.
But there is a catch: if the model si not created when the java code runs your grid can not be populated, so you must initialize the model by yourself (see the if(form == null ) branch).
And also, every item is stored in the database surrounded by "" and followed by 0xa0.