Jacek Medrzycki
2007-03-09 10:56:14 UTC
Hi
I have the following problem:
There is a field in the form, say "Recruitment type", which is a
listfield with 2 values:
External
Internal
(this is associated with recruitment_type property)
Then, I have RelationStringField (for referral relation) that should,
when clicked on the gear wheel:
a) In Internal recruitment type, display a list of Persons,
b) In External recruitment type, display a list of Announcements.
It is easy to write a TALES expression in "Portal Type" field, that
makes relation string field display only Persons or Announcements,
according to recruitment_type. It works good after initial load of the form.
But then, user can change the value on a Recruitment Type list field. In
such a case, relation string, when clicked on gear wheel, would display
wrong portal type.
I've attached javascript method to the list field:
onchange='form.submit()', so the form is reloaded when user changes
value in list field.
But then I've found out that my TALES expression is not re-evaluated
after form is reloaded, so the releation string field is still
associated with wrong portal type.
The question is - what should I do to make TALES re-evaluate after form
is reloaded? Definitely there is such a way, 'couse TALESes are
evaluated after user click gear wheel and then click "Update relation".
I need similar behaviour for list field.
Regards,
Jacek
I have the following problem:
There is a field in the form, say "Recruitment type", which is a
listfield with 2 values:
External
Internal
(this is associated with recruitment_type property)
Then, I have RelationStringField (for referral relation) that should,
when clicked on the gear wheel:
a) In Internal recruitment type, display a list of Persons,
b) In External recruitment type, display a list of Announcements.
It is easy to write a TALES expression in "Portal Type" field, that
makes relation string field display only Persons or Announcements,
according to recruitment_type. It works good after initial load of the form.
But then, user can change the value on a Recruitment Type list field. In
such a case, relation string, when clicked on gear wheel, would display
wrong portal type.
I've attached javascript method to the list field:
onchange='form.submit()', so the form is reloaded when user changes
value in list field.
But then I've found out that my TALES expression is not re-evaluated
after form is reloaded, so the releation string field is still
associated with wrong portal type.
The question is - what should I do to make TALES re-evaluate after form
is reloaded? Definitely there is such a way, 'couse TALESes are
evaluated after user click gear wheel and then click "Update relation".
I need similar behaviour for list field.
Regards,
Jacek