Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
dependent dropdown in a subform
Re: dependent dropdown in a subform
Steven
It's more complicated. Every row has a date - start - end - prison - section - room.
There are only a few sections in every prison. But for every reservation I have to be sure that there are not to much persons in a room and not to much persons in a section.
I need date -start - end - section in my query when populating select or lookup.
Johan
It's more complicated. Every row has a date - start - end - prison - section - room.
There are only a few sections in every prison. But for every reservation I have to be sure that there are not to much persons in a room and not to much persons in a section.
I need date -start - end - section in my query when populating select or lookup.
Johan
Re: dependent dropdown in a subform
johan,
Can you show a picture of the whole Edit Form?
How do you record the people and what room they are in?
Steven
Can you show a picture of the whole Edit Form?
How do you record the people and what room they are in?
Steven
A short post is a good post.
Re: dependent dropdown in a subform
Steven
We want to be able to reservate rooms with this.
The form contains a number of parameters such as first date, last date, ...
With the help of Kev1n I have a procedure to have the rooms filled in the subform. Where there is a conflict (too many people in a section or no free room) it leaves section and room empty in the subform so we can manually add a room.
Below is the query for section in the subform. In this query I need Datum - start -eind from the row of the subform
Johan
We want to be able to reservate rooms with this.
The form contains a number of parameters such as first date, last date, ...
With the help of Kev1n I have a procedure to have the rooms filled in the subform. Where there is a conflict (too many people in a section or no free room) it leaves section and room empty in the subform so we can manually add a room.
Below is the query for section in the subform. In this query I need Datum - start -eind from the row of the subform
Code: Select all
SELECT distinct secties.sec_id, secties.sec_name FROM secties
inner join gevangenis on gevangenis.gev_id = secties.sec_gevangenis
where secties.sec_gevangenis = '#act_gevangenis#'
AND (coalesce((select sum(act_deelnemers)
from activiteiten
inner join reservaties on activiteiten.act_id = reservaties.res_act_id
where reservaties.res_datum ='#res_datum#' AND '#res_uur_eind#' > res_uur_start AND '#res_uur_start#' < res_uur_eind and res_sectie = '#res_sectie#' ),0) + '#act_deelnemers#') <= secties.sec_max
You do not have the required permissions to view the files attached to this post.
Re: dependent dropdown in a subform
johan
I'm guessing all the sections are in the sectie table and linked to a record in the gevangenis table.
What is the total number of records in the sectie table?
It would be far easier to create a lookup that has these 2 tables linked,
click on the magnifying glass,
type in the gevangenis (or part of it),
and pick the sectie from there.
You would only need to have a sectie ID stored in the subform table because it is already linked to the gevangenis table.
Like this...
Steven
Steven
I'm guessing all the sections are in the sectie table and linked to a record in the gevangenis table.
What is the total number of records in the sectie table?
It would be far easier to create a lookup that has these 2 tables linked,
click on the magnifying glass,
type in the gevangenis (or part of it),
and pick the sectie from there.
You would only need to have a sectie ID stored in the subform table because it is already linked to the gevangenis table.
Like this...
Steven
Steven
You do not have the required permissions to view the files attached to this post.
A short post is a good post.
Re: dependent dropdown in a subform
Steven
I have 12 sections and I can use #act_gevangenis# (from editform) to link to. 1 activity will never take place in 2 different prisons.
But in an earlier post you wrote
Johan
I have 12 sections and I can use #act_gevangenis# (from editform) to link to. 1 activity will never take place in 2 different prisons.
But in an earlier post you wrote
So even with al lookup I still can't use res_datum, res_uur_start, res_uur_eind to check if the room is available and total persons in section.Use a Lookup instead of a Select. This will allow the use of Hash Cookies but only from the main Edit Form (you may need to populate a hidden field before you launch the Lookup.
Johan
Re: dependent dropdown in a subform
johan,
Your original question was
I was trying to answer the first question, so I don't really know how to help when you say.
Steven
Your original question was
It seems different from calculating room availability.How can I create a dependent dropdown in a subform?
sectie depents on gevangenis.
I was trying to answer the first question, so I don't really know how to help when you say.
So even with al lookup I still can't use res_datum, res_uur_start, res_uur_eind to check if the room is available and total persons in section.
Steven
A short post is a good post.
Re: dependent dropdown in a subform
Steven
My first question was indeed how to create depending select because I hoped I could use the other objects of the subform in my SQL.
I understand that what I want is not possible. Maybe a suggestion for a future release?
Johan
Johan
My first question was indeed how to create depending select because I hoped I could use the other objects of the subform in my SQL.
I understand that what I want is not possible. Maybe a suggestion for a future release?
Johan
Johan
-
- nuBuilder Team
- Posts: 4301
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: dependent dropdown in a subform
Hi Johan,
Cascaded select objects are not supported in subforms.
You could try fiddling with some JavaScript: Add a where clause in the 2nd select using a hash cookie like WHERE something = '#VALUE_SELECT1";
When the value in the first select is changed, set the hashcookie with the value of the first select with nuSetProperty('VALUE_SELECT1', nuGetValue('SELECT_1_OBJECT_ID"))
and call nuRefreshSelectObject(...) to refresh the 2nd select.
Cascaded select objects are not supported in subforms.
You could try fiddling with some JavaScript: Add a where clause in the 2nd select using a hash cookie like WHERE something = '#VALUE_SELECT1";
When the value in the first select is changed, set the hashcookie with the value of the first select with nuSetProperty('VALUE_SELECT1', nuGetValue('SELECT_1_OBJECT_ID"))
and call nuRefreshSelectObject(...) to refresh the 2nd select.
Re: dependent dropdown in a subform
Kevin
With
I get the value of the first select in console.log
But when I add
It seems '#VALUE_SELECT1#' is empty.
Any idea?
Johan
With
Code: Select all
nuSubformValue(this, 'res_gevangenis');
But when I add
Code: Select all
nuSetProperty('VALUE_SELECT1',nuSubformValue(this, 'res_gevangenis'));
Any idea?
Johan
-
- nuBuilder Team
- Posts: 4301
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact: