aman_greval
asked on
Popup not displayed
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.AssignErrorMe ssage('NIM -33335',Re cASCErrorM essage);
sNIMS_ERROR:=''''||RecASCE rrorMessag e.error_co de||' E: '||RecASCErrorMessage.erro r_message| |'''';
sURL := HTF.anchor(cURL=>'javascri pt:alert(' ||sNIMS_ER ROR||')', cText=>htf.bold('ASC Order'));
ASCK_Utility.AssignErrorMe ssage 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%t ype) IS
SELECT 1
FROM ORDER_HEADERS
WHERE JOB_NUMBER = CurJobNumber;
l_html VARCHAR2(1000);
v_count NUMBER(1) := 0;
RecASCErrorMessage asck_utility.AscErrorMessa ges;
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.form insert?P_J OB_NUMBER= '||P_Job_N o||'&Z_CHK =0';
owa_util.redirect_url(l_ht ml);
ELSE
l_html:=RTRIM(l_html)||'ni m2204w$o_h drs.queryv iew?P_JOB_ NUMBER='|| P_Job_No|| '&Z_CHK=0' ;
owa_util.redirect_url(l_ht ml);
END IF;*/
ASCK_Utility.AssignErrorMe ssage('NIM -33335',Re cASCErrorM essage);
sNIMS_ERROR:=''''||RecASCE rrorMessag e.error_co de||' E: '||RecASCErrorMessage.erro r_message| |'''';
sURL := HTF.anchor(cURL=>'javascri pt:alert(' ||sNIMS_ER ROR||')', cText=>htf.bold('ASC Order'));
END ReturnURL;
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.AssignErrorMe
sNIMS_ERROR:=''''||RecASCE
sURL := HTF.anchor(cURL=>'javascri
ASCK_Utility.AssignErrorMe
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%t
SELECT 1
FROM ORDER_HEADERS
WHERE JOB_NUMBER = CurJobNumber;
l_html VARCHAR2(1000);
v_count NUMBER(1) := 0;
RecASCErrorMessage asck_utility.AscErrorMessa
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
owa_util.redirect_url(l_ht
ELSE
l_html:=RTRIM(l_html)||'ni
owa_util.redirect_url(l_ht
END IF;*/
ASCK_Utility.AssignErrorMe
sNIMS_ERROR:=''''||RecASCE
sURL := HTF.anchor(cURL=>'javascri
END ReturnURL;
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(\'||sNIM S_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)
'javascript:alert('||sNIMS
Try re-writing in any of these ways if it is possible:
1. 'javascript:alert(\'||sNIM
2. "javascript:alert('||sNIMS
3. 'javascript:alert("||sNIMS
ASKER
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('<FON T SIZE = 4 >'||ASCK_Validations.Retur nURL(p_job _number))
||'</FONT>');
htp.tabledata('  & nbsp & nbsp & nbsp & nbsp ' );
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('<FON
||'</FONT>');
htp.tabledata('  &
But here you do not have two similar qoutes repeated.
ASKER
can you give an example from the code given
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
2. sNIMS_ERROR:=''''||RecASCE
3. asck_utility.showalert(' Can u c me?? '|| sNIMS_ERROR);
4. sURL := HTF.anchor(cURL=>'javascri
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.