Hi,
I am still experimenting with CUBA.platform and I am trying to create a screen that shall be displayed by clicking a button I have added to an existing generic view. I need somewhere to collect a set of parameters so that I can then ‘bulk’ add a set of records (I shall do the inserts in a bean on the middleware level). I want this as for the project I have in mind I have to quickly add in lists of location records and I want a quick way of doing this i.e. bulk create a set of records for positions 1 to 20 with a specified set parameters and repeat as necessary.
I have managed to add in a screen and if I open the Java file I can see it extends AbstractWindow. I have eventually figured out how to open it by using this code in the button handler:
openWindow(“BulkLayoutCreate”, WindowManager.OpenType.DIALOG);
Following the xample here (LookupField - CUBA Platform. Developer’s Manual) I have added a couple of datasources and linked these to two LookupField objects. Here is the xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
caption="msg://caption"
class="com.carron.shelltracker.web.screens.Bulklayoutcreate"
messagesPack="com.carron.shelltracker.web.screens">
<dsContext>
<datasource id="recipeItemDs"
class="com.carron.shelltracker.entity.RecipeItem"
allowCommit="false"
view="_local"/>
<datasource id="suppliersDs"
class="com.carron.shelltracker.entity.Supplier"
allowCommit="false"
view="_local"/>
</dsContext>
<layout expand="buttonsBox"
spacing="true">
<lookupField datasource="recipeItemDs" property="recipe"/>
<lookupField datasource="suppliersDs" property="code"/>
<hbox id="buttonsBox"
spacing="true">
<button id="okBtn"
caption="OK"
invoke="onOkBtnClick"/>
<button id="cancelBtn"
caption="Cancel"
invoke="onCancelBtnClick"/>
</hbox>
</layout>
</window>
However when I run the application although the dropdowns are shown they do not have any values:
Can anyone tell what I am doing wrong or what I am missing?
Thanks,
Iain