Choose a page or pageref based on conditions
Hi community,
we use a FS_REFERENCE to allow the editor to choose a specific PageRef. The requirement is now to only allow to choose page or pageref that meet a specific condition, e.g. a field in that selected page should not be empty. Is it possible to filter directly in the FS_REFERENCE chooser dialog (by pre-defining search criteria but based on input fields) or do we need a ValueService that checks the target page after selection? Or any other ideas? Intention is to do it similar to an FS_INDEX with a Query.
Thanks Heiko
-
There is this PageRef DataAccessPlugin, maybe this can be used? Is there docu available?
0 -
Hi Heiko,
such a filter is not possible in an FS_REFERENCE. A ValueService might be an option here (of course this would just check after choosing). But that might be useful nevertheless, depends a little on the concrete situation in my opinion:
- If it is more like "I basically do know which PageRef I want, I just need some kind of safety net that checks whether the target fulfills all preconditions" => fine IMHO
- But if it is like "I have a bunch of PageRefs that meet those conditions and want to choose among those" => not so much...
Concerning the ValueService approach, just a remark/hint: A value service is only evaluated in the UI - so in a case that pageref becomes "invalid" later as a target (e.g. because that field has been emptied later), this will not be recognized as validation error upon generation - only when you open the form again later. So there should be s separate check later.
I'm myself not really familiar with the PageRefDataAccessPlugin - but at least from what the documentation says, it is more for remote project setups (and - if I remember correctly - was at least initially created for the use within a "FragmentCreator" project approach - which is deprecated/removed meanwhile). And that DAP does not allow such kind of filter anyway from what I see.
In general, an own DAP implementation might also be a possible approach - but would be more effort.
Hope this helps :-)
Michael0 -
Hi Michael,
yes helps perfectly, thanks a lot for the detailed explanation. We will use the ValueService approach and also perform the condition check during generation by calling the logic via script (Executable).
0
Please sign in to leave a comment.
Comments
3 comments