Hi,
i’m using token list inside a form (within a master-detail screen).
When i commit my changes (and the editor must return in readonly state) token list is still editable.
Can be a bug ?
Thanks
Hello @tsarev,
thanks for the support.
I’m using a just created Master-Detail screen, and in the editing mode you are able to use twincolumn and also save chages:

But in read mode, twin column is also enable (luckily without modify entity state):

I think that the problem can be in the initEditComponents(boolean enabled) of the MasterDetailScreen when all the component contained in the TabSheet parent needs to be enabled/disabled.
At the moment i will override this methods.
Regards,
Fabrizio
Please clarify what component you are asking about - TokenList or TwinColumn?
I’m asking because the topic is named as “TokenList in form …”, but in message you are talking about TwinColumn:
you are able to use twincolumn and also save chages:
and later:
But in read mode, twin column is also enable
Regards,
Daniil
Excuse me I have misspelled.
I was talking about token list that remain editable also when the form is disabled.
Thanks
What version of CUBA do you use?
I think that the problem can be in the initEditComponents(boolean enabled) of the MasterDetailScreen when all the component contained in the TabSheet parent needs to be enabled/disabled.
At the moment i will override this methods.
Have you tried to delete your custom method implementation and check whether TokenList remains editable?
I’m using version 7.0.1 on a just created form (I have not implemented any method yet on tokenlist).
I’ve attached the sources where you can find commented initEditComponents method with my actual workaround.
customer-var-config-browse.xml (5.7 KB)
CustomerVarConfigBrowse.java (6.0 KB)
Regards,
Fabrizio
JavaDoc for the initEditComponents(boolean enabled) method says:
Initializes edit controls, depending on if they should be enabled or disabled.
So we should disable TokenList as any other component:
protected void initEditComponents(boolean enabled) {
super.initEditComponents(enabled);
// will be enabled when editor components are enabled, and otherwise
tokenList.setEnabled(enabled);
}
Regards,
Daniil
Ok,
thanks for the clarification.
Regards,
Fabrizio