Problem setting a hidden item value when button clicked with dynamic action or pl/sql process

Apex 4.1
Oracle 11g
I have a page that consists of a main region and several sub regions.  I have a pl/sql process in After Header SET_DISPLAY(:P400_DISPLAY :='MAIN';)
Three subregions have a contional display where P400_DISPLAY = STORE.  This works in hiding the sub regions.
Now I want to change the P400_DISPLAY value to STORE to show the subregions when I hit a button.
I tried creating a dynamic action for on click of the add button but get the following error:
The selected button uses a 'Button Template' that does not contain the #BUTTON_ID# substitution string
I went to the templates and found:
Substitution Strings
Substitution strings are used within sub templates to reference component values. This report details substitution string usage for this template.
Substitution String
Referenced
From
Description
#LINK#
Yes
Template
To be used in an "href" attribute
#JAVASCRIPT#
No
To be used in an "onclick" attribute
#LABEL#
Yes
Template
Button Label
#BUTTON_ATTRIBUTES#
No
Button Attributes
#BUTTON_ID#
No
Generated button ID will be either the button's Static ID if defined, or if not will be an internally generated ID in the format 'B' || [Internal Button ID]
I then tried creating a page process, pl/sql, :P400_DISPLAY :='STORE'; when the appropriate button is pressed.  The button action is submit page. However, it does not change the P400_DISPLAY value and the subregions stay hidden.
Suggestions please on how to fix the template or change the P400_DISPLAY value?

The root issue is that, although you change the value of your page item, it isn't visible to other areas of the page until it is in the session. So, any other action based on the value of your page item; the visibility of a control, a report based on the item's value, etc. will all be unaffected by changing the value of the page item until it has been changed in the session. Even after this the items are stored in the session, you must thereafter do something to cause the value to be reevaluated. To see the effect of this, observe that your page loads and evaluates the value of your page item, it sees that is "MAIN" and hides the regions. However, it doesn't reevaluate them after this.
So; your choices to get this value set in the session are to either Submit the page, or use JavaScript to set the value in the session. If you use the latter of these, you'll have to do some further work to cause the visibility tests to be re-run, So, let's stick with with the submit method.
What you've done above sounds correct for this but, there are a lot of decisions you could have made that might have caused things not to happen in the correct sequence.
Firstly, let's confirm that what I describe above is your problem. From the development environment, load the page, click the button to change the value and submit. Now, click the link labelled Session. Is it still set to MAIN? If so; this is your issue.
Let's start with the your After Header computation. Did you set it to *only* run if the current value of your page item is NULL??? If not, that's your problem.
Load Page -> Item set to 'Main' by Computation -> Click Button -> Item set to STORE -> Submit -> Load Page -> Item set to 'Main' by Computation
See the problem?
Assuming this isn't the issue, you created a Branch to the same page, right? What is your process point for the Branch? Is it *After* Validation, Computation etc? Because if not, you aren't changing the value before the submit happens.
I bet it is the first issue but, take a look at these.
Cheers,
-Joe

