Searchable drop down menu? | Adobe Higher Education
Skip to main content
Level 2
November 5, 2009
Risolto

Searchable drop down menu?

  • November 5, 2009
  • 66 risposte
  • 37591 visualizzazioni

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.

Questo argomento è stato chiuso alle risposte.
Migliore risposta di 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 risposte

tarekahf
Level 8
December 28, 2010

Bruce,

Just to say thank you. I will use your sample in my forms for DDL.

Tarek.

Bibhu_Bikash_Na
Level 10
December 28, 2010

Hello Bruce,

I am really glad that you find time to guide me in this. Is it possible to write the code that will delete the data connection befote submitting the form. I mean to say the user first import the xml file into the form and fill the form and clicks the submit button. When the user clicks the submit button which would send it as xml , can we write some script in the pre submit event of the form so that it would delete the data connection ? If yes, could you please give me the example? One more thing would the script work as expected in Adobe Reader 8/9. I am using LiveCycle Designer ES 8.2.

Thanks.

Bibhu.

_Bruce_Robertson
Level 10
December 30, 2010

Hi Bibhu,

You should be able to delete nodes in your data connection using the following code in the preSubmit event.

$record.nodes.remove($record.dataroot);

This will remove all xml nodes in the data connection from dataroot down ... so you will probably have to change the code to match your requirements but hopefully you get the idea.

Good luck.

Bruce

Bibhu_Bikash_Na
Level 10
December 30, 2010

Hello Bruce,

I first put a button on my form to test it whether it's working or not. In the click event of the button in the JavaScript I have put the cose as you have said.But I get the following error.

When I used it in FormCalc I got the following error.

accessor $record.datarot is unknown. I am confused , how to do it ? More over like you said I have to put it in pre-submit event. So where should I put it ? In the parent subform or by creating a button and putting the script in the click event and then calling that event in the submit button ?? Please help ..I am going mad about this XML..

Thanks.

Bibhu.

_Bruce_Robertson
Level 10
December 30, 2010

Hello Bibhu

This code is JavaScript but as I don't know the structure of your data connection this is just an example, you will have to change the "$record.dataroot" to suit your data connection structure ... the error you are getting would suggest that "$record.dataroot" does not exist.  You may also have to change the "$record.nodes" part.  The remove method will remove the specified node and all its child nodes so the first "$record" should refer to the parent of the node you want to delete and "$record.dataroot" should relate to the node you want to delete.

Regards

Bruce

Bibhu_Bikash_Na
Level 10
December 30, 2010

Hello Bruce,

I am attaching here the dataview panel as well as the hierarchy panel here. Please have a look and kindly suggest the code to write where and how ? The name of the XML file am ttaching is Information.xml. Does the name of the XMl file has to play any role here ?

Thanks a lot for having the patience to help me.

Bibhu.

_Bruce_Robertson
Level 10
December 30, 2010

Hello Bibhu,  I am not sure what data you wish to remove.  Somthing like

$record.nodes.remove($record.ItemInformation);

Should remove the ItemInformation node and all the nodes below it.

I don't think it matters were the code goes, whatever makes sense to you.  Maybe the preSubmit of the top form element or maybe the preSubmit of the button on your form.

Bruce

Bibhu_Bikash_Na
Level 10
December 31, 2010

Hello Bruce,

I did the same as you have said. But I do not know why it's sending all the embeded XML data ?? Where am I wrong ?

Thanks.

Bibhu.

Bibhu_Bikash_Na
Level 10
December 31, 2010

Hello Bruce,

One interesting observation I have made. I have kept this code : $record.nodes.remove($record.CustomerInformation); in the click event of a button and I have repeatedly clicked it. I saw it' s gradually removing the nodes. Is it possible to loop through all the nodes by a single click and exclude the choice that we have made in the dropdown , so that it would send the xml of the dropdown as well as it's associated field value which are present in the same node as of the dropdown in the xml .

Thanks a lot for guding me in this complex implementation.

Wishing you and your family a Very Happy New Year 2011 

Bibhu.

Level 2
July 12, 2011

I'm getting an error message when I double click on one of the list items to populate the search field.  Can someone help me populate the search field with the selected list item when clicked?? Here is the message I'm getting.