nbuytaert1 / apex-select2

Select lists in Oracle APEX as they should be
https://apex.oracle.com/pls/apex/f?p=64237:20
GNU General Public License v2.0
56 stars 18 forks source link

issue at multiple values load #76

Closed jDimitrako closed 7 years ago

jDimitrako commented 7 years ago

I try everything but without success. I separate value with colon to the page item (e.g. 7839:7521) but nothing at all. If there are more than one value,it show nothing. If there only one,it show the first value. I work on 5.1

nbuytaert1 commented 7 years ago

Are you setting the value client or server side? You can set multiple values using JavaScript like this:

apex.jQuery("#P10_MY_ITEM").val(["7839","7521"]).trigger("change");

Or you can use a default value for the page item. In that case, you just have to enter 7839:7521 as a static value.

jDimitrako commented 7 years ago

Goodmorning, I load the values from the server side. It works with static values but thats not our target. The jquery code is a step forward. Now i must try to make this work with apex item array.

Thanks, any further help will appreciate, James

nbuytaert1 commented 7 years ago

Can you reproduce your issue on apex.oracle.com and grant me workspace access? That's the easiest way for me to help you further.

jDimitrako commented 7 years ago

To be honest and not be annoying, you gave me some solution to solve my problem Nick, so close the issue. To be more specific, now i must try to give value from a apex text field with array(1234:1232:1242),which load values from table.

By the way you gave us a lot of fuctionality with your plugins. Keep the good work.

nbuytaert1 commented 7 years ago

Use a hidden item on your page that contains the values (for example: 16:15:117). Then you can use the JavaScript split function to transform the values into an array:

apex.jQuery("#P10_MY_ITEM").val($v("P10_HIDDEN_ITEM").split(':')).trigger("change");

jDimitrako commented 7 years ago

Solved. Thank you very much!!!