Thanks for your answer.
Yes, that's why I tried "if service_id != 18" but the if is always "true"...
I will wait if someone else know if it is possible or not :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Kevin, if you want to achieve this you shouldn't do it in the TWIG directly, but in the object GetInitialAttributeFlags() method.
The idea is to:
- In the datamodel define the dependancy between 2 fields
- In the GetInitialAttribuetFlags() method, set the flag to hidden depending on the value of the other attribute
Hope thie helps,
Guillaume
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello to all,
I try to show/hide some field depending on service selected.
I tried those codes :
and
But the 1st field is always displayed...
Could it be possible to check another field value in the twig ?
Kind regards,
service_id would probably indeed be a number, but I'm not sure you can directly access the attribute value that way?
Thanks for your answer.
Yes, that's why I tried "if service_id != 18" but the if is always "true"...
I will wait if someone else know if it is possible or not :)
I bypassed the problem :p
I created a new class Product and the field in ticket is a SELECT query based on the Service ID :)
Hello Kevin, if you want to achieve this you shouldn't do it in the TWIG directly, but in the object GetInitialAttributeFlags() method.
The idea is to:
- In the datamodel define the dependancy between 2 fields
- In the GetInitialAttribuetFlags() method, set the flag to hidden depending on the value of the other attribute
Hope thie helps,
Guillaume