FilteringSelect and Dialog Lists and Firefox
Category None
Bookmark :
A common widget to use is the FilteringSelect which gives us a nice drop down box with the added feature of type ahead. Converting a Domino dialog list to use this widget is pretty simple in all you need to do is add the following to the html attributes of the field:
"dojoType='dijit.form.FilteringSelect' autocomplete='true'"
This works very nicely in IE, but was not working correctly in Firefox. The problem, as it turns out, is with the html output by Domino for the data items to be in the field. Recall that a Notes dialog list converts to an html select object through Domino. So, the html code output would look something like this:
<select name="myField">
<option value="1">One
<option value="2">Two
<option value="3">Three
</select>
The problem in Firefox is a result of Domino not closing the option tags. Where IE will do that for us FF doesn't and causes the widget to display the options incorrectly, if at all. There's a couple of ways around this: You could just hand code the html and, if necessary, compute the values to be displayed. You can also have the list values supplied by a Dojo data store.
In the case of a project I'm working on, we decided to use the data store approach for a variety of reasons. In this case, the stores we're using are json data structures. To use a store, you would modify your html attributes as such:
"dojoType='dijit.form.FilteringSelect' autocomplete='true' store='myKeywordStore'"
Now, this works great, but did lead to one last issue. How to display the currently selected value. Since Domino is not supplying the options, there's not one set to be "selected". A simple formula in our html attributes statement clears this up:
"dojoType='dijit.form.FilteringSelect' autocomplete='true' store='myKeywordStore' value='" + myField + "'"
If you have a default value you want selected if the field value is empty, then you could do something like this:
"dojoType='dijit.form.FilteringSelect' autocomplete='true' store='myKeywordStore' value='" + @If(myField!=""; myField; "Choose One") + "'"
Bookmark :
A common widget to use is the FilteringSelect which gives us a nice drop down box with the added feature of type ahead. Converting a Domino dialog list to use this widget is pretty simple in all you need to do is add the following to the html attributes of the field:
"dojoType='dijit.form.FilteringSelect' autocomplete='true'"
This works very nicely in IE, but was not working correctly in Firefox. The problem, as it turns out, is with the html output by Domino for the data items to be in the field. Recall that a Notes dialog list converts to an html select object through Domino. So, the html code output would look something like this:
<select name="myField">
<option value="1">One
<option value="2">Two
<option value="3">Three
</select>
The problem in Firefox is a result of Domino not closing the option tags. Where IE will do that for us FF doesn't and causes the widget to display the options incorrectly, if at all. There's a couple of ways around this: You could just hand code the html and, if necessary, compute the values to be displayed. You can also have the list values supplied by a Dojo data store.
In the case of a project I'm working on, we decided to use the data store approach for a variety of reasons. In this case, the stores we're using are json data structures. To use a store, you would modify your html attributes as such:
"dojoType='dijit.form.FilteringSelect' autocomplete='true' store='myKeywordStore'"
Now, this works great, but did lead to one last issue. How to display the currently selected value. Since Domino is not supplying the options, there's not one set to be "selected". A simple formula in our html attributes statement clears this up:
"dojoType='dijit.form.FilteringSelect' autocomplete='true' store='myKeywordStore' value='" + myField + "'"
If you have a default value you want selected if the field value is empty, then you could do something like this:
"dojoType='dijit.form.FilteringSelect' autocomplete='true' store='myKeywordStore' value='" + @If(myField!=""; myField; "Choose One") + "'"


Comments
L:= CurrencyList;
@Transform(L;"V";@LeftBack(V;"|")+"[</option>]|"+@RightBack(V;"|"))
I use this in Comboboxes' "Use formula for choices" box.
This assumes that the CurrencyList above has a format "Label1|Value1":"Label2|Value2" etc.
Irritating behaviour from the Firefox. (ok, maybe Domino is really to blame here...)
Posted by L. Laanti At 08:22:27 PM On 12/20/2007 | - Website - |
Posted by Steve At 01:32:31 AM On 12/21/2007 | - Website - |