Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » list2 (LIST2)
list2 [message #2551] Mon, 21 June 2010 13:18 Go to next message
vidhu is currently offline  vidhu
Messages: 14
Registered: February 2010
Location: SURINAME
Junior Member

Hello sir
I have doubt about list2.I have a mother table A and child table is B.A table contains some status like true ,false.If status is true ,then it can go to list 2.which function can I use for this condition in class file.Please help me sir and give me aexample

Re: list2 [message #2552 is a reply to message #2551] Mon, 21 June 2010 15:29 Go to previous messageGo to next message
AJM is currently offline  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


Re: list2 [message #2553 is a reply to message #2552] Tue, 22 June 2010 07:56 Go to previous messageGo to next message
vidhu is currently offline  vidhu
Messages: 14
Registered: February 2010
Location: SURINAME
Junior Member

Hello sir
I uderstand what you said.My question is different.
In parent table contain a column called status.IF status is yes
then we can go to next list2,otherwise it shows u cann't go.ok.which function i can use?
Re: list2 [message #2554 is a reply to message #2553] Tue, 22 June 2010 08:29 Go to previous messageGo to next message
AJM is currently offline  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.


Re: list2 [message #2555 is a reply to message #2554] Tue, 22 June 2010 08:51 Go to previous messageGo to next message
vidhu is currently offline  vidhu
Messages: 14
Registered: February 2010
Location: SURINAME
Junior Member

Hello sir,
I understood .IF i pressed list2 button,the status is yes,it can go further,If i pressed list2 button ,the status is no,i cann't go
.Then ican did scriptPrevious().I want to know which function in class make the realation beween list1 and list2
Re: list2 [message #2556 is a reply to message #2555] Tue, 22 June 2010 10:01 Go to previous message
AJM is currently offline  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.


Previous Topic: drop-down
Next Topic: delete record
Goto Forum:
  


Current Time: Thu Oct 31 20:15:28 EDT 2024

Total time taken to generate the page: 0.01991 seconds