I have a problem with my Cuba application. I have following Edit screen:
When selecting a project the Project Technologies twin Column should look sth like this:
The options in the twinColumn are loaded from the selected project entity. The problem is, that the twinColumn refreshes only when I double click on it.
Here is my Code in projectExperienceEdit.java Controler:
public class ProjectExperienceEdit extends AbstractEditor<ProjectExperience> {
@Override
public void init(Map<String, Object> params) {
// clear skills when project changes
projectField.addValueChangeListener(e -> clearUsedSkills());
}
private void clearUsedSkills() {
if (projektExperienceDs.getItem().getSkills() != null) {
projektExperienceDs.getItem().getSkills().clear();
}
}
}
Here is my datasource layout:
projectExperienceDs: main Ds with the entity being edited
projectDs: options for the project Field
projectDs: options for the project Technologies twin Column
How do I refresh the twin Column when the project Field changes?
This why it is called a demo project no one is interested in your real project. Create a new example project, take a similar domain (or just exchange domain names), put as little entities in it as possible, reproduce the bug.
If you can reproduce it, great - put it in here and we will try to figure out.
If you canāt reproduce - great. Try to identify what is different in your example. If you find something: repeat the process.
This has some major upsides:
you will learn a lot. Isolating a problem is a very important skill to have. You will learn about the framework, about the patterns of your domain model, some internals of the framework and so on.
You will increase the likelihood that you will get an answer. Think about it: this is free service. A lot of people donāt get payed to answer your question. Those who get, they can still pick the question that will give them a quick win. Since you probably donāt payed for the answer - if you do your very best to help the people to help you, so that you increase your chancesā¦
You created an abstract example that fulfils a community purpose. If the example is not mixed up with the domain you are in but instead with a domain everyone understand, you do the community a favor, because the likelihood that other people have a similar question.
You are a good role model to other community members. When other people see you creating great questions, doing good examples etc. They will start mirroring your behavior. This leads to overall better examples, faster answers etc.