Hi Rafael,

Thank you for the issue explanation. I thought I had seen an issue similar to what you described in our JIRA but I couldn't find it. 

Can I ask you to open a JIRA with these instructions? I'll have a look when possible.

Best regards,

George Gastaldi

Em Qui, 7 de mar de 2019 18:26, Rafael Pestano <rmpestano@gmail.com> escreveu:
Hi guys,

I'm trying to set a default value of a previous disabled input and it is not working, let me show some code:

hidden = componentFactory.createInput("Hidden", Boolean.class)

length = componentFactory.createInput("Length", Integer.class)

required = componentFactory.createInput("Required", Boolean.class)

type = componentFactory.createSelectOne("Type", ComponentTypeEnum.class)

those fields are enabled on a valueChangeLIstener:

fieldConfigList.addValueChangeListener((ValueChangeEvent event) -> {
fieldConfig = (FieldConfig) event.getNewValue();
if (fieldConfig != null) {
.setDescription(String.format("When true the field '%s' will be ignored on AdminFaces scaffold.", fieldConfig.getName()))

hidden.addValueChangeListener((ValueChangeEvent evt) -> {
fieldConfig.setHidden((Boolean) evt.getNewValue());
.setDescription(String.format("When true the field '%s' will be required on AdminFaces scaffold generated pages.", fieldConfig.getName()))

required.addValueChangeListener((ValueChangeEvent evt) -> {
fieldConfig.setRequired((Boolean) evt.getNewValue());
.setDescription(String.format("Set field '%s' length to be used on AdminFaces scaffold generated pages.", fieldConfig.getName()))

length.addValueChangeListener((ValueChangeEvent evt) -> {
fieldConfig.setLength((Integer) evt.getNewValue());
.setDescription(String.format("Set field '%s' component type to be used on AdminFaces scaffold generated pages.", fieldConfig.getName()))

type.addValueChangeListener((ValueChangeEvent evt) -> {
fieldConfig.setType((ComponentTypeEnum) evt.getNewValue());
} else {

Whenever I change "fieldConfigList" I want to change "type", "length", "required" and "hidden" defaultValues. It only works for "type" field which is a selectOne or if I go back and forth on the wizard as shown on the video below: 

Also it is working for the "description" attribute because it is changing accordingly with selected fieldConfig as you can see on the video.

Code is available here: https://github.com/adminfaces/admin-addon/blob/55da7431d0f64170855cbc1f681642a18e912cf5/src/main/java/com/github/adminfaces/addon/ui/AdminFacesScaffoldConfigStep.java#L241-L307

Any hints? (I also tried to use "setValue"instead of defaultValue but also did not worked)

Thanks in advance!

Rafael M. Pestano

Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul
forge-users mailing list