<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&#39;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:&quot;DejaVu Sans Mono&quot;"><span style="color:rgb(152,118,170)">hidden </span>= componentFactory.createInput(<span style="color:rgb(106,135,89)">&quot;Hidden&quot;</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)">&quot;Length&quot;</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)">&quot;Required&quot;</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)">&quot;Type&quot;</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:&quot;DejaVu Sans Mono&quot;">fieldConfigList.addValueChangeListener((ValueChangeEvent event) -&gt; {<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)">&quot;When true the field &#39;%s&#39; will be ignored on AdminFaces scaffold.&quot;</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) -&gt; {<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)">&quot;When true the field &#39;%s&#39; will be required on AdminFaces scaffold generated pages.&quot;</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) -&gt; {<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)">&quot;Set field &#39;%s&#39; length to be used on AdminFaces scaffold generated pages.&quot;</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) -&gt; {<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)">&quot;Set field &#39;%s&#39; component type to be used on AdminFaces scaffold generated pages.&quot;</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) -&gt; {<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)">&quot;&quot;</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)">&quot;&quot;</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)">&quot;&quot;</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)">&quot;&quot;</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 &quot;fieldConfigList&quot; I want to change &quot;type&quot;, &quot;length&quot;, &quot;required&quot; and &quot;hidden&quot; defaultValues. It only works for &quot;type&quot; 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">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 &quot;description&quot; 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">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 &quot;setValue&quot;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="gmail_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">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>