Jump to content
We've recently updated our Privacy Statement, available here ×

Make a dependent input display NO options, when no options are selected from the parent input


andey.wei

Recommended Posts

I have two inputs. "Sites" & "Controllers". Controllers are the children of Sites. 

"Controllers" Custom Input Query

select id, name from controllers where $X{IN, site_id, site_id_1}[/code]

When site_id_1 has nothing selected

I expect: the return set to be empty
I get: all the controllers in the DB

Question: How do I make the query return no results when site_id_1 has no options selected?

What I've tried:

select id, name from controllers where (case when ($P{site_id_1} = null) then id = 0 else $X{IN, site_id, site_id_1} end)[/code]

However I don't know the data type of $P{site_id_1}, thus I don't know how to write an expression to test if the parameter is empty.

Thanks in Advance!

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...