LigerUI --- Combobox, ligerui --- combobox

Source: Internet
Author: User

LigerUI --- Combobox, ligerui --- combobox

Preface:

Suddenly found that from the beginning of the ligerUI conflict, I feel that I have never been in touch with or will not. Now, I feel that some components of ligerUI are quite useful. It may take a long time. Hey ~~~, The drop-down box is a commonly used component. In the previous blog, I also wrote a drop-down box in ligerForm. Here I will write the Combobox drop-down box separately. Take notes ~~~~.....

 

Front-end Page code:

<Script type = "text/javascript"> var sysSearchSelect; $ (function () {// System Selection drop-down box sysSearchSelect =$ ("# sysSearchSelect "). ligerComboBox ({url: '$ {baseURL}/getSystemByAll. action ', valueField: 'systemid', // id textField: 'systemname' of the option value in the drop-down box, // option value in the drop-down box // initValue: 2, systemName} with systemId 2 is selected by default });}); </script> <body> <div position = "left" title = "role"> <div id = "searchbar" class = "l-searchbar"> <div> action:

Private JSONArray arrSystem; public JSONArray getArrSystem () {return arrSystem;} public String getSystemByAll () throws Exception {try {List <System> systemList = systemService. getAll (System. class); arrSystem = new JSONArray (); for (System sys: systemList) {JSONObject obj = new JSONObject (); obj. put ("systemId", sys. getSystemId (); obj. put ("systemName", sys. getSystemName (); arrSystem. add (obj) ;}} catch (Exception e) {throw new BusinessException ("error in getSystemByAll query");} return "getSystemByAll ";}

The drop-down box is relatively simple. In the background, you only need to pass the two fields systemId and systemName required for the foreground page. The front-end can receive data in json format in the background, which requires some processing, in addition to providing the corresponding get Method

In addition, you need to configure the struts. xml file. For specific configuration, refer to the previous blogs (ligerGrid and ligerForm drop-down boxes.

 

Success: Tired, tired, tired .......... I think I'm tired now .........

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.