Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
I have a textfield within a multified. I need to fetch the ID for the textfield each item a new multified item is added. Since the textfield is within the multified I am not sure how can i set the granite:id to it. Any suggestion?
Solucionado! Ir para a Solução.
Visualizações
respostas
Total de curtidas
You can try to iterate the textfield inside the multifield using clientlibs javascript.
These Ids will be generated by granite UI and can be iterated through the code.
Adding a sample code to fetch values from dialogs using JS.
https://github.com/viji13/aemlearnings/blob/master/clientlibs/script.js
You can try to iterate the textfield inside the multifield using clientlibs javascript.
These Ids will be generated by granite UI and can be iterated through the code.
Adding a sample code to fetch values from dialogs using JS.
https://github.com/viji13/aemlearnings/blob/master/clientlibs/script.js
ID must be unique, if you have text field with id(granite:id) in side multifield, there will be multiple elements with same id. You will always get the first element.
So use class(granite:class) instead and get the last element(selector text-field-class:last) of that class when new item is added.
Example:
Add class(granite:class) to id text field (here I am using id-text-field). Try below code to get each text field value inside multifield.
$(".coral3-Multifield-item").each(function( index ) {
console.log($(this).find(".id-text-field").val());
});
Visualizações
respostas
Total de curtidas
Visualizações
respostas
Total de curtidas
Hi @Shaheena_Sheikh,
You can achieve this in two ways
For more details on event listeners check my blog here
Hope this helps.
Thanks,
Kiran Vedantam.
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas