|
Re: list2 [message #2552 is a reply to message #2551] |
Mon, 21 June 2010 15:29 |
AJM
Messages: 2363 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
In this situation it is not possible to check the parent status for FALSE and prevent the LIST2 task from being called. All you can do is wait until after the LIST2 has been called and then take some action depending on the parent status.
Allowing the user to remain within the LIST2 is not actually a problem - all that is needed is a way to prevent child records (via the ADD2 task) from being created. There are several possibilities open to you:
- You could put code within the ADD2 task to immediately exit if it has been called for a parent with its status set to FALSE.
- You could put code within the ADD2 task to issue an error message if the SUBMIT button is pressed for a parent with its status set to FALSE.
- You could put code within the LIST2 task to immediately exit if it has been called for a parent with its status set to FALSE.
- You could put code within the LIST2 task to drop the ADD2 navigation button if it has been called for a parent with its status set to FALSE. This is explained in FAQ153.
All of these options can be achieved within the Radicore framework. You choose which one you want, then put the right code in the right place
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
Re: list2 [message #2554 is a reply to message #2553] |
Tue, 22 June 2010 08:29 |
AJM
Messages: 2363 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
You haven't read what I wrote. If you start with a LIST1 screen which shows a number of entries from the parent table, and this LIST1 screen contains a navigation button which transfers control to a LIST2 screen, then you cannot hide or show the navigation button depending on the value of this status field. The LIST1 screen will be showing several records, and some of these records might have a FALSE status while others are TRUE. You have to wait until *AFTER* one or more parent entries have been selected, *AND* the LIST2 navigation button has been pressed (remember, there may be other navigation buttons) before you can decide whether the LIST2 task is valid or not for a particular parent record. This processing must be inside the LIST2 task, not the one which calls the LIST2 task.
I repeat, you cannot prevent the LIST2 navigation button from being pressed, you can only decide if the action is valid *AFTER* it has been pressed.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
Re: list2 [message #2556 is a reply to message #2555] |
Tue, 22 June 2010 10:01 |
AJM
Messages: 2363 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
There is no "relationship" between the LIST1 task and the LIST2 task other than a navigation button in the LIST1 which activates the LIST2. There is no particular method which is activated when a navigation button is pressed - the LIS1 stops and the LIST2 starts.
There is no single function that does what you want. There are a variety of options, as I have identified in a previous reply, and each of these options will require different code in different places.
In the LIST2 task you could use scriptPrevious() to exit back to the LIST1 after you have discovered that the parent record has a FALSE status. You culd also do what I suggested in [rl= http://www.tonymarston.net/php-mysql/infrastructure-faq.html #faq135]FAQ135[/url]. You could allow the LIST2 task to continue, but produce an error message to terminate the ADD2 task if it is activated when it shouldn't be.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|