Template that OUTPUTS data (common search filters)

I’m got a project with various different screens to analyse production data. On these screens I want
to put certain common filters, e.g. start date, end date, line, shift etc.

It seems logical to create a template that I can then use on my various screens.

My problem is, having placed the filters template onto a window, I cannot then access the
selections from the parent window (the template has limited properties exposed).

I’ve created template properties which I can access from the parent window, but the
problem is I cannot bind to them in the template master. I.e. I cannot put any information
into them (the user’s selections) for the parent window to be able to access.

Is there a way around this (other than forgetting the template idea and just having
multiple copies of controls on multiple pages, which doesn’t seem very neat)?

One idea I had was creating Client tags and linking the filters to them within the template.

Assuming you have the following in the template master:
Filter1 textbox
Filter2 textbox

Add the following two template parameters:
Filter1 string
Filter2 string

Bind the text property of Filter1 textbox to the Filter1 parameter and make sure to select the bidirectional checkbox. Same for Filter2 textbox.

From the parent window, Filter1 and Filter2 should be accessible with whatever value the user enters.

Thanks for the reply. That makes sense although unfortunately isn’t going to help me.

I should have explained that I really want Custom Properties on most of the filter items, these would
generate part of an SQL WHERE query.

The only way I can think of at the moment is having the filter values themselves as Client memory tags and
then creating some Client expression tags that translate these to the necessary SQL.

You can access any of the Template Parameters as well as the Internal Properties of a Template through scripting. For example: I’ve created a template with one Internal Property that has a binding that builds the where clause, and a propertyChange script that fires off that Internal Property changing. It just pushes the new value to the Template Parameter.

Strange… This method not working.

Serhii,

Did you get it working?
If not, could you please provide details about what your setup’s like and what is it (not) doing, along with any error messages you you are getting.

Just revisiting this thread over a year on from my original post and after 10 minutes or so to remind myself what the original issue was, I’ve tried Bobby’s solution above which at first glance would indeed appear to solve the problem.

I.e. have Internal Properties to generate info required and then use a Property Change script to push those into Template Parameters that a parent window could access.

It’s a bit late now to use this in my original application but it’s worth knowing, going forward.

(having said all that I’m not sure if it would work totally in my situation as in some cases I may need to set the initial values of the filters within code, rather than the user selecting them)