Dynamic lists on web

I have a web dialog list that uses a @DbColumn formula as its selection criteria. However, the user should be able to add new options at any time.

Usually I would just tick “allow values not in list”, but Domino then renders the select as a text input (not what I want). If I don’t do this, the new value is lost on submit (I end up with a blank field).

How can I force Domino to accept the new value without refreshing the page? It seems like this should be really easy to do, but right now I have to use some ridiculous field swapping exercise to retain the new value.

Subject: Dynamic lists on web

You can do this with Javascript. I did it a few years ago based on code I found in this forum. If I can find it, I’ll post it later today.

Subject: RE: Dynamic lists on web

Create an Other button next to the dropdown list with the following javascript code

field = document.forms[0].FIELDNAME;

var _t = prompt(“Insert a new value”,“”);

var _length = field.options.length ;

if (_t == null) {

field.focus();

}

else

{

if (_t !== “”) {

field.options[field.options.length] = new Option(_t,_t,_t,_t);

field.selectedIndex = _length;

}

}

Subject: RE: Dynamic lists on web

Thanks. That would be great.

One thing I have noticed; the new values are available if you use WebQuerySave. If you just call the agent via URL, the field values are blank. However, in both cases, the new values are actually saved to the document as expected! Is this reliable? Is there some kind of race condition here?

If someone could clarify exactly what Domino does with these fields it would be much appreciated. Thanks.

Subject: Dynamic lists on web

You can’t easily do it, because there is no equivalent to the dialog list on the web. There is no web field type that lets you do this. You can programmatically add options to SELECT objects, but not in the UI. You might be able to find a widget using ExtJS or another toolkit that would allow this.

Subject: RE: Dynamic lists on web

Its not like its a front end (browser) limitation at all; its just the Domino server discarding my value when processing the document. Even if you used a third party widget, you might still be defeated at submission time.

The widget in the Notes client is great and it seems like what I am trying to do is the easiest equivalent on the web. It would be great if there was a simple way around this.

Subject: RE: Dynamic lists on web

Unfortunately there’s not. As I said - no equivalent to the dialog list field type on the web. The easiest way to handle it is to have a combobox with your choices, and then a text field. In your WebQuerySave, check to see if there’s a value in the text field. If there is, do a NotesDocument.ReplaceItemValue and put the value from the text field into the dialog list field.

Subject: RE: Dynamic lists on web

sigh

I would just be happy if Domino didn´t insist on rendering diaglog lists as a text input when you want to allow new values then.

Thanks for the responses.