Similar Messages

  • Can't set a hidden field value from onClick event with a runtime expression

    Hi,
    I need to set a hidden field in an onClick event of button but it's not working.
    <html:submit styleClass="btnLink" onclick="document.empForm.hidden.value='<%= empID%>'">
    <%= empID%>
    </html:submit>
    Althought the second expression is evaluated and written successfully "the button value"
    I heard that this is because you can't mix the value of an attribute of a custom tag with both string literal and run time expressions.
    Is there any work around to solve that?
    I can't use EL as I'm using old JSP version

    I guess, it should work; instead of html:submit, try with button.

  • How to set setRowKey value when table is populated dynamically

    Hi All
    I have created a view object using only select statement and displaying all the records in it in the table at page load. Table is SelectMany. Now after selecting some records I press submit button. At the backend logic is executed which prints how many rows selected and the values of the selected rows. Everything works fine till here.
    Now when the view object is modified by putting where clause. And the parameter to this where clause is coming from url. When the page is loaded table displays only records based on filter criteria. But the problem begins when I press the submit button. It shows the error: row is null for rowKey:oracle.jbo.Key[AAAQkHAAJAAAACkAAA ]
    I have done some research and found that row key is not set for the displayed records. because at the backend when I am printing the values of keys in selectionState.KeySet it prints only null.
    This thing happens only when table is populated dynamically through url value.
    Can anyone help me how to get the selectionState.Keyset values when table is populated dynamically?

    SOLVED:
    Actually there is no problem with the rowKeys as I mentioned in the post. What happened was that I was executing the query everytime on page load. Second time when the page is loaded the param value was set to null. So row becomes null but on the other hand I am referring the rows by some selected row keys. so the error that row is null for key...
    So now i am storing the param value in managed bean and then referring it in the code.

  • How to make the LV front panel controls the current value through the program is set as the default value when the next time you open?

    How to make the LV front panel controls the current value through the programis set as the default value when the next time you open?
    1110340051 

    Try this: Re: How to make a VI remember the latest control value?
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • Download the PDF Form as a attachment when button click in BSP application

    Hi All,
    I have scenario, when button click in the BSP application PDF Form want to download in the IE (like one window open with Open,Save and cancel button).
    I have written this code:
    data: pdf type fpformoutput-pdf.
    < Logic for populate value to pdf field ....
    .>
    response->set_header_field(
                         name  = 'cache-control'
                         value = 'max-age=0' ).
      response->set_header_field(
                         name  = 'content-disposition'
                         value = 'attachment; filename=webforms.pdf' ).
      response->set_data( data   = pdf ).
    Once button is clicked pop up is opened and closed automatically because of browser or adobe reader issue.
    How can I resolve this problem ?
    In the IE i need to change any settings ?
    IE version = 7.0
    Adobe reader = 9.0
    I have tried in the same code with IE = 6.0 and adobe reader 8.1.2 its getting download the pdf form working fine.
    The same think i want in IE 7.0 and adobe reader 9.0, what needs to be done ?
    Regards,
    Boopathi M

    Hello Ravi,
    Best would be to bind the dataSource of the InteractiveForm ui element to the parent node containing the table's data. Then specify a name of a template to be created in the templateSource and hit <enter>. Some popups later, the system will have created a template from the structure of the context. All you need to do now is to drag&drop the data structure inside the template designer to the template itself. This will result in a table. Save, activate and return the Web Dynpro view. Don't forget to unbind the pdfSource and enjoy.
    Best regards,
    Thomas

  • Set value in tabular form field with dynamic action

    Hi Guys,
    I have a dummy field in a tabular form which I am trying to use to populate another field in the tabular form when it is changed.
    In the tabular form I have an ITEM_ID field. Each item_id has an ITEM_NAME which is the dummy field as it is not a field in the database table.
    When the user enters an item name, I would like something like a dynamic action to fire, populating the ITEM_ID.
    e.g User enters part no ABC into the dummy field. When they tab out, I want the value to the item_id field on the tabular form row to be populated based on a SQL query in a similar fashion to how it can be done with dynamic actions on text items on a form.
    I am using APEX v4.0.0
    Thanks in advance
    Chris

    Hello Chris,
    Why can't you use Select List Item on tabular form, which will display all item_names and return item_ids?
    If the list is huge and you need users to type & search, then you can use Pop-up LOV item.
    Regards,
    Hari

  • How do i set my homepage to show when i click a new tab instead of the about: Tabs screen?

    Is there a way to set the homepage to open when one clicks the plus on the tab bar instead of the about: Tabs screen opening?

    New Tab Homepage extension: <br />
    https://addons.mozilla.org/en-US/firefox/addon/777

  • Touch ID on my ip5s had broken. I added my fingerprints before then I deleted them and add new one. How I can fix that problem? P/s : Fail immediately when I click on Add fingerprints

    Touch ID on my ip5s had broken. I added my fingerprints before then I deleted them and add new one. How I can fix that problem? P/s : Fail immediately when I click on Add fingerprints.

    problem is "Failed. Sorry, the operation was not succesfull. ... " and now i can't use touch ID in my phone

  • How to prevent error message for material description in MDG material detail screen, when user click on check action

    Dear Experts,
    I have a requirement for making material description as non mandetory in change request view of mdg material screen.
    I have done that using field usage in get data method of feeder classes, but still message is displaying.
    This message 'Material description is mandatory is displaying with check action only, but not with save or submit after i anhance field property as not mandetory.
    How to prevent error message for material description in MDG material detail screen, when user click on check action.
    Thanks
    Sukumar

    Hello Sukumar
    In IMG activity "Configure Properties of Change Request Step", you can completely deactivate the reuse area checks (but will then loose all other checks of the backend business logic as well).
    You can also set the error severity of the checks from Error to Warning (per CR type, not per check).
    Or you provide a default value for the material description, e.g. by implementing the BAdI USMD_RULE_SERVICE.
    Regards, Ingo Bruß

  • Why do I keep getting context menus when I click with one finger?

    I have a late 2010 MacBook Pro running Mountain Lion 10.8.1.
    I have set my integral trackpad up so that to secondary click, (aka right click), I click with two fingers.
    So why do I sometimes get a context menu appear when I click with just one finger? It gets really annoying at times.

    I have the same problem on my mid-2009 MBP. This after reinstalling OS 10.8.3 to fix a bunch of problems. One thing I have found is that I need to keep my other hand and fingers away from the trackpad (obviously!), but also away from the case. So, I cannot hold the MBP or rest my wrist on it if I expect the one finger click to work.
    My guess is that it is some kind of "grounding". But the case is aluminum, no? So, maybe it is body heat or a weird psychic aura (do-do do-do).

  • Change item value when a specific item has changed... how can i do that?

    Hi guys, i need to ask something...
    Is it possible to have a process or a computation, that gives value to an item, only when one specific item has changed.
    I have other items on my page too, but this two are related, and i need to give a specific value to the first one, only when the value of the second has changed...
    Help please
    tsveti:)

    Hey Farhan, i guess i need some help on that easy javascript...
    i havent done much thing with it so i have almost none experience with js....
    So in 'HTML Form Element Attributes' for the second item I m trying this :
    onchange="javascript:{document.getElementById('P1_SUBPROJECT').value = '-1';}"
    but when i change the value of this second item, the first one (P1_SUBPROJECT) dont get -1
    what am i doing wrong?

  • Can I keep the CC value when user click the REPLY TO button in outlook?

    Hi all,
    I have set the CC value when I send email out. But when user reply the received email, the CC value will be displayed in the TO field. If anyone knows how can I keep the CC value unchanged when user reply the received email?
    Thanks very much.

    It depends entirely on the mailer they're using, you have no control over it.

  • How to pass item value when call a procedure

    Hi,
    I tried to display a blob image by calling a procedure,
    it's work if I hardcode the parameter, eg <img src="#OWNER#.download_my_file?p_id=1&p_picture=1" height=60 width=40 /img>
    but if I pass the p_id value with some page item value <img src="#OWNER#.download_my_file?p_id=:P_ITEM_ID.&p_picture=1" height=60 width=40 /img>
    the image don't display...is there anything wrong with my syntax?
    Thanks
    Vincent

    Vincent,
    The &P_ITEM_ID. must be in uppercase?Yes, exactly like I showed. Substitutions strings in Application Express must always be in upper case, no exceptions.
    Scott

  • Focus on an Item (based on button click)  in OAF page

    Hi,
    I am new to OAF. I face an issue in a OAF page. The page has got 'message input text fields', 'Apply' and 'cancel' button. Once the page is rendered , there is no initial focus on any item. If i click on the page or use tab to navigate to a text field , the focus moves to the 'Apply' button (by default). The real problem is, even before entering the details , if i accidentally press the *'ENTER'* key , the apply action is triggered(where the focus relies).
    1. I just need to find out why the focus moves to the particular button item , when i click on text box or anywhere in the region.
    2. Is there any mouse event mapped to the page or that item ?
    3. I don't want that focus to be on any button (when i click in the page region or place the cursor in text box to enter values).
    How to achieve this?
    Is this can be done using personalization or its has to be looked up in the CO of that page.
    Please help me on this.
    Thanks and Regards,
    Raghav

    Hi Gaurav,
    Thank you so much for your quick response.That page has got a custom CO which got extended from another main CO . I need to add this code in the processRequest() of the main CO for that particular PG or in this custom CO. Correct me if i am wrong.
    Thanks and Regards,
    Raghav

  • Problems setting up Soundblaster X-Fi Xtreme Music card with Logitech Z-5500 Speak

    I have searched a lot for information on this and I have been unable to find a solution to
    my problem. I recently purchased a new Dell PC with the following items: Soundblaster X-Fi Xtreme Music sound card and Logitech Z-5500 speakers. However, when I tried to connect the 3 analog wires from the central unit into my sound card, only one of them will work at a time. In other words, only one set of speakers will play anything. I am not sure what other options I have. Someone from Best Buy said I needed the box that comes with the Platinum version of X-fi Xtreme but I am not sure where I can order this from. Is it sold seperately anywhere? Clearly I am not going to order another of the same sound card and pay another $200 when the only thing I need is the box. Any suggestions on how to solve this dilemma would be extremely appreciated.

    You might want to reinstall the drivers, because it looks like your default speaker settings are set to 2. or whatever non 5. setting it was on. This is because whenever you click on the default settings button, it will reset the speaker setting back to the non-5. speaker setting. Actually, you can do a custom uninstall of the card and just uninstall the volume panel. Then reinstall it. It should ask you what default speaker setting you desire. Set it to 5.. That way you don't have to worry about it defaulting to the wrong speaker settings.

Maybe you are looking for

  • A film I downloaded is no longer available in iTunes Store

    A film I have purchased from the iTunes Store is no longer listed when i do a search (top right hand of iTunes application.  For the avoidance of doubt the podcast associated with the film does come up so I am sure I am typing the name correctly) and

  • How to use intel_pstate?

    Ok guys, I recently set up Arch Linux on my notebook. I saw, that the cpu frequency isn't going down to it's minimum while, according to top, only about 0.5% of the CPU is used. When I tried to use cpupower to manage this issue, I discovered, the sys

  • Distortion Crackling Imported CD's

    Hello, On many of the songs I have recently imported there is distortion and crackling at louder volumes. I have listened to the songs on two pairs of headphone and in my car...all the same problem. I have been searching the discussions and internet,

  • Can't update/install quicktime plugin

    I have uninstalled and reinstalled the plugin and the whole version even the quicktime alternative and it still doesn't want to play mov files. I am going to the apple.com/trailers page to watch some trailers and it gives me an error that I need to u

  • Creative Gigaworks S750 speaker placement

    Hey Guys, As I get deeper into how to improve the sound on my Gigaworks S750 I'm starting to experiment with proper speaker placement. So far, I have the four floor stands for the side and rear channels. And going by the book I have the side channels