Hello,
I am trying to use the extension feature in cuba (Extending Screens - CUBA Platform. Developer’s Manual). I have extended an entity an I would like to add an additional column in the browse view:
@Entity(name = "dm$MyDocument")
@Extends(Document.class)
public class MyDocument extends Document {
private static final long serialVersionUID = -5231297063086815719L;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "USER_ID")
protected User editor;
...
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
class="de.balvi.ipi.dm.web.dmdokument.ExtDokumentBrowse"
extends="de/balvi/ipi/platform/web/dokument/dokument-browse.xml"
messagesPack="de.balvi.ipi.dm.web.dmdokument"
xmlns:ext="http://schemas.haulmont.com/cuba/window-ext.xsd">
<layout>
<!--<filter id="filter"/>-->
<table id="dokumentTable">
<columns>
<column id="ueberwachungssichtBetriebsstaette"
ext:index="2"/>
</columns>
</table>
</layout>
</window>
I now get the error “IllegalStateException: Cannot get unfetched attribute [editor] from detached object …”. So it looks to me as if I have to extend the view for Document. By I don’t know to do this in this case:
- Document uses the view “document-browse-view” and defining a view with the same name in MyDocument does not work
- extending the new browse.xml with a collectionDatasource tag does not work either.
Can you help me? Thanks in advance.
Yours,
Joerg