Adding a new list value from the drop down on a form

rated by 0 users
This post has 10 Replies | 4 Followers

Top 50 Contributor
Posts 51
Points 705
RonCK Posted: Wed, Jun 3 2009 3:37 PM

I know I've seen another post about this.  I want to include the option for a user to add a "missing" entry to a list from a form that uses the list as a dropdown menu.  Anyone remember this?

 

thanks,

RonCK

  • | Post Points: 35
Top 25 Contributor
Posts 93
Points 1,390

RonCk

I wrote some Javascript code to do this.  It may take me a day or two to find it (I am very busy on a project).  I will post it then

 

Terry Stickel, PDM Consultant

TStickel Consulting

Sanibel, Florida

  • | Post Points: 5
Top 10 Contributor
Posts 178
Points 1,240
SamsAn replied on Fri, Jun 5 2009 5:11 AM

Call javascript like below:

var selectObj = document.all.field_name_to_insert_value_into;

//var selectObj = getFieldByName("field_name_to_insert_value_into"); //is alternate code line

var opt = document.createElement("OPTION");

selectObj.options.add(opt);

opt.innerText = "missing entry text";

opt.value = "missing entry value";

 

 

 

SamsAn.
Original Mind Any Level Innovator Solutions Free-Lancer, http://sites.google.com/site/caraacc

  • | Post Points: 35
Top 25 Contributor
Posts 93
Points 1,390

RonCK

SamsAn's code will do what you asked for.  The solution I wrote is more complicated because it had to meet the following partial set of requirements (let me know if you still want me to look for this code):

1. Automatically inserts an <Add> selection for designated for Selection Lists, unless the Form is not opened for update.  The Selection LIsts do not have to be pre-populated with the <Add> selection.

2. If the user selects <Add> then a pop-up window will be displayed that allows the user to enter a new text/value combination for the Selection List.  This pop-up window is the same one that appears if the user had the privilege to add a record to the list via /Administrator/Lists.  Thus, the new entry is reflected in the List on the Form and in the Innovator database.

3. After the user adds a new text/value combination then it will be automatically selected in the forms Selection List

4. When a Form is displayed/re-displayed then the Selection Lists will automatically be re-populated with the latest values from the database.  This over-comes the biggest problem with Innovator "out-of-the-box" lists, they are not dynamically repopulated (ie. In Innovator 9.0.1 if the list contains 3 text/value pairs when user A logs on the Innovator and displays a form that uses the list, then the Administrator adds a 4th text/value pair in another Innovator session, even if user A refreshes the form display they will not see the 4th text/value pair unless they log off Innovator and log back on).

Terry Stickel, PDM Consultant

TStickel Consulting

Sanibel, Florida

  • | Post Points: 20
Top 50 Contributor
Posts 51
Points 705
RonCK replied on Fri, Jun 5 2009 4:59 PM

Terry, 

That would be great if you could dig that code up this weekend.  I've done my best to give users excellent starting Filter Lists, but I know there will be oversights.  I would like them to be able to augment the filter lists.  They would need the pop-up window to have Value/Label/Filter. 

thanks,

RonCK

  • | Post Points: 20
Top 25 Contributor
Posts 93
Points 1,390

The code and some description can be found at http://www.aras.com/Community/wikis/kb/itemtype-list.aspx

It may not do exactly what you are looking for, but it has provided a facility users at one of my customer's sites to dynamically add entries to selection lists.

Terry Stickel, PDM Consultant

TStickel Consulting

Sanibel, Florida

  • | Post Points: 35
Top 50 Contributor
Posts 51
Points 705
RonCK replied on Tue, Jun 9 2009 2:53 PM

Thanks for posting that Terry.  I'm going to get someone on my team trying that right away.  We'll need to adjust it as we are using Filter Lists.  We'll post what we come up with once we get it working.

 

Thanks,

RonCK

  • | Post Points: 20
Top 25 Contributor
Posts 93
Points 1,390
tstickel replied on Wed, Jun 10 2009 1:12 PM

My code will already handle a type of list filtering (see "itemwhere" in the method kLoadList).

Terry Stickel, PDM Consultant

TStickel Consulting

Sanibel, Florida

  • | Post Points: 20
Top 500 Contributor
Posts 2
Points 25
JLS replied on Fri, Jun 12 2009 9:03 AM

 I was wondering what if instead of a popup window, the method opens the "edit list" window on <add> click event and have the users enter the values in the list itself.

Any ideas on how to do this?

 

  • | Post Points: 5
Top 100 Contributor
Posts 15
Points 255

Thanks SamsAn, That was totaly solution what i need.. 

  • | Post Points: 5
Top 500 Contributor
Posts 3
Points 35
Arunkumar replied on Fri, Sep 21 2012 1:16 AM

Hi tstickel,

       This Coding( http://www.aras.com/Community/wikis/kb/itemtype-list.aspx) Working only on IE8. I am using IE9 but Doesn't Working IE9.So Please any one helping how to this script working on IE9.

 

Thanks & Regards,

   Arunkumar

  • | Post Points: 5
Page 1 of 1 (11 items) | RSS