How to set pre-selected values in Select2 APEX plugin?









up vote
0
down vote

favorite












I have a page 100 with a Classic Report table region p100_report. It renders with a query similar to this:



select id, pages_list from (
select id, listagg(col_page, ':') within group (order by col_page) as pages_list
from t1
group by id
order by id
) t1_lag;


So if t1 is a table like this:



|id|col_page |
|--|---------|
| 1| 102|
| 1| 103|
| 1| 500|
| 1| 600|
| 2| 101|
| 2| 102|
| 2| 103|


then t1_lag is a table like this:



|id| pages_list|
|--|---------------|
| 1|102:103:500:600|
| 2| 101:102:103|


Each cell in p100_report table, pages_list column contains a link to the modal page 200. It has Select2 Multi-select item called p200_pages_s2.



List of values for p200_pages_s2:



|pageID|pageName|
|------|--------|
| 100|Main |
| 101|First |
| 102|Second |
| 103|Third |
| 200|Modal |
| 500|Admin |
| 600|Log |


It uses pageID for submits and pageName for Select2 lis display correctly.



I try to send specific page_list values to page 200 with Link > Target > Set Items, assigning #PAGES_LIST# value (for example, 101:102:103) to the P200_PAGES_S2.



In session state it has required colon separated string value, but GUI part is empty. I tried different Dynamic Actions with Submit, Refresh, even some JS code from here, but nothing seems to work.



The problem: I need to set pre-selected values in ul.select2-selection__rendered, add an interactive working li for each value from the colon separated list. Any advice?










share|improve this question



















  • 1




    About sending the value from one page to another may not be necessary. You can access the item on page 1 on page 99 as long as the value of the item is in the session. If do you need to send the value to another page, I think there might be a problem with the URL that is formed. Colon has a meaning in the URL of apex, I think you need to escape the values... community.oracle.com/thread/1064677
    – romeuBraga
    Nov 9 at 15:48










  • @romeuBraga No, afaik, that's not the problem. I'm already escaping colons with backslashes. The value transition works. The problem is that Select2 doesn't draw values as interactive list items in the form.
    – VELFR
    17 hours ago











  • Are you trying to do this? >>> apex.oracle.com/pls/apex/f?p=145797:32:0::::P32_NEW:1:4 <<< Please copy all the url between >>> URL <<< In this case, i'm setting the pre-selected values to 1 and 4, you can change to values between 1..4
    – romeuBraga
    11 hours ago















up vote
0
down vote

favorite












I have a page 100 with a Classic Report table region p100_report. It renders with a query similar to this:



select id, pages_list from (
select id, listagg(col_page, ':') within group (order by col_page) as pages_list
from t1
group by id
order by id
) t1_lag;


So if t1 is a table like this:



|id|col_page |
|--|---------|
| 1| 102|
| 1| 103|
| 1| 500|
| 1| 600|
| 2| 101|
| 2| 102|
| 2| 103|


then t1_lag is a table like this:



|id| pages_list|
|--|---------------|
| 1|102:103:500:600|
| 2| 101:102:103|


Each cell in p100_report table, pages_list column contains a link to the modal page 200. It has Select2 Multi-select item called p200_pages_s2.



List of values for p200_pages_s2:



|pageID|pageName|
|------|--------|
| 100|Main |
| 101|First |
| 102|Second |
| 103|Third |
| 200|Modal |
| 500|Admin |
| 600|Log |


It uses pageID for submits and pageName for Select2 lis display correctly.



I try to send specific page_list values to page 200 with Link > Target > Set Items, assigning #PAGES_LIST# value (for example, 101:102:103) to the P200_PAGES_S2.



In session state it has required colon separated string value, but GUI part is empty. I tried different Dynamic Actions with Submit, Refresh, even some JS code from here, but nothing seems to work.



The problem: I need to set pre-selected values in ul.select2-selection__rendered, add an interactive working li for each value from the colon separated list. Any advice?










share|improve this question



















  • 1




    About sending the value from one page to another may not be necessary. You can access the item on page 1 on page 99 as long as the value of the item is in the session. If do you need to send the value to another page, I think there might be a problem with the URL that is formed. Colon has a meaning in the URL of apex, I think you need to escape the values... community.oracle.com/thread/1064677
    – romeuBraga
    Nov 9 at 15:48










  • @romeuBraga No, afaik, that's not the problem. I'm already escaping colons with backslashes. The value transition works. The problem is that Select2 doesn't draw values as interactive list items in the form.
    – VELFR
    17 hours ago











  • Are you trying to do this? >>> apex.oracle.com/pls/apex/f?p=145797:32:0::::P32_NEW:1:4 <<< Please copy all the url between >>> URL <<< In this case, i'm setting the pre-selected values to 1 and 4, you can change to values between 1..4
    – romeuBraga
    11 hours ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have a page 100 with a Classic Report table region p100_report. It renders with a query similar to this:



select id, pages_list from (
select id, listagg(col_page, ':') within group (order by col_page) as pages_list
from t1
group by id
order by id
) t1_lag;


So if t1 is a table like this:



|id|col_page |
|--|---------|
| 1| 102|
| 1| 103|
| 1| 500|
| 1| 600|
| 2| 101|
| 2| 102|
| 2| 103|


then t1_lag is a table like this:



|id| pages_list|
|--|---------------|
| 1|102:103:500:600|
| 2| 101:102:103|


Each cell in p100_report table, pages_list column contains a link to the modal page 200. It has Select2 Multi-select item called p200_pages_s2.



List of values for p200_pages_s2:



|pageID|pageName|
|------|--------|
| 100|Main |
| 101|First |
| 102|Second |
| 103|Third |
| 200|Modal |
| 500|Admin |
| 600|Log |


It uses pageID for submits and pageName for Select2 lis display correctly.



I try to send specific page_list values to page 200 with Link > Target > Set Items, assigning #PAGES_LIST# value (for example, 101:102:103) to the P200_PAGES_S2.



In session state it has required colon separated string value, but GUI part is empty. I tried different Dynamic Actions with Submit, Refresh, even some JS code from here, but nothing seems to work.



The problem: I need to set pre-selected values in ul.select2-selection__rendered, add an interactive working li for each value from the colon separated list. Any advice?










share|improve this question















I have a page 100 with a Classic Report table region p100_report. It renders with a query similar to this:



select id, pages_list from (
select id, listagg(col_page, ':') within group (order by col_page) as pages_list
from t1
group by id
order by id
) t1_lag;


So if t1 is a table like this:



|id|col_page |
|--|---------|
| 1| 102|
| 1| 103|
| 1| 500|
| 1| 600|
| 2| 101|
| 2| 102|
| 2| 103|


then t1_lag is a table like this:



|id| pages_list|
|--|---------------|
| 1|102:103:500:600|
| 2| 101:102:103|


Each cell in p100_report table, pages_list column contains a link to the modal page 200. It has Select2 Multi-select item called p200_pages_s2.



List of values for p200_pages_s2:



|pageID|pageName|
|------|--------|
| 100|Main |
| 101|First |
| 102|Second |
| 103|Third |
| 200|Modal |
| 500|Admin |
| 600|Log |


It uses pageID for submits and pageName for Select2 lis display correctly.



I try to send specific page_list values to page 200 with Link > Target > Set Items, assigning #PAGES_LIST# value (for example, 101:102:103) to the P200_PAGES_S2.



In session state it has required colon separated string value, but GUI part is empty. I tried different Dynamic Actions with Submit, Refresh, even some JS code from here, but nothing seems to work.



The problem: I need to set pre-selected values in ul.select2-selection__rendered, add an interactive working li for each value from the colon separated list. Any advice?







jquery-select2 oracle-apex-5.1






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 12:46

























asked Nov 9 at 12:38









VELFR

9511




9511







  • 1




    About sending the value from one page to another may not be necessary. You can access the item on page 1 on page 99 as long as the value of the item is in the session. If do you need to send the value to another page, I think there might be a problem with the URL that is formed. Colon has a meaning in the URL of apex, I think you need to escape the values... community.oracle.com/thread/1064677
    – romeuBraga
    Nov 9 at 15:48










  • @romeuBraga No, afaik, that's not the problem. I'm already escaping colons with backslashes. The value transition works. The problem is that Select2 doesn't draw values as interactive list items in the form.
    – VELFR
    17 hours ago











  • Are you trying to do this? >>> apex.oracle.com/pls/apex/f?p=145797:32:0::::P32_NEW:1:4 <<< Please copy all the url between >>> URL <<< In this case, i'm setting the pre-selected values to 1 and 4, you can change to values between 1..4
    – romeuBraga
    11 hours ago













  • 1




    About sending the value from one page to another may not be necessary. You can access the item on page 1 on page 99 as long as the value of the item is in the session. If do you need to send the value to another page, I think there might be a problem with the URL that is formed. Colon has a meaning in the URL of apex, I think you need to escape the values... community.oracle.com/thread/1064677
    – romeuBraga
    Nov 9 at 15:48










  • @romeuBraga No, afaik, that's not the problem. I'm already escaping colons with backslashes. The value transition works. The problem is that Select2 doesn't draw values as interactive list items in the form.
    – VELFR
    17 hours ago











  • Are you trying to do this? >>> apex.oracle.com/pls/apex/f?p=145797:32:0::::P32_NEW:1:4 <<< Please copy all the url between >>> URL <<< In this case, i'm setting the pre-selected values to 1 and 4, you can change to values between 1..4
    – romeuBraga
    11 hours ago








1




1




About sending the value from one page to another may not be necessary. You can access the item on page 1 on page 99 as long as the value of the item is in the session. If do you need to send the value to another page, I think there might be a problem with the URL that is formed. Colon has a meaning in the URL of apex, I think you need to escape the values... community.oracle.com/thread/1064677
– romeuBraga
Nov 9 at 15:48




About sending the value from one page to another may not be necessary. You can access the item on page 1 on page 99 as long as the value of the item is in the session. If do you need to send the value to another page, I think there might be a problem with the URL that is formed. Colon has a meaning in the URL of apex, I think you need to escape the values... community.oracle.com/thread/1064677
– romeuBraga
Nov 9 at 15:48












@romeuBraga No, afaik, that's not the problem. I'm already escaping colons with backslashes. The value transition works. The problem is that Select2 doesn't draw values as interactive list items in the form.
– VELFR
17 hours ago





@romeuBraga No, afaik, that's not the problem. I'm already escaping colons with backslashes. The value transition works. The problem is that Select2 doesn't draw values as interactive list items in the form.
– VELFR
17 hours ago













Are you trying to do this? >>> apex.oracle.com/pls/apex/f?p=145797:32:0::::P32_NEW:1:4 <<< Please copy all the url between >>> URL <<< In this case, i'm setting the pre-selected values to 1 and 4, you can change to values between 1..4
– romeuBraga
11 hours ago





Are you trying to do this? >>> apex.oracle.com/pls/apex/f?p=145797:32:0::::P32_NEW:1:4 <<< Please copy all the url between >>> URL <<< In this case, i'm setting the pre-selected values to 1 and 4, you can change to values between 1..4
– romeuBraga
11 hours ago


















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53225859%2fhow-to-set-pre-selected-values-in-select2-apex-plugin%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53225859%2fhow-to-set-pre-selected-values-in-select2-apex-plugin%23new-answer', 'question_page');

);

Post as a guest














































































Popular posts from this blog

How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

Syphilis

Darth Vader #20