Page 1 of 1

Selections that auto populate other selections

Posted: Wed Nov 20, 2013 2:58 pm
by altamative
I am working on a data entry program -- and I am having issues with a couple things.

First off I need some help with Option menus.

I need option menus that can be dynamically changed based off the selection of another. For example:

Option Menu A has : House, Car, Kids, Cheese

If someone chooses "House" I need for Option Menu B to then say:

Option Menu B: Apartment, Condo, Beach, Duplex

Basically Option B dynamically changes based off what Option A does.



Second - I am trying to aggregate multiple data "text" fields into a datagrid on a separate card.

For Example On my main card I have:

Name _______ Age _______ Email______ Phone_________

When I click a submit button, I want any text in those fields to be saved to a data grid

Name _Steve__ Age _41_ Email ____ Phone __555-1212__


Click Submit

New data grid with already set columns that now contains that info. Any help would be great --- I am going nuts here trying to get this to work.

Thanks in advance!!!

Re: Selections that auto populate other selections

Posted: Wed Nov 20, 2013 3:52 pm
by dunbarx
Hi.

Quickly, I would say you might create a few custom properties of the "main" option menu, so that one of them, named, say, "house", has the contents:

apartment
condo
beach
duplex

Then when you run your menuPick handler you simply:

put the house of me into comboBox "B" --this likely derived from the pItem in a switch construction or whatever.

As for the datagrid, this is organized as a tab and return delimited gadget, though it contains enormous additional functionality. But you can simply:

set the dgText of group "yourDG" to tabAndeturnDelimitedText

Try it by hand. But you need to check out the dataGrid manual.

Craig Newman

Re: Selections that auto populate other selections

Posted: Wed Nov 20, 2013 9:39 pm
by Klaus
Hi altamative,

please check the attached stack for your option menu problem :D

For the datagrid:
You said you have all neccessary columns already created, means like in your example
Name _Steve__ Age _41_ Email ____ Phone __555-1212__
name
age
email
phone

Right?

OK, then you need to create an array:
...
put "Steve" into tArray["name"]
put "41" into tArray["age"]
put "" into tArray["email"]
put "555-1212" into tArray["phone"]
## and "disaptch" the message "addData" to your datagrid with the array
disaptch "addData" to grp "your datagrid here..." with tArray
...
That will append the new data at the bottom of the datagrid.


Best

Klaus