Open dialog with parameter

According to the examples of documents, I wrote the following example code. However, it does not find setWarehouse, while Warehose is associated in the WarehouseSub model.
Screenshot 2023-04-11 at 20.36.51

example of documentation

@Autowired
private DialogWindows dialogWindows;

private void openViewWithParams(String username) {
    DialogWindow<MyOnboardingView> window =
            dialogWindows.view(this, MyOnboardingView.class).build();
    window.getView().setUsername(username);
    window.open();
}

Does anyone know the solution and help me?

the solution is here