Page 1 of 1

Using UI Fields From MemDataBook Object

PostPosted: Fri Feb 15, 2019 1:23 pm
by reversedr
Hi everyone,

We are trying to create a form that is not associated to a database, following the example in "http://doc.sibvisions.com/jvx/client/model/data/memory"


We are defining a MemDataBook object like so:

private void createMemDataBook() throws Throwable
{

//--------------------------------
// Data
//--------------------------------

MemDataBook mdbData = new MemDataBook();
mdbData.setName("person");
mdbData.getRowDefinition().addColumnDefinition(new ColumnDefinition("FIRSTNAME"));
mdbData.getRowDefinition().addColumnDefinition(new ColumnDefinition("LASTNAME"));
mdbData.getRowDefinition().addColumnDefinition(new ColumnDefinition("PHONE"));
mdbData.open();

}

VisionX recognizes the table like shown bellow:

Table-Detected.jpg
Table-Detected.jpg (27.48 KiB) Viewed 9418 times


But when we try to add the field to the form, we get the following error:

Error-2.jpg
Error-2.jpg (301.68 KiB) Viewed 9418 times

Error-1.jpg
Error-1.jpg (279.28 KiB) Viewed 9418 times


Can anyone help me to solve this problem?


Thanks in advance!

Re: Using UI Fields From MemDataBook Object

PostPosted: Fri Feb 15, 2019 2:50 pm
by Support@SIB
This is clear, because VisionX creates an Editor instance for the unused editors and tries to set the column name and the databook (in your case, the mem databook).

But the mem databook is not in the field list, it's declared in your create method only.

So, if you move:
MemDataBook mdbData = new MemDataBook();

to the fields, it should work.

Re: Using UI Fields From MemDataBook Object

PostPosted: Mon Feb 18, 2019 12:46 pm
by reversedr
Thank you , that was it!