passing parameters between a psp and a html page

563 Views Asked by At

i have a psp(plsql server page) to which a parameter called p_user_name is passed as shown below:

i have created a local variable called p_user in the page as shown below:

<%@ plsql procedure="recon_portal" %>
<%@ plsql parameter="p_menu"     type="varchar2" default="'home'" %>
<%@ plsql parameter="p_rpt_CI"   type="varchar2" default="NULL" %>
<%@ plsql parameter="p_conv_CI"  type="varchar2" default="NULL" %>
<%@ plsql parameter="p_rpt_CI_run"  type="varchar2" default="NULL" %>
<%@ plsql parameter="p_conv_name"   type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path1"    type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path2"    type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path3"    type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path4"    type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path5"    type="varchar2" default="NULL" %>
<%@ plsql parameter="file_path6"    type="varchar2" default="NULL" %>
<%@ plsql parameter="conv"            type="varchar2" default="NULL" %>
<%@ plsql parameter="p_pass_inst"   type="varchar2" default="NULL" %>
<%@ plsql parameter="p_pass_dir"    type="varchar2" default="NULL" %>
<%@ plsql parameter="p_user_name"   type="varchar2" default="NULL" %> 
<%!
   lv_report_file_name  ci_ref_list.report_file_name%TYPE;
   lv_ci_desc_file_name ci_ref_list.ci_desc_file_name%TYPE;
   file_path               varchar(100);
   file_path_master  varchar(100);
   file_path_linked  varchar(100);
   url_path                varchar(100);
   lv_conv                 varchar(100);
   lv_ci_ref      varchar(100);
   lv_conv_name      varchar(100);
   lv_ci_run      varchar(100);
   lv_instance_name  varchar(100);
   lv_doc         varchar(100);
   lv_display_name      varchar(200);
   p_user           varchar(100);


%>

at some part of program i query a value from backend and put it into p_user as below:

<% 

                BEGIN
                    select 'Super User'
            into p_user
            from fnd_user fndusr
            where fndusr.user_id = fnd_global.user_id
            and exists
            (SELECT 1  
             FROM   fnd_lookup_values flv
             WHERE  flv.lookup_type = 'IKN_RAC_RECON_SUPER_USERS'
             AND  flv.lookup_code = fndusr.user_name);
        EXCEPTION
           WHEN OTHERS THEN
             p_user := 'Basic User';
        END;

        %>

some html files are included at the end in my psp page as shown below:

<%ELSIF p_menu = 'conv' THEN %>
            <%@ include file="recon_conversions.html" %>
      <%ELSIF p_menu = 'rept' THEN %>
            <%@ include file="recon_reports.html" %>
      <%ELSE%>
            <%@ include file="recon_docs.html" %>
      <%END IF;%>
   </body>
</html>

now in these html files i need to use the value which is in the parameter p_user. is there any way to get the value of p_user in those html files?

1

There are 1 best solutions below

0
On

I've never used PSP before, but from looking at some of the documentation for this, shouldn't this work in the html files?:

<%= p_user %>

Otherwise, I think you might have to write a javascript method to find where you want to put the contents. So if you had an element in the html files like <span id="p_user_id"></span>, then you could do:

<script language="Javascript">
document.getElementById('p_user_id').innerHTML = '<%= p_user %>';
</script>