Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
steviegoneevil
- Posts: 6
- Joined: Thu May 02, 2013 9:23 am
Post
by steviegoneevil » Tue May 07, 2013 1:10 pm
Hey!
I'm currently working on a register type program, and what i want to do is Have a list field on one card with the names of groups, and when you double-click a group, it takes you to another card that displays the group name and allows the user to add students that are associated with that group. I want those names to be "Saved" to that specific group so that when i add names to another group and go back to the first group, It will have the same list of students. I hope that's understandable
Thank you
-
Klaus
- Posts: 14199
- Joined: Sat Apr 08, 2006 8:41 am
-
Contact:
Post
by Klaus » Tue May 07, 2013 1:38 pm
Hi steve,
steviegoneevil wrote:... I hope that's understandable

not really!
We need more info, how do you manage your "info" in the listfield, how does the user add stuff etc...
Maybe you could add a "preopencard" handler that collects all (inlc. the new) infos from the card
where the user has added something. J
Just a guess, since I have no idea about your stack so far...
Best
Klaus
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10331
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Tue May 07, 2013 5:36 pm
Hi.
To see if we get what you mean, make a new mainStack. Make a list field on card 1 with several "group names" in it. Make several more cards, each with a list field, and each with several other distinct names in them. Set the names of those secondary cards to the names of the "groups" in the first card.
In a mouseUp handler on the first card field, navigate to one of the other cards. You can modify the names in the list field on that card all you like, and they will be unique, resident on that card. Is that what you wanted?
Make sure that the "sharedText" property of your secondary list fields is "false". Be careful when you use the word "group" in LC. It means something very specific, and you will likely be using group properties when you make your secondary cards one day. But that is for another time...
Craig Newman
-
dave_probertGA6e24
- Livecode Opensource Backer

- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
-
Contact:
Post
by dave_probertGA6e24 » Tue May 07, 2013 7:57 pm
I just did something almost exactly like this a couple of days ago for my father - who is a teacher.
Sounds to me like you need to get to understand databases - try 'sqlite'. Look at the lesson for it - it's quite easy really.
(Called 'Group' a ClassGroup so as not to be confused with an LC group of controls!)
On Maincard load the ClassGroup from the database
Select a ClassGroup
Go to a card for a ClassGroup (i.e.. Edit ClassGroup!)
Load that ClassGroup list of Students into the card
Add a new Student
Go to Edit Student card
On a save put that student into the database
Go back to ClassGroup card - reload the ClassGroup data.
Whenever you access a ClassGroup card you load the student list for the ClassGroup from the database in the "openCard" handler. Therefore it will always contain the latest data.
If you edit a previous student then you load that student data from the database.
The only thing you need are some numeric identifiers for the ClassGroup and Students.
The whole subject is a bit large to deal with in a single forum post though.
Hope that will help you get started or whatever.
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.