This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

Using UI Fields From MemDataBook Object

Frequently asked questions about VisionX.

Using UI Fields From MemDataBook Object

Postby reversedr » Fri Feb 15, 2019 1:23 pm

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 81 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 81 times

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


Can anyone help me to solve this problem?


Thanks in advance!
reversedr
 
Posts: 13
Joined: Tue Oct 23, 2018 11:03 am

Re: Using UI Fields From MemDataBook Object

Postby Support@SIB » Fri Feb 15, 2019 2:50 pm

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.
User avatar
Support@SIB
 
Posts: 268
Joined: Mon Sep 28, 2009 1:56 pm

Re: Using UI Fields From MemDataBook Object

Postby reversedr » Mon Feb 18, 2019 12:46 pm

Thank you , that was it!
reversedr
 
Posts: 13
Joined: Tue Oct 23, 2018 11:03 am


Return to VisionX