Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Popup not displayed

Posted on 2006-11-16
9
Medium Priority
?
307 Views
Last Modified: 2008-02-01
This code is in Oracle Pl/Sql. It uses pl/sql web toolkit.

I want to pop-up a message to the user:NIM-33335 Error, please contact the administrator.
This is done by the following code,

   ASCK_Utility.AssignErrorMessage('NIM-33335',RecASCErrorMessage);
   sNIMS_ERROR:=''''||RecASCErrorMessage.error_code||' E: '||RecASCErrorMessage.error_message||'''';
   sURL := HTF.anchor(cURL=>'javascript:alert('||sNIMS_ERROR||')', cText=>htf.bold('ASC Order'));

ASCK_Utility.AssignErrorMessage is a package the retrieves the error message from a table when the
error code NIM-33335 is supplied to it.

I have commented all the code since i do not want any functionality here, all i want is a error message
in a alert.

This code is working in one of my procedures, however it does not work in this procedure. why??
Here is the code
=======================================================================================================
PROCEDURE ReturnURL(P_Job_No IN NUMBER)
IS
CURSOR CursorOrdHdr(CurJobNumber order_headers.job_number%type) IS
SELECT 1
FROM   ORDER_HEADERS
WHERE  JOB_NUMBER = CurJobNumber;
l_html  VARCHAR2(1000);
v_count NUMBER(1) := 0;

RecASCErrorMessage  asck_utility.AscErrorMessages;
sNIMS_ERROR         VARCHAR2(32000);
sURL                VARCHAR2(500):= 'ASC Order';
 
BEGIN
/*     l_html := NIMF_Get_URL('plsql') ;
     FOR rec IN CursorOrdHdr(P_Job_No)
      LOOP
        v_count := 1;
        EXIT;
      END LOOP;

     IF v_count = 0 THEN
        l_html:= RTRIM(l_html)||'nim2204w$o_hdrs.forminsert?P_JOB_NUMBER='||P_Job_No||'&Z_CHK=0';
        owa_util.redirect_url(l_html);
     ELSE
        l_html:=RTRIM(l_html)||'nim2204w$o_hdrs.queryview?P_JOB_NUMBER='||P_Job_No||'&Z_CHK=0';
        owa_util.redirect_url(l_html);
     END IF;*/

   ASCK_Utility.AssignErrorMessage('NIM-33335',RecASCErrorMessage);
   sNIMS_ERROR:=''''||RecASCErrorMessage.error_code||' E: '||RecASCErrorMessage.error_message||'''';
   sURL := HTF.anchor(cURL=>'javascript:alert('||sNIMS_ERROR||')', cText=>htf.bold('ASC Order'));

   
 END ReturnURL;
0
Comment
Question by:aman_greval
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
9 Comments
 

Author Comment

by:aman_greval
ID: 17963538
1.   ASCK_Utility.AssignErrorMessage('NIM-33335',RecASCErrorMessage);
2.   sNIMS_ERROR:=''''||RecASCErrorMessage.error_code||' E: '||RecASCErrorMessage.error_message||'''';
3.   asck_utility.showalert(' Can u c me?? '|| sNIMS_ERROR);            
4.   sURL := HTF.anchor(cURL=>'javascript:alert('||sNIMS_ERROR||')', cText=>htf.bold('asc ORDER'));

On testing i found that the upper 2 lines are working ok.It is showning me the message. The problem is with the 4 line.
Is it because ASC Order link in the web page is not able to map with cText=>htf.bold('asc ORDER')?
So when i click the link this message is not shown.
0
 
LVL 17

Expert Comment

by:gops1
ID: 17964022
Looking at lines, the only guess here is the qoutes used in your syntax:

'javascript:alert('||sNIMS_ERROR||')'


Try re-writing in any of these ways if it is possible:
1. 'javascript:alert(\'||sNIMS_ERROR||\')'  --> Escape the quotes
2. "javascript:alert('||sNIMS_ERROR||')" --> Use different quotes (double quotes outside)
3. 'javascript:alert("||sNIMS_ERROR||")' --> Use different quotes (double quotes inside)
0
 

Author Comment

by:aman_greval
ID: 17964045
I used the same technique in a function returnURL,
it returns the URL to a procedure nik_planning and nik_planning does the following
It seems I need to do this. Some code to drive the URL returned

htp.tabledata(htf.em('<FONT SIZE = 4 >'||ASCK_Validations.ReturnURL(p_job_number))
                ||'</FONT>');
htp.tabledata('&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp');
0
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
LVL 17

Expert Comment

by:gops1
ID: 17964080
But here you do not have two similar qoutes repeated.
0
 

Author Comment

by:aman_greval
ID: 17964100
can you give an example from the code given
0
 
LVL 17

Accepted Solution

by:
gops1 earned 2000 total points
ID: 17964178
Aman I do understand Procedure or Function you have written coz I am not a database person. Let me make you understand when I write the same alert for a hyperlink.

<a href="#" onClick="javascript:alert('Hello');">Click Me</a>

if you look at the above example, onClick is an attribute and the attribute values are given inside the quotes. Now look at the qoutes used for the attribute values it is double qoutes -->"
For onClick attribute values I am using " and for the word Hello inside alert I am using single quote (')

If I have define something in qoutes inside them, in a normal scenario it is not possible. It can be done only either by escaping them or using single qoute:

For example:
<a href="#" onClick="javascript:alert(\"Hello\");">Click Me</a>

or
<a href="#" onClick='javascript:alert(\'Hello\');'>Click Me</a>

or

<a href="#" onClick="javascript:alert('Hello');">Click Me</a>

or

<a href="#" onClick='javascript:alert("Hello");'>Click Me</a>



0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question