<div dir="auto">Hi Rafael,<div dir="auto"><br></div><div dir="auto">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. </div><div dir="auto"><br></div><div dir="auto">Can I ask you to open a JIRA with these instructions? I'll have a look when possible.</div><div dir="auto"><br></div><div dir="auto">Best regards,</div><div dir="auto"><br></div><div dir="auto">George Gastaldi</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em Qui, 7 de mar de 2019 18:26, Rafael Pestano <<a href="mailto:rmpestano@gmail.com">rmpestano@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="color:rgb(33,33,33);font-size:13px">Hi guys,</span><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">I'm trying to set a default value of a previous disabled input and it is not working, let me show some code:<br><br><pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:"DejaVu Sans Mono""><span style="color:rgb(152,118,170)">hidden </span>= componentFactory.createInput(<span style="color:rgb(106,135,89)">"Hidden"</span><span style="color:rgb(204,120,50)">, </span>Boolean.<span style="color:rgb(204,120,50)">class</span>)<br> .setEnabled(<span style="color:rgb(204,120,50)">false</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"><br></span><span style="color:rgb(152,118,170)">length </span>= componentFactory.createInput(<span style="color:rgb(106,135,89)">"Length"</span><span style="color:rgb(204,120,50)">, </span>Integer.<span style="color:rgb(204,120,50)">class</span>)<br> .setEnabled(<span style="color:rgb(204,120,50)">false</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"><br></span><span style="color:rgb(152,118,170)">required </span>= componentFactory.createInput(<span style="color:rgb(106,135,89)">"Required"</span><span style="color:rgb(204,120,50)">, </span>Boolean.<span style="color:rgb(204,120,50)">class</span>)<br> .setEnabled(<span style="color:rgb(204,120,50)">false</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"><br></span><span style="color:rgb(152,118,170)">type </span>= componentFactory.createSelectOne(<span style="color:rgb(106,135,89)">"Type"</span><span style="color:rgb(204,120,50)">, </span>ComponentTypeEnum.<span style="color:rgb(204,120,50)">class</span>)<br> .setValueChoices(Arrays.<span style="font-style:italic">stream</span>(ComponentTypeEnum.<span style="font-style:italic">values</span>()).collect(Collectors.<span style="font-style:italic">toList</span>()))<br> .setEnabled(<span style="color:rgb(204,120,50)">false</span>)<span style="color:rgb(204,120,50)">;</span></pre></div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">those fields are enabled on a valueChangeLIstener:<br><br><pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:"DejaVu Sans Mono"">fieldConfigList.addValueChangeListener((ValueChangeEvent event) -> {<br> <span style="color:rgb(152,118,170)">fieldConfig </span>= (FieldConfig) event.getNewValue()<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> if </span>(<span style="color:rgb(152,118,170)">fieldConfig </span>!= <span style="color:rgb(204,120,50)">null</span>) {<br> <span style="color:rgb(152,118,170)">hidden</span>.setEnabled(<span style="color:rgb(204,120,50)">true</span>)<br> .setDescription(String.<span style="font-style:italic">format</span>(<span style="color:rgb(106,135,89)">"When true the field '%s' will be ignored on AdminFaces scaffold."</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(152,118,170)">fieldConfig</span>.getName()))<br> .setValue(<span style="color:rgb(152,118,170)">fieldConfig</span>.getHidden())<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"><br></span><span style="color:rgb(204,120,50)"> </span><span style="color:rgb(152,118,170)">hidden</span>.addValueChangeListener((ValueChangeEvent evt) -> {<br> <span style="color:rgb(152,118,170)">fieldConfig</span>.setHidden((Boolean) evt.getNewValue())<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span>})<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span><span style="color:rgb(152,118,170)">required</span>.setEnabled(<span style="color:rgb(204,120,50)">true</span>)<br> .setDescription(String.<span style="font-style:italic">format</span>(<span style="color:rgb(106,135,89)">"When true the field '%s' will be required on AdminFaces scaffold generated pages."</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(152,118,170)">fieldConfig</span>.getName()))<br> .setValue(<span style="color:rgb(152,118,170)">fieldConfig</span>.getRequired())<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"><br></span><span style="color:rgb(204,120,50)"> </span><span style="color:rgb(152,118,170)">required</span>.addValueChangeListener((ValueChangeEvent evt) -> {<br> <span style="color:rgb(152,118,170)">fieldConfig</span>.setRequired((Boolean) evt.getNewValue())<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span>})<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span><span style="color:rgb(152,118,170)">length</span>.setEnabled(<span style="color:rgb(204,120,50)">true</span>)<br> .setDescription(String.<span style="font-style:italic">format</span>(<span style="color:rgb(106,135,89)">"Set field '%s' length to be used on AdminFaces scaffold generated pages."</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(152,118,170)">fieldConfig</span>.getName()))<br> .setValue(<span style="color:rgb(152,118,170)">fieldConfig</span>.getLength())<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"><br></span><span style="color:rgb(204,120,50)"> </span><span style="color:rgb(152,118,170)">length</span>.addValueChangeListener((ValueChangeEvent evt) -> {<br> <span style="color:rgb(152,118,170)">fieldConfig</span>.setLength((Integer) evt.getNewValue())<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span>})<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span><span style="color:rgb(152,118,170)">type</span>.setEnabled(<span style="color:rgb(204,120,50)">true</span>)<br> .setDescription(String.<span style="font-style:italic">format</span>(<span style="color:rgb(106,135,89)">"Set field '%s' component type to be used on AdminFaces scaffold generated pages."</span><span style="color:rgb(204,120,50)">, </span><span style="color:rgb(152,118,170)">fieldConfig</span>.getName()))<br> .setValue(<span style="color:rgb(152,118,170)">fieldConfig</span>.getType())<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"><br></span><span style="color:rgb(204,120,50)"> </span><span style="color:rgb(152,118,170)">type</span>.addValueChangeListener((ValueChangeEvent evt) -> {<br> <span style="color:rgb(152,118,170)">fieldConfig</span>.setType((ComponentTypeEnum) evt.getNewValue())<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span>})<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span>} <span style="color:rgb(204,120,50)">else </span>{<br> <span style="color:rgb(152,118,170)">hidden</span>.setEnabled(<span style="color:rgb(204,120,50)">false</span>)<br> .setNote(<span style="color:rgb(106,135,89)">""</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span><span style="color:rgb(152,118,170)">length</span>.setEnabled(<span style="color:rgb(204,120,50)">false</span>)<br> .setNote(<span style="color:rgb(106,135,89)">""</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span><span style="color:rgb(152,118,170)">required</span>.setEnabled(<span style="color:rgb(204,120,50)">false</span>)<br> .setNote(<span style="color:rgb(106,135,89)">""</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span><span style="color:rgb(152,118,170)">type</span>.setEnabled(<span style="color:rgb(204,120,50)">false</span>)<br> .setNote(<span style="color:rgb(106,135,89)">""</span>)<span style="color:rgb(204,120,50)">;<br></span><span style="color:rgb(204,120,50)"> </span>}<br>})<span style="color:rgb(204,120,50)">;</span></pre></div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">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: </div><div style="color:rgb(33,33,33);font-size:13px"> <a href="https://youtu.be/hKbGGJZCOjE" target="_blank" rel="noreferrer">https://youtu.be/hKbGGJZCOjE</a><br></div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">Also it is working for the "description" attribute because it is changing accordingly with selected fieldConfig as you can see on the video.</div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">Code is available here: <a href="https://github.com/adminfaces/admin-addon/blob/55da7431d0f64170855cbc1f681642a18e912cf5/src/main/java/com/github/adminfaces/addon/ui/AdminFacesScaffoldConfigStep.java#L241-L307" target="_blank" rel="noreferrer">https://github.com/adminfaces/admin-addon/blob/55da7431d0f64170855cbc1f681642a18e912cf5/src/main/java/com/github/adminfaces/addon/ui/AdminFacesScaffoldConfigStep.java#L241-L307</a></div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">Any hints? (I also tried to use "setValue"instead of defaultValue but also did not worked)</div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">Thanks in advance!</div></div>-- <br><div dir="ltr" class="m_148380777500563480gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px"><font color="#c0c0c0">Att,</font></div><div dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px"><font color="#c0c0c0"><br></font></div><div dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px"><font color="#c0c0c0">Rafael M. Pestano</font></div><div dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px"><font color="#c0c0c0"><br></font></div><div dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px"><font color="#c0c0c0">Desenvolvedor Java Cia. de Processamento de Dados do Rio Grande do Sul</font></div><div dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px"><font color="#c0c0c0"><a href="http://rpestano.wordpress.com/" target="_blank" rel="noreferrer">http://rpestano.wordpress.com/</a></font></div><div dir="ltr" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px"><font color="#c0c0c0">@realpestano</font></div></div></div>
_______________________________________________<br>
forge-users mailing list<br>
<a href="mailto:forge-users@lists.jboss.org" target="_blank" rel="noreferrer">forge-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/forge-users" rel="noreferrer noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/forge-users</a></blockquote></div>