Forum Stats

  • 3,839,951 Users
  • 2,262,553 Discussions
  • 7,901,102 Comments

Discussions

Dynamic Action/Select List

Crimsntyd
Crimsntyd Member Posts: 6
edited Sep 30, 2013 12:06PM in APEX Discussions

Hi,

I'm trying to change a field in a form based on the change of a select list on the same form.  I want to do this without submitting the page.  I've been able to do this via dynamic actions and Change/DOM Object, the DOM Object being the select list.  The text area that I want to change text in is working properly in this regard, without submitting the page.

However, I can't get the select list to actually change to the value that I select.  It doesn't matter if I use a dynamic action to submit the page (a second "TRUE" statement after the "change the text area" statement), or select "Submit Page" under "Page Action when Value Changed" in the element properties itself.  The select list doesn't change to the new value I select.  Is this a bug in 4.2?  I can't think of an instance where I WOULDN'T want the value I select to be submitted when I use the select list.  Any help out there?  Thanks.

Best Answer

  • vincent_deelen
    vincent_deelen Member Posts: 402

    Hi Neil,

    If I'm not mistaken the submit procedure expects a request, since it's conditional. Typically this is the button name of the button that triggers the procedure - my guess is that's something like 'SAVE' or 'SUBMIT'.

    Add that submit condition to your javascript: doSubmit('SAVE'). If that works, it would be nicer to create an extra submit procedure, conditional to another button condition, say 'CHANGE' or 'JS' and use that as request for your doSubmit.

    A completly different approach: you could also try to do your chagen process and submit with AJAX: Using AJAX in Your Application

    Regards,

    Vincent

Answers

  • Hi,

    What do you mean by ' I can't get the select list to actually change to the value that I select'? Can you put an example on apex.oracle?

    Regards,

    Vincent Deelen

  • Crimsntyd
    Crimsntyd Member Posts: 6

    Sorry, Vincent.  I'd rather not show the screen shot, it has proprietary material on it.

    I have two dynamic actions tied to the "Change" of the select list on the form.  The first changes the text in a text area on the form via a PL/SQL function.  Which works correctly.  The second action is "Submit Page".

    Let's say the select list contains the values "ABC", "DEF", and "GHI", and that it's currently "ABC", and the dynamic actions are triggered when I select "DEF".  What I mean in the previous post is, when I select "DEF" in the select list, the text changes in the text area as it should, and the page submits, but when the page is done refreshing, "ABC" is still showing in the select list.  It didn't change to "DEF", nor did it submit the value to the database.

    Thanks for your reply.

    -Neil

  • HI,

    Sounds like your submit process isn't working.

    Check if your select list has a proper query containing display and return values. Make sure there is a submit procedure that handles your DML, and make sure the table column you submit your select list return value to, is of the same type. Also check if your submit button has the correct request to actually trigger your submit process.

    Regards,

    Vincent

  • Crimsntyd
    Crimsntyd Member Posts: 6

    Hi, Vincent-

    Thanks for the ideas.  There is a submit procedure, but it's conditional on a button being clicked on the page.  I'm submitting the page via javascript (doSubmit()) or dynamic action when the select list is changed.  Do I need to create another submit procedure for when that happens?  The table column and submit buttons are in place and work correctly.

    Regards,
    Neil

  • vincent_deelen
    vincent_deelen Member Posts: 402

    Hi Neil,

    If I'm not mistaken the submit procedure expects a request, since it's conditional. Typically this is the button name of the button that triggers the procedure - my guess is that's something like 'SAVE' or 'SUBMIT'.

    Add that submit condition to your javascript: doSubmit('SAVE'). If that works, it would be nicer to create an extra submit procedure, conditional to another button condition, say 'CHANGE' or 'JS' and use that as request for your doSubmit.

    A completly different approach: you could also try to do your chagen process and submit with AJAX: Using AJAX in Your Application

    Regards,

    Vincent

  • Vincent, I tried doSubmit('SAVE') and it worked perfectly.  Thanks for your help!  (I'm still learning javascript)

    Regards,

    Neil

This discussion has been closed.