Hello,
I am making a lunch reservation system. Currently I have two tables: restaurant (restaurant_id, restaurant_name, ...) and meal (meal_id, meal_name, meal_date, restaurant_id, ...).
Now I want to make a form where the administrator can populate the meal menu for each restaurant. First I want to select the restaurant_id and meal_date and then display filtered content of the meal table as a subform where I can quickly add a few meals and save all changes at one time.
I have already discovered that a subform cannot be refreshed alone (which I need to apply the filters). Therefore I decided to use iFrame. The main form is a launch form which contains only the filtering components and on button press it refreshes the iFrame. The iFrame contains another launch form which contains the subform. Now the problem is that the subform wants a foreign key, but I want to filter the subform using hash cookies set by the main form and I cannot leave the foreign key field blank.
What is the preferred way of accomplishing the task stated above? Any help will be appriciated.
Thank you for help
Klasyc
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.
Another subform filtering
-
- nuBuilder Team
- Posts: 4301
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact:
Re: Another subform filtering
Hi,
A subform is refreshed after saving a form. So the easiest way is porbably to refresh/reload the form after entering the restaurant and date.
This can also be done automatically with nuSaveAction()
A subform is refreshed after saving a form. So the easiest way is porbably to refresh/reload the form after entering the restaurant and date.
This can also be done automatically with nuSaveAction()
-
- Posts: 5
- Joined: Thu Nov 11, 2021 4:25 pm
Re: Another subform filtering
But the main form is not currently connected with any database table, so that it cannot be saved
Of course I could put the subform to the restaurant edit form, but I actually don't want to edit the restaurant and also the restaurant table does not have the fields for date. Or maybe my database design is bad and I should have a third table - menu (menu_id, restaurant_id, menu_date) and use menu_id as foreign key for the meal table. Now it seems this design would fit nuBuilder better... What do you think?

-
- nuBuilder Team
- Posts: 4301
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 445 times
- Contact: