0

I decided the reformulate the question I asked here into a simpler way.

Is there any way to populate the left hand side of a shuttle dynamically in Oracle Apex ?

I wrote a PL/SQL process that calculates the list of values I want to use for the left side of my shuttle, but I can't manage to append it to it. The calculus is based on a select list item P1_MY_LIST just before the shuttle. The process is triggered when a change happens on that select list.

For now I tried : :P1_MY_SHUTTLE := list_of_values but it obviously populates the shuttle's right side.

Any suggestion on how to do so ? I'm using Apex 19.1

Kabulan0lak
  • 2,116
  • 1
  • 19
  • 34
  • 1
    Hi, I just spent 40 minutes building a sample app to answer your question about shuttles. But then had you deleted the question. Please remember people are spending their work time to help you before you delete a question. – Koen Lostrie Jun 29 '20 at 09:36
  • @KoenLostrie I'm so sorry, I had almost no views on my question and found the answer alone. I never thought someone would be trying hard to help me. I truly feel like the worst ... Should I repost it so you could post an answer? It could be useful for others – Kabulan0lak Jun 30 '20 at 09:47
  • that'd be great. I think you can just undelete it. – Koen Lostrie Jun 30 '20 at 11:24
  • @KoenLostrie I undeleted it: https://stackoverflow.com/questions/62634193/oracle-apex-refresh-item-on-another-item-change Sorry again for the inconvenience. – Kabulan0lak Jun 30 '20 at 12:05

1 Answers1

1

so I played around with shuttles a bit and here is what I came up with.

var left = $("#P1_MY_SHUTTLE ")[0].children[0].children[0].children[0].children[0].children[0]
var right = $("#P1_MY_SHUTTLE ")[0].children[0].children[0].children[0].children[2].children[0]

These two should mark out the left and right panes of the shuttle. Then what you need is

 left.appendChild()

But you cannot just append 'Something' You could play around with this stuff some more and figure out how to correctly add it, it probably means creating a new var with the constructor or something, I dont know.

But a hack for this is

left.appendChild(right.children[0])

Which just moves the first element on the right side to the right. Meaning you can add stuff to the right and move it to the left.

You could also do some code that adds something to the right side, then go through all the options on the right and find which one you just added, and then move it to the left.

Obviously this isnt an elegant solution, hell it might not even work well. But its a start, so now that you have a start you can play around in the console some more and hopefully figure out a perfect solution for your problem.

TineO
  • 1,023
  • 8
  • 24
  • Thanks ! I'm gonna try to work this around, you gave me a great start. I'll try to keep this updated. Cheers – Kabulan0lak Jun 24 '20 at 10:50
  • 1
    Finally I created a db table which I populate using my process, and I use a query on the table to populate the shuttle. Seemed like the best solution. Thanks for you help anyway! – Kabulan0lak Jun 24 '20 at 15:23