title: How to refresh a select list when another item is changed by a dynamic action?
body: <p>I am using Apex 4.2 and Oracle XE 11G.</p>
  
  <p>I have a fairly complex page but have created a simplified version and imported it into apex.oracle.com and hope someone can suggest the problem.</p>
  
  <p>Note the design may appear a little strange due to the parts i have removed but i think this should be possible.</p>
  
  <p>The design is using the Mobile theme as it will be executed on either desktop or mobile and i was hoping to only need to build one.  Seems there are a few issues with the mobile theme when used on a desktop so might still have to build another GUI later but for now, am just using the mobile one for both desktop and mobile.</p>
  
  <p>I have two elements on the page, an instance type and a version. These will eventually be hidden but are text fields to see what is going on.
  I also have a region for each instance type containing a drop down list with the version of that instance.</p>
  
  <p>If the instance is defined as the main version, there are certain restrictions on which other versions can be used. These relationships are defined in a table called <code>VERSION_LINKS</code>.
  The other table holds the versions that the client has access to.</p>
  
  <p>I have created a dynamic action such that changes to the main version will result in updating  <code>P1_PRIMARY_VERSION</code>.  This field is used in the real application for conditional display of combinations of instances.
  This update works fine.</p>
  
  <p>The problem is, that field is used in the SQL of the second SELECT LIST (<code>P1_RESTRICTED</code>) and so should then be updated to reflect the valid versions from <code>VERSION_LINKS</code> but instead, the field is just blanked when the <code>P1_VERSION</code> select list is changed.</p>
  
  <p>I have created three ways to resolve this and the application on apex.oracle.com reflects all three.</p>
  
  <ul>
  <li>a) Use a refresh dynamic action on change of <code>P1_PRIMARY_VERSION</code> to    refresh <code>P1_RESTRICTED</code> </li>
  <li>b) Use a cascading LOV on <code>P1_RESTRICTED</code> with the parent item set to <code>P1_PRIMARY_VERSION</code> </li>
  <li>c) Use a set value dynamic action on change of <code>P1_PRIMARY_VERSION</code> to set value of <code>P1_RESTRICTED</code> to the SQL it already had.</li>
  </ul>
  
  <p>None of these result in refreshing the list <code>P1_RESTRICTED</code>.</p>
  
  <p>The SQL of <code>P1_RESTRICTED</code> is like this</p>
  
  <pre><code>select vc.version name, vc.version id
     from version_client vc, version_links vl
    where vl.name=:P1_PRIMARY_INSTANCE
      and vl.version=:P1_PRIMARY_VERSION
      and vl.certified_version= vc.version
      and vl.certified_with=vc.name
      and vc.client_id='DMO'
      and vc.name='TWO'
    order by vc.version desc;
  </code></pre>
  
  <p>and running this with the values as follows gives the right answers</p>
  
  <pre><code>select vc.version name, vc.version id
     from version_client vc, version_links vl
    where vl.name='ONE'
      and vl.version='1.0'
      and vl.certified_version= vc.version
      and vl.certified_with=vc.name
      and vc.client_id='DMO'
      and vc.name='TWO'
    order by vc.version desc;
  </code></pre>
  
  <p>displays 1.1.6 whilst</p>
  
  <pre><code>select vc.version name, vc.version id
     from version_client vc, version_links vl
    where vl.name='ONE'
      and vl.version='1.1'
      and vl.certified_version= vc.version
      and vl.certified_with=vc.name
      and vc.client_id='DMO'
      and vc.name='TWO'
    order by vc.version desc;
  </code></pre>
  
  <p>displays 1.1.7</p>
  
  <p>My guess is it's something to do with session state i.e. even though the screen version is showing the <code>P1_PRIMARY_VERSION</code> changing, somehow it is losing the value which is resulting in blanking the second select list.</p>
  
  <p>Any suggestions appreciated as to how to fix this. Thanks in advance
  Trevor.</p>
  
  <p>Workspace: TESTA<br>
  username: tester<br>
  password: tester<br>
  Application URL: <a href="https://apex.oracle.com/pls/apex/f?p=35690:LOGIN_JQM_SMARTPHONE" rel="nofollow">https://apex.oracle.com/pls/apex/f?p=35690:LOGIN_JQM_SMARTPHONE</a>::::::<br>
  Developer URL:  <a href="https://apex.oracle.com/pls/apex" rel="nofollow">https://apex.oracle.com/pls/apex</a></p>
  
  <p>Not this is not the same question as refreshing one apex list from another with ajax.  In that case the user is triggering the change and that works fine.  </p>
  
  <p>I am trying to have the user make a change in a list which then updates a text field using ajax and another ajax event on this text field should trigger refresh of the second list. There is a reason for doing it this way related to showing one of several regions on the page but using the same single text field to refresh all of them so just doing a straight refresh of one list from another doesnt resolve the issue in this case.  That might not be clear from the example on apex.oracle.com because i have tried to reduce it down to the minimum to show the issue. TIA.</p>