I am following this tutorial Development beyond CRUD · aleksey-stukalov/workshop Wiki · GitHub, but, when I want to save after I created the button btnNewStatus:
“5. The Studio will generate a method, that will be called on button click. Press Ctrl+I to save the changes and open the screen controller in your IDE”
This message is shown: “Screen’s Id and agent must be unique for the module. Id = workshop$Order.browse; agent = null; module = web”
public class OrderBrowse extends AbstractLookup {
@Inject
private CollectionDatasource<Order, UUID> ordersDs;
public void onBtnNewStatusClick(Component source) {
Order selectedItem = ordersDs.getItem();
if (selectedItem != null) {
selectedItem.setStatus(OrderStatus.NEW);
ordersDs.commit();
}
}
But It can’t build the application, after I run the web app, this message is shown:
Task 'deploy, start' failed
org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
This is the order controller file:
package com.company.workshop.web.order;
import java.util.UUID;
import javax.inject.Inject;
import com.company.workshop.entity.Order;
import com.company.workshop.entity.OrderStatus;
import com.haulmont.cuba.gui.components.AbstractLookup;
import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.data.CollectionDatasource;
public class OrderBrowse extends AbstractLookup {
@Inject
private CollectionDatasource<Order, UUID> ordersDs;
public void onBtnNewStatusClick(Component source) {
Order selectedItem = ordersDs.getItem();
if (selectedItem != null) {
selectedItem.setStatus(OrderStatus.NEW);
ordersDs.commit();
}
}