Sunday 3 September 2017

Post Element URL change dynamically and Open the modal Dialog

Hello All,

Today, I am gonna share with you all, How to change the Post Element URL dynamically on the change of items and Open the modal Dialog Page in just 3 simple steps.

1. Pass a static Id in Post Element Text Item

<a id="select_rates" href="...">Select Rates</a>

2.  Create a dynamic action on change and select action Execute PL/SQL code.
BEGIN
:P1566_URL := apex_page.get_url(p_page => '1568'
 , p_items => 'P1568_ST_DATE,P1568_END_DATE,P1568_AGENT_CODE'
                              , p_values => :P1566_ST_DATE||','||:P1566_END_DATE||','||:P1566_AGENT_CODE||','||:P1566_AGENT_CURR
                              , p_clear_cache => '1568');  
END;

Item to submit : P1568_ST_DATE,P1568_END_DATE,P1568_AGENT_CODE

Item to return : P1566_URL

3. Create another dynamic action on change of P1566_URL  and select Execute Javascript Code.

    $('#select_rates').attr('href', $v('P1566_URL'));

Please let me know Incase any of you face any issue or not able to understand above points.

Thank You!

Regards.

Friday 11 August 2017

Refresh detail report on selecting radio button.

Hello everyone,

This post is regarding the dynamically changing of the detail report based on the selecting the master record.

Below are the steps:
1. Create a below function on the page in function region.

function put_selected_value(sel_value) {
  $x('P1566_DTL_LINE_ID').value=sel_value;
}

2. Add Radio Button in the master query.
SELECT apex_item.radiogroup(
              p_idx            => 1
            , p_value          => LINE_ID
            , p_selected_value => :P1566_DTL_LINE_ID
            , p_display        => NULL
            , p_attributes     => 'class="empno"'
              ,p_onchange =>  'javascript:put_selected_value(this.value);'
)   radio_select, EMP_NO,EMP_NAME,DEP_NO,DEP_NAME FROM EMP_DEP_MAS

3. Create a dynamic action on change and selection type should be Jquery selector .empno
and in
action add below js code :

 $('#myReport1').trigger('apexrefresh');

4. Detail report query:

SELECT LINE_ID,DTL_LINE_ID, EMP_ADDRESS,EMP_EMAIL,DEP_ADDRESS,
DEP_MAIL FROM EMP_DEMP_DTL
WHERE DTL_LINE_ID=:P1566_DTL_LINE_ID

5. Pass the static id myReport1 in the detail report region which needs to be refreshed on selecting radio button.

6. Also, In detail report pass item in page item to submit P1566_DTL_LINE_ID.



Thank You!

Saturday 29 July 2017

Working with APEX_ITEM.Radiogroup, pass value in item through report using RadioButton.

Hi,
Working with apex_item API is always a complex and the most important part. This a quick post on how to work around with apex_item.radiogroup. 

Report Query:
1. SELECT apex_item.radiogroup(
              p_idx            => 1
            , p_value          => EMP_ID
            , p_selected_value => :P_EMP_ID
            , p_display        => NULL
            , p_attributes     => 'onclick= "javascript:$x(''P_EMP_ID'').value='||EMP_ID|| '"')   radio_select,
emp_name,dep_name,sal from emp.

2. Create a item on the page or the region P_SEQUENCE_NUMBER
3. Make the radio_select column in the report attributes standard.

The result of above will be that when you select the radio button in a report, its corresponding emp_id will be reflected in P_EMP_ID which you further can use to pass the value in any process or dynamic action.

Thank You!