Cette conversation a été verrouillée en raison de son inactivité. Veuillez créer une nouvelle publication.
Niveau 1
Niveau 2
Se connecter à la communauté
Connectez-vous pour voir tous les badges
Cette conversation a été verrouillée en raison de son inactivité. Veuillez créer une nouvelle publication.
Hello Community,
i want to generate a form with the granite form components dynamically in Sightly, where the values if they exist, are already set. (<input type="text" value="foo"/> for example.)
How can I set the value or any other attribute of a resourceType (granite/ui/components/foundation/form/textfield for example) in Sightly?
Thanks in advance
Herbert
Résolu ! Accéder à la solution.
Vues
Réponses
Nombre de J’aime
Ah ok, you can't pass in parameters like that.
I would see if you can you use data-sly-template? That supports fully to pass in parameters.
Vues
Réponses
Nombre de J’aime
Do you want to modify values from your resource?
Vues
Réponses
Nombre de J’aime
No, i wanted to include a granite component in a custom console app(Touch UI) like this:
<div data-sly-resource=${'textfield' @ resourceType='granite/ui/components/foundation/form/textfield'}' value="foo" class="edit2" data-sly-unwrap/>
I'm trying to set the value of the input field through a parameter(value="foo") . One of the methods I found after researching was to write the attributes into a ValueMap and adding the ValueMap into the request (request.setAttribute(Field.class.getName(), ValueMap).
I hoped that there would be "simpler" way of doing this, instead of writing into the request.
Vues
Réponses
Nombre de J’aime
Ah ok, you can't pass in parameters like that.
I would see if you can you use data-sly-template? That supports fully to pass in parameters.
Vues
Réponses
Nombre de J’aime
I already tried that, but it seems there is no template.xml or something not defined for the granite-components. I found a workaround already, thanks for your support.
Vues
Réponses
Nombre de J’aime
Vues
Likes
Réponses