Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I improve the ability to select a value from a dialog list (Domino R5 web)

Posted on 2006-07-20
22
Medium Priority
?
385 Views
Last Modified: 2013-12-18
I have a field called "AI_ServerName"

It is a dialog list with selection formula:
"[not selected]" :
"**SERVER NOT LISTED**" :
@DbColumn( "": "NoCache" ; "" : "" ; "AIServers"; 1)

It has about 1400 records.  When a user wants to select a value.  Let's say for example a value like "dn0325" (which is a server name)...the system only takes the user to the "D" section of the list. Then if the user selects "DN", the system takes the user to "N" section of the list.   Is there a better way to improve this.  I was thinking of a empty text field where a user enters the value, and then presses an action button, and the dropdown list will populate the value or if not on the list, will show the value "Server Not Listed".

Is this possible?

Thx Anna
0
Comment
Question by:mermaidink
[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
  • 11
  • 6
  • 3
22 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17147193
Yes, it's possible, somewhat like this:

- a field AlServers, CfD, multi-value, formula
    @DbColumn( "": "NoCache" ; "" : "" ; "AIServers"; 1)

- a field SomeAIServers, Computed, multi-value, formula:
    @If(SomeAIServers=""; AIServers; SomeAIServers)

- a field "AI_ServerName", editable, as it is, with option-formula
    SomeAIServers
-
- a field ServerPartial that allows you to input a partial name, editable

- a button with the formula
    If(ServerPartial=""; @Return(""); "");
    @SetField("SomeAIServers"; ServerPartial + @Trim(@Right(AIServers; ServerPartial))
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17147225
Hm, at the end of the button, you need to refresh the form:
    If(ServerPartial=""; @Return(""); "");
    @SetField("SomeAIServers"; ServerPartial + @Trim(@Right(AIServers; ServerPartial)));
    @Command([ViewRefreshFields])
0
 

Author Comment

by:mermaidink
ID: 17147324
What is the purpose of ServerPartial (which you said above "allows you to input a partial name, editable"
Would the user be using ServerPartial and then press the button?

I will do a test form with a scenario like this to undersatnd it more...
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17147538
That's the general idea yes.
0
 

Author Comment

by:mermaidink
ID: 17147621
I am trying to save my form after doing the new fields in designer and error says
"No formula specified for computed field AIServers"

I did the AIServers field like this (as per what you said).
dialog list, computed for display, and in the USE formula for choices box, I put:
@DbColumn( "": "NoCache" ; "" : "" ; "AIServers"; 1)

Did I do that field correctly?
0
 

Author Comment

by:mermaidink
ID: 17147632
I forgot to select "Allow multiple values" (put a checkmark) for the AIServers field...
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17147670
No, field is not correct, it shouldn't be a selection field, but just a text field, multi-value, and as computed value
    @DbColumn( "": "NoCache" ; "" : "" ; "AIServers"; 1)
0
 

Author Comment

by:mermaidink
ID: 17147685
I still get that error when I put a checkmark in the AIServers field.

Also I am not sure if I did the AI_ServerName field correctly. You said:

- a field "AI_ServerName", editable, as it is, with option-formula
    SomeAIServers

I put in the default "SomeAIServers" formula in the default value space of the field. I'm not sure what you meant..
0
 

Author Comment

by:mermaidink
ID: 17147859
This is what I saw for each field.


I created a document

Field 1 (AIServers) had many values appearing
AIA4002, AIA4004, AIA4005, AIA4010, AIA4011, AIA4015/DM1CMK, AIA4017, AIA4023, AIA4024, AIA4028, AIA5006,

Field 2: AI Servers had the same thing happening. All the values appearing.  

Field 3: AI_ServerName field had a value selected (even though I didn't select it or touch it. It was just at any vlaue)

Field 4: PartialServer field (text box) where user enters in the servername and presses search appeared normally.

I enter in a server name and press search..then it populates Field 2 (AIServers) but Field 1(AIServers) still shows all those multiple values from the dbcolumn and the Field 3 is stuck at a value which is not selected by the user.  Is FIeld 3 (AI_ServerName) really needed.

I also wondered can we add a clear action to delete the PartialServer field?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17147967
It should work but maybe I didn't describe the technique well enough. The idea is to have a complete list of all servers (the field AIServers), to have one field for the user to enter the first few letters (PartialServer), the button that matches the PartialServer with AIServers with output in a field SomeServers, and a dialog list field that selects its options from SomeServers.

Come to think of it, a PickList might be exactly what you need. Try a button with:
    x:= @PickList( [CUSTOM] : [SINGLE] ; @DbName ; "AIServers"; Available Servers" ; "Select your server" ; 1);
    @If(x=""; ""; @SetField("AI_ServerName"; x)
0
 

Author Comment

by:mermaidink
ID: 17148482
I will take a look and see if I did it all properly.
0
 

Author Comment

by:mermaidink
ID: 17148721
When I put that PickList code in a button (from above), I got a notice on the bottom of the box

An operator of semicolon was expected but none was encountered "Servers".  It highlights the word Servers in red in the box or white space where the code is placed.  I noticed that you have one quotation after the word, like this:
Available Servers"
 
x:= @PickList( [CUSTOM] : [SINGLE] ; @DbName ; "AIServers"; Available Servers" ; "Select your server" ; 1);
@If(x=""; ""; @SetField("AI_ServerName"; x)

I thought @PickList was for the web? I am doing a web form.
0
 

Author Comment

by:mermaidink
ID: 17149485
I am not bothering with the PIcklist anymore.

About the orginal method...

 a text field AlServers, CfD (then you later said computed), multi-value, formula
    @DbColumn( "": "NoCache" ; "" : "" ; "AIServers"; 1)
This field is hidden to user because it displays all the server values.

- a field SomeAIServers, Computed, multi-value, formula:
    @If(SomeAIServers=""; AIServers; SomeAIServers)

- a field "AI_ServerName", editable, as it is, with option-formula
    SomeAIServers

- a field ServerPartial that allows you to input a partial name, editable

- Search button with the formula
   If(ServerPartial=""; @Return(""); "");
    @SetField("SomeAIServers"; ServerPartial + @Trim(@Right(AIServers; ServerPartial)));
    @Command([ViewRefreshFields])

What I am finding is that user enters in a text value into the ServerPartial field then presses Search button.
Then SomeAIServers field shows the same value which was entered in the ServerPartial field in read only display (I hide this from user).

AI_ServerName does not do anything.  I wonder if the refresh is working (does it need to execute an agent?)
The other problem still is when the user enters in a value that does not exist in the server list, the SomeAIServers field does not indicate "Value not in list"..

0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 1000 total points
ID: 17149854
Oooh, I'm so very sorry! I missed that detail, it's a web-form. Me very bad. Is it a web-only form??

Now, there's some bad news, and there's good news.
The bad news is that the earlier method is wrong, most likely, or too difficult. It would also require a refresh by the server, which takes time and isn't very user-friendly.
The good news is that it can probably be done using JavaScript.

But... Not easy. It's getting rather late over here, so I'll give you the general idea, with some links. You can have some JavaScript monitoring a temporary field. When the data in the field is changed, the available options in the dialog box should be changed. I think it can be done, but it must be thoroughly tested on several browsers.

See also:
    http://www.quirksmode.org/js/options.html
    http://www.mredkj.com/tutorials/tutorial005.html
0
 
LVL 63

Assisted Solution

by:Zvonko
Zvonko earned 1000 total points
ID: 17151914
Thanks Sjef for inviting me. I have made several keyboard controlled select lists but have none of them tested with Domino. They all should work from start with Domino, but as you know: before you did not test you do not know ;-)
I am now at home and will be in about two hours at my machine where I can test that.

Meanwhile Anna you could you post the snippet of the html page where the DialogList is displayed in browser page html source. Of course reduce the options to ten or so.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 17153374
Here an old answer I tested with Domino: http:Q_20732817.html
You need this for the Field AI_ServerName onKeyUp event handler web JavaScript:
selOpt(event, this)

And in Form's JS Header section put this script:
function selOpt(e, theSel){
  if(!theSel.sStr) theSel.sStr="";
  theSel.sStr+=String.fromCharCode(e.keyCode).toLowerCase();
  window.status="Select: "+theSel.sStr;
  l=theSel.sStr.length;
  for(i=0;i<theSel.options.length;i++){
    if(theSel.options[i].value.substr(0,l).toLowerCase()==theSel.sStr){
      theSel.selectedIndex = i;
      return;
    }
  }
  window.status="Select: ";
  theSel.sStr="";
}


If you prefer matching the entered text at ANY position in the options value, then use this version:
function selOpt(e, theSel){
  if(!theSel.sStr) theSel.sStr="";
  theSel.sStr+=String.fromCharCode(e.keyCode).toLowerCase();
  window.status="Select: "+theSel.sStr;
  for(i=0;i<theSel.options.length;i++){
    if(theSel.options[i].value.toLowerCase().match(theSel.sStr)){
      theSel.selectedIndex = i;
      return;
    }
  }
  window.status="Select: ";
  theSel.sStr="";
}


Have a look to browser window status bar to see the stage of matching input.


0
 

Author Comment

by:mermaidink
ID: 17154149
Zwonka, in your comment at 2:18 am, you said for me to take a snippet of the html page where the Dialoglist is displayed in browser page html source.  Do you mean from this site: http://www.mredkj.com/tutorials/tutorial005.html?
with this code?   I read through all the pages you gave.  I am trying to understand this.   If I use the html code, then do I keep my field AI_ServerName and put the html code in the HTML Body attributes of my form?  
Also I saw your most recent post (above this one) and I am confused. Do I use this with the HTML given in Tutorial 5?

The HTML from the tutorial 005
<form>
<input type="button" value="o" onclick="insertOptionBefore(count1++);" />
Insert Before Selected<br />
<input type="button" value="o" onclick="removeOptionSelected();" />
Remove Selected<br />
<select id="selectX" size="10" multiple="multiple">
<option value="original1" selected="selected">Orig1</option>
<option value="original2">Orig2</option>
</select>
<br />
<input type="button" value="o" onclick="appendOptionLast(count2++);" />
Append Last<br />
<input type="button" value="o" onclick="removeOptionLast();" />
Remove Last
</form>

0
 
LVL 63

Expert Comment

by:Zvonko
ID: 17154399

1.) I asked for YOUR page as displayed in browser. If you look in browser for your page then you will see the html source generated by Domino for your Notes Form.

2.) My upper JavaScript has detailed description how to be injected into your Form design. What part of my description do you not understand?

0
 

Author Comment

by:mermaidink
ID: 17155352
Here is the page source as seen in the browser for my notes form called SelectServer:
http://www.mermaidshelf.com/selectserver  (it's a text file)


0
 

Author Comment

by:mermaidink
ID: 17282162
I tried another way.  It's something that was first suggested.  I think there is a way to make it work.

To recap, I have:

Field: AI_ServerName; dialog list; editable with formula: "[not selected]" :
"**SERVER NOT LISTED**" :
@DbColumn( "": "NoCache" ; "" : "" ; "AIServers"; 1)

Field 2: ServerPartial; text; editable

Then I have a Search button: It contains this code:
@If(ServerPartial=""; @Return(""); "");
@SetField("SomeAIServers";ServerPartial+@Trim(@Right(AIServers; ServerPartial)));
@Command([ViewRefreshFields]);
x:= SomeAIServers;
@If(x=""; ""; @SetField("AI_ServerName"; x));
@SetField("ServerPartial";"")

When I search for a value that is in the list, then the dialog box will display that value (I enter value in ServerPartial field and press the search button)

If it is not on the list, then it shows the value "not selected" on the dialog box.  I wondered if there is a way, where it can show "Server not listed in list".

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

704 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