Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.
Nivel 1
Nivel 2
Iniciar sesión en la comunidad
Iniciar sesión para ver todas las insignias
Esta conversación ha sido bloqueada debido a la inactividad. Cree una nueva publicación.
Hi Team,
I have dialog in that i have dropdown i have used
sling:resourceType="granite/ui/components/coral/foundation/form/select"
in this drop down i have 5 options like
option1
option2
opton3
option4
option5
Now by default it should select option5 without any change done by Author.
Can some one suggest me what property we need to add for these.
¡Resuelto! Ir a solución.
Vistas
Respuestas
Total de me gusta
I'm sorry for posting the wrong attribute. It must be
selected="{Boolean}true"
And here the fixed example:
<items jcr:primaryType="nt:unstructured">
<item1 jcr:primaryType="nt:unstructured"
text="Standard"
value="item1value"/>
<item2 jcr:primaryType="nt:unstructured"
text="NonStandard"
value="item2Value"
selected="{Boolean}true"
/>
</items>
Vistas
Respuestas
Total de me gusta
There is a small pitfall for this. The property for your requirement called "defaultValue".
Imagin you declared two select items the xml is as follows:
<items jcr:primaryType="nt:unstructured">
<item1 jcr:primaryType="nt:unstructured"
text="Standard"
value="item1value"/>
<item2 jcr:primaryType="nt:unstructured"
text="NonStandard"
value="item2Value"/>
</items>
So, you have to add defaultValue="item2Value" to the select field in your dialog.xml for preselection.
Vistas
Respuestas
Total de me gusta
Hi @Magicr ,
Thanks for your quick reply.
I have tried as per your suggestion.
<selectValue
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
fieldDescription=data"
fieldLabel="data"
name="./data"
defaultValue="option5">
But the Default value is not picking its picking the first option only.
Let me know if i made any mistake here
Vistas
Respuestas
Total de me gusta
I'm sorry for posting the wrong attribute. It must be
selected="{Boolean}true"
And here the fixed example:
<items jcr:primaryType="nt:unstructured">
<item1 jcr:primaryType="nt:unstructured"
text="Standard"
value="item1value"/>
<item2 jcr:primaryType="nt:unstructured"
text="NonStandard"
value="item2Value"
selected="{Boolean}true"
/>
</items>
Vistas
Respuestas
Total de me gusta
Vistas
Respuestas
Total de me gusta
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas