Searchable drop down menu? | Community
Skip to main content
New Participant
November 5, 2009
Solved

Searchable drop down menu?

  • November 5, 2009
  • 66 replies
  • 37509 views

I have several drop down lists in a PDF I am creating. These drop down lists contain diagnoses to be used by physicians. With there being a LOT of diagnoses, it would be extremely convenient if I had a "search" function of some kind that could be utilized as the wording of the descriptions for the codes/diagnoses can vary: (Ex. "Rib Pain" or "Pain in Rib")

As of now, the only option is to select the first letter of the name they believe the diagnosis to have. Using this example, they would select the drop down menu and press "R" and the list would jump down to the beginning of the R's. But, if the name is actually "Pain in Rib", they would have to search through all the other diagnosis codes to locate it.

I believe a search function would be the most appropriate for something like this. But, I am having some trouble locating any info on coding for something of this nature. If there are any suggestions that could make this, (or something that accomplishes the same task), possible, I am all ears.

Thanks!

I included a pdf with the fragment with the drop down menus as well as a list of the diagnoses I have in them.

I appreciate any help or ideas. I've never been let down by the people here in these forums.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by tarekahf

I was able to use the Net.HTTP and SOAP object to access the same DMTI service, but it worked only on the console window:

var jData;

var prm =

{cVerb:"GET",

aHeaders: [{name: "Authorization", value:"authentication-token"}],

cURL: "https://app2.dmtispatialxxx.com/servicesxxx/rest/suggest?limit=60&includePostalCode=true&address=20%20crown%20ste",

oHandler: {

   response: function (msg, uri, e) {

    console.println("\nThis is the response method:");

    console.println("msg=" + msg);

    //for (var p in msg) {

    //  console.println("p=" + p);

    //  console.println("msg[p]=" + msg[p]);

    //}

    var data = SOAP.stringFromStream(msg);

    jData = JSON.parse(data);

    console.println("Length of json data: " + jData.length);

    console.println("data=" + data);

    console.println("e=" + e);

   }

}

};

Net.HTTP.request(prm);

Response from the console window:

This is the response method:

msg=[object Stream]

Length of json data: 5

data=[{"matchCount":1,"suggestion":"20 CROWN STEEL DR MARKHAM ON L3R9X9","aliasSuggest":null},{"matchCount":1,"suggestion":"20 CROWN ST QUINTE WEST ON K8V1N6","aliasSuggest":null},{"matchCount":1,"suggestion":"20 CROWN ST ST. CATHARINES ON L2M3L3","aliasSuggest":null},{"matchCount":1,"suggestion":"20 CROWN ST THUNDER BAY ON P7B3J6","aliasSuggest":null},{"matchCount":1,"suggestion":"20 RUE CROWN DANVILLE QC J0A1A0","aliasSuggest":null}]

e=undefined

Unfortunately, the above method didn't work from a the click event of a button (in Adobe LiveCycle form). I got this error:

NotAllowedError: Security settings prevent access to this property or method.

Net.HTTP.request:19:XFA:form1[0]:subform[2]:Button4[0]:click

It looks like the only option now is to develop a wrapper component that can be invoked using the simple URL and to include the authentication token in the query parameters. Also, there is another problem... I have to get authentication code every time it is expired. Currently, there is Java code responsible for this part.

Question:

Why not develop a simple javascript program that can be invoked using HTML or jsp code, and return the result by clearing the output and just dump the result from the xhr response object? While I can develop the server component, but it seems a lot more easier to develop such component using only HTML and javascript. But, I am not  sure if it can be done, I just think it is possible.

66 replies

_Bruce_Robertson
New Participant
November 16, 2010

Hi Bibhu,

There's some code in the change event of the Search textbox that each time a character is entered (or changed) just matches all the values in the its list and populates a listbox with the matching values.

I can't help with you othe question, I've used a webservice for this sort of thing but never tried a direct connection.

Regards

Bruce

Bibhu_Bikash_Na
New Participant
November 2, 2010

Hello Bruce ,

I liked your script. Though it worked for me , I could not get a complete hold of it. I mean how does it perform the action required for ? One more thing I have several connected Dropdowns, if some one selects a name from a drop down (as you select country here) then all the data associated with it in all the drop downs should be auto populated once its selected. I want to use MySQL DB here. I know I have to write some select/update statements here . But I am a bit confused, how to implement it , Would you please guide me in the same ?

Thanks.

Bibhu.

tarekahf
New Participant
September 29, 2010

liked this thread !

New Participant
January 21, 2010

Hi jrhea1984,

Is it possible to post the Problem + Diagnosis menus PDF sample again  without fragment?

It is very intersting the way you have done the searchable Drop down menu even with first letter!

From the Fragment I can not view your Scripts..

There is any way to help me how you did is?

Thanks

New Participant
November 6, 2009

I too think your best option would be a text field and list box as recommended. I probably can't give you a better example than what was already given.

_Bruce_Robertson
New Participant
November 6, 2009

Hi,

I've done something similar using a textbox and a listbox, which I hide when the textbox is empty and populate with matching entries when it is full.

Might be a starting point for you, attached is my demo.

Bruce