Solved

Dialog Box to enter new students to one field.

Posted on 2006-06-21
4
254 Views
Last Modified: 2013-12-18
Have a form where I need to enter the attendance for a class and some user info. I want to do this using a Dialog Box that pops up from say an Add Student button. I will have something like a field for Name, Title and ID. How do I go about setting this up so a trainer can click on the button and a new student will be appended to a common single multi value field. THe way I have it not I have to create a huge table of fields, once row for each student, trying to estimate the greatest number in a class. I know this is not the best way and have seend it done with a clean dialog box, but not sure how exactly it is done.

Any advice is appreciated.

Joe
0
Comment
Question by:jforget1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 16955423
I would create a docment for each stdent, and then have a view that can be used as a lookup.
This is simple, and will alow for added functionality in the future.
You can have a Class  ID and other identifiers so that it will be easy to do a lookup.

I hope this helps !
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 250 total points
ID: 16955627
You can do it in a DialogBox. I have a set of functions and classes that do exactly what you want, even more, because most likely you need both Add and Remove. There is a similar set in the Sandbox somewhere (less advanced of course ;). See
    http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/f2acda4419a5e3cd00256c0e00314e05?OpenDocument
0
 
LVL 18

Assisted Solution

by:marilyng
marilyng earned 250 total points
ID: 16956811
As sjef says, you can do it, but it's a matter of keeping a before and after field.

You have a set of fields that display the nice student information, computed for display, new line for each entry.

Name ->@Word(MyList;"|";1)          Class  ->@Word(MyList;"|";2)      ID->@Word(MyList;"|";3)
Bob                                               Class1                                         BBB
Mary                                             Class2                                         CCC

You have the field (myList) that holds the list:  "Name|Class|ID"
Bob|Class1|BBB
Mary|Class2|CCCC

Then you have three buttons:  Add a student, update a student, remove a student.
And finally you have the magic, let's number the student array so we can figure out which  (although you can cycle through to find the correct record, now in 6.5)  


To add a student, you simply parse the three fields and add it to the list;
To remove one, you select an entry from the list and then remove it
Edit, you select an entry from the list, and remove the entry from the list, but put the entry values back in the fields.

Add Button
---------------------------------------------------------
List:=@Implode(Name:Class:ID;"|");
NewList:=@If(MyList="";List;MyList:List);
@SetField("MyList";NewList);
@SetField("Name";"");
@SetField("Class";"");
@SetField("ID";"");
@Command([ViewRefreshFields])

Remove Button
-----------------------------------------------------------
Nums:="0":"1":"2":"3":"4":"5":"6":"7":"8":"9";
TheseElements:=@Elements(MyList);
ThisList:=MyList;
NumList:=@Subset(@Subset(@Text(@TextToNumber(Nums*+Nums*+Nums));-999);theseElements);
List:=NumList + (". " + @Word(thisList;"|";1));
Selected:=@Prompt([OkCancelList];"Select an Entry";"Select an entry to Remove";"";List);
@If(Selected = "";@Return("");"");
k:=@TextToNumber(@LeftBack(Selected;"."));
Entry:=MyList[k];
NewList:=@If(Entry !="";@Replace(MyList;Entry;"");MyList);
@SetField("MyList";NewList);
@SetField("Name";"");
@SetField("Class";"");
@SetField("ID";"");
@Command([ViewRefreshFields])


Edit Button
-----------------------------------------------------------
Nums:="0":"1":"2":"3":"4":"5":"6":"7":"8":"9";
@If(@Elements(MyList)<1;@Return(@Prompt([Ok];"No List";"There is nothing to edit yet!"));"");
TheseElements:=@Elements(MyList);
ThisList:=MyList;
NumList:=@Subset(@Subset(@Text(@TextToNumber(Nums*+Nums*+Nums));-999);theseElements);
List:=NumList + (". " + @Word(thisList;"|";1));
Selected:=@Prompt([OkCancelList];"Select an Entry";"Select an entry to Remove";"";List);
@If(Selected = "";@Return("");"");
k:=@TextToNumber(@LeftBack(Selected;"."));
Entry:=MyList[k];
NewList:=@If(Entry !="";@Replace(MyList;Entry;"");MyList);
@SetField("MyList";NewList);
@SetField("Name";@Word(Entry;"|";1));
@SetField("Class";@Word(Entry;"|";2));
@SetField("ID";@Word(Entry;"|";3));
@Command([ViewRefreshFields])

------------------------------------------------------

Now, I didn't go through and test for BLANK values, so you might have to do that, but you get the idea.

0
 

Author Comment

by:jforget1
ID: 16960186
Thanks to all I am sure between all this information I will be able to get a good solution together.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question