Problem with onload on afh:body?
Hallo,
i think in my application afh:body onload="..." don't work.
i use the following code but it don't work
<afh:body onload="alert('Test');"> or <afh:body onload="Test();">
in the second case i have a javascript function named Test.
what is the problem?
any help is appreciated.
Hi,
I found the reason.
When adding alert("hello") to the onload property, then the following sorurce code is generated
<afh:body onload='alert(\"hello\")'>
Sometimes - and I cannot reproduce it consitently - it generates
<afh:body onload='alert(\"hello)'>
Which is invalid JavaScript
Frank
Similar Messages
-
Problem with onload attribute in body tag
hi all,
i have been trying to test alert message boxes in servlets.when i am trying to run the servlet the alert window box doen;t appear (but it appears when i put "hello" inside the alertbrackets.and if i change it to some other text , it never appears.sounds silly , but pleas help me.
please help me out. below is the code:
public class TestApplet extends HttpServlet
PrintWriter out = null;
public void doPost (HttpServletRequest req, HttpServletResponse res) throws ServletException , IOException
String strAlert = "alert('The userid is already existing.Please select another one')";
out=res.getWriter();
res.setContentType("text/html");
out.println("<html>");
out.println("<head>");
out.println("<title>Welcome To Online Stock Market</title>");
out.println("</head>");
out.println("<body onload ="+strAlert+">");
out.println("</body>");
out.println("</html>");
out.close();
public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
doPost(req, res);
}Instead of:
out.println("<body onload ="+strAlert+">");
Try this:
out.println("<body onload =\""+strAlert+\"">");
Add two \" around the alert call. -
Problem with onload in jsp page
Hi all,
I had two jsp pages, a search and a results page. I need to enter some search criteria in the first page and based on that criteria i will be getting the results in the results jsp. Now, when i click the back button in the results page, i need to go to the search page and the values which i entered in the search page needs to be present there. But the problem is i had a javascript function which runs on loading of the search page. This function will set all the values in this search page to empty whenever we go to the search page. I am calling this javascript function as follows in my search jsp page.
<body onload="setdefaultvalues('<%=name%>');">
I am having the code for the back button in the results page as follows.
<INPUT TYPE="button" VALUE='Back' onClick="javascript:history.go(-1);resetvalue(name);" class="button">
The problem i am facing is whenever i go to the search page by clicking on the back button, the values in the search page are getting empty because of the onload method. There is no way that i can remove this onload method as i require it for setting the values in the search page evrytime i get to that from other modules as it is the main page for my module. So, is there anyway that i can stop this function from executing when i come from the results page or is there any other way that i can store the values in the search page when going from the results page.i think you really should have the result page include your search page contents rather than having the user need to click back as you'll end up with all sorts of nightmares in caching & session object management to be honest. if the search page is complex use javascript to hide contents and let the users expand them when they want to re-search.
however, if you feel you must i would suggest the following:
in your result page:
session.setAttribute("userQuery","true"); (you probably actually want to put a container object with the query information in here)
in your search page you could have something like:
<body <% session.getAttribute("userQuery")==null { %>onload="setdefaultvalues('<%=name%>');"<% } %>>
-or-
<body onload="setdefaultvalues('<%=name%>',<%=session.getAttribute("userQuery")==null?"true":"false"%>);">
function setdefaultvalues(name,run) { if ( !run ) return;....}
you'll have to decide when to remove the object though cause once its set its there until the session expires or you remove it.
hope that helps, good luck! -
JSF with JavaScript ! Problem with OnLoad()
Hello,
I have a .js (javascript) file which has one function. I want to call this function in my jsf-jsp page form.
The javascript run successfully without onload. But when i use onlod it is giving me error like "
com.sun.rave.web.ui.appbase.ApplicationException: org.apache.jasper.JasperException: /Webcam.jsp(11,109) Attribute onload invalid for tag body according to TLD
1. How can i use the onload event with forms or body with jsf ?
After this, i want to use some if else code with my jsp page. Normally we do this using scriptlets in jsp. So how can i do this on the jsf-jsp. Should i use backing bean to write the same code ?
Actually i want to invoke different applications based on coditions on the return of my javascrit function.
Can anybody has tips, solution on this ?
-Sachin
EpiComm Technologies Ltd.BalusC,
If we want to set focus to a particular element, then
this won't work.
If runScript() function is referring to any form
element we get an error stating that
"document..forms.formname.elements is null.
any ideas how to set focus when the form loads?Then put the script in the bottom of the JSF code, straight before the end body tag. At this place all JSF components are finished with generating.
<html>
<head>
</head>
<body>
<f:verbatim>
<script>
setFocus('</f:verbatim><h:outputText value="#{myBean.focusId}" /><f:verbatim>');
</script>
</f:verbatim>
</body>
</html> -
Sending email - problems with text in email body
Hello all,
for sending emails I use the FM from Thomas Jung (<a href="http:///people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface:///people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface).
Everything works fine, except that the text I attach in documents-content_text doesn't appear as a normal text in the email body but within an .EXT-attachment. Should this be a TXT attachment?
E.g. when I send the text 'Hello World' the email arrives with an attachment 'Hello World.EXT'.
Did anyone have the same problem? What's wrong?
Thanks for your help.
Regards
JoschiTry this it works fine for me,
METHOD email_result_as_pdf.
DATA: lo_document_bcs TYPE REF TO cl_document_bcs VALUE IS INITIAL,
lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL,
lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL,
lo_recipient TYPE REF TO if_recipient_bcs VALUE IS INITIAL,
lo_cx_document_bcs TYPE REF TO cx_document_bcs VALUE IS INITIAL,
lo_cx_send_req_bcs TYPE REF TO cx_send_req_bcs VALUE IS INITIAL,
lo_cx_address_bcs TYPE REF TO cx_address_bcs VALUE IS INITIAL.
DATA: li_message_body TYPE bcsy_text VALUE IS INITIAL,
li_att_content_text TYPE soli_tab,
lw_att_content_text TYPE soli.
DATA: lv_result TYPE string,
lv_send TYPE adr6-smtp_addr
VALUE '[email protected]',
lv_sent_to_all(1) TYPE c VALUE IS INITIAL.
* Create Object
lo_send_request = cl_bcs=>create_persistent( ).
* Add Contents to Mail Body
APPEND 'Dear Sir,<BR>' TO li_message_body.
APPEND ' ' TO li_message_body.
APPEND 'Please find the Report contents enclosed.<BR>' TO li_message_body.
APPEND ' ' TO li_message_body.
APPEND 'Thank You,<BR>' TO li_message_body.
* Create a Document
TRY.
CALL METHOD cl_document_bcs=>create_document
EXPORTING
i_type = 'HTM'
i_text = li_message_body
i_subject = 'New ALV Sample Report'
RECEIVING
result = lo_document_bcs.
CATCH cx_document_bcs INTO lo_cx_document_bcs.
lo_cx_document_bcs->if_message~get_text(
RECEIVING
result = lv_result ).
MESSAGE lv_result TYPE 'E'.
ENDTRY.
* Populate the data to the Document Table
LOOP AT i_sbook INTO w_sbook.
CONCATENATE
w_sbook-carrid
w_sbook-connid
w_sbook-fldate
w_sbook-bookid
w_sbook-customid
w_sbook-custtype
w_sbook-smoker
w_sbook-wunit
w_sbook-invoice
w_sbook-class
w_sbook-forcurkey
w_sbook-loccurkey
w_sbook-order_date
w_sbook-counter
w_sbook-agencynum
w_sbook-cancelled
w_sbook-reserved
w_sbook-passname
w_sbook-passform
w_sbook-passbirth
INTO lw_att_content_text-line
SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
CONCATENATE cl_abap_char_utilities=>cr_lf lw_att_content_text-line
INTO lw_att_content_text-line.
APPEND lw_att_content_text TO li_att_content_text.
ENDLOOP.
** Add the attachment to the document
TRY.
CALL METHOD lo_document_bcs->add_attachment
EXPORTING
i_attachment_type = 'RAW'
i_attachment_subject = 'New ALV Sample Report'
i_att_content_text = li_att_content_text.
CATCH cx_document_bcs INTO lo_cx_document_bcs.
lo_cx_document_bcs->if_message~get_text(
RECEIVING
result = lv_result ).
MESSAGE lv_result TYPE 'E'.
ENDTRY.
* Set the document to the Send Request
TRY.
CALL METHOD lo_send_request->set_document
EXPORTING
i_document = lo_document_bcs.
CATCH cx_send_req_bcs INTO lo_cx_send_req_bcs.
lo_cx_send_req_bcs->if_message~get_text(
RECEIVING
result = lv_result ).
MESSAGE lv_result TYPE 'E'.
ENDTRY.
* Create Sender
TRY.
CALL METHOD cl_cam_address_bcs=>create_internet_address
EXPORTING
i_address_string = lv_send
RECEIVING
result = lo_sender.
CATCH cx_address_bcs INTO lo_cx_address_bcs.
lo_cx_address_bcs->if_message~get_text(
RECEIVING
result = lv_result ).
MESSAGE lv_result TYPE 'E'.
ENDTRY.
* Add Sender to Mail
TRY.
CALL METHOD lo_send_request->set_sender
EXPORTING
i_sender = lo_sender.
CATCH cx_send_req_bcs INTO lo_cx_send_req_bcs.
lo_cx_send_req_bcs->if_message~get_text(
RECEIVING
result = lv_result ).
MESSAGE lv_result TYPE 'E'.
ENDTRY.
* Create Receipient
lv_send = '[email protected]'.
TRY.
CALL METHOD cl_cam_address_bcs=>create_internet_address
EXPORTING
i_address_string = lv_send
RECEIVING
result = lo_recipient.
CATCH cx_address_bcs INTO lo_cx_address_bcs.
lo_cx_address_bcs->if_message~get_text(
RECEIVING
result = lv_result ).
MESSAGE lv_result TYPE 'E'.
ENDTRY.
* Add Receipient to Mail
TRY.
CALL METHOD lo_send_request->add_recipient
EXPORTING
i_recipient = lo_recipient
i_express = 'X'.
CATCH cx_send_req_bcs INTO lo_cx_send_req_bcs.
lo_cx_send_req_bcs->if_message~get_text(
RECEIVING
result = lv_result ).
MESSAGE lv_result TYPE 'E'.
ENDTRY.
* Set Send Immediately
TRY.
CALL METHOD lo_send_request->set_send_immediately
EXPORTING
i_send_immediately = 'X'.
CATCH cx_send_req_bcs INTO lo_cx_send_req_bcs.
lo_cx_send_req_bcs->if_message~get_text(
RECEIVING
result = lv_result ).
MESSAGE lv_result TYPE 'E'.
ENDTRY.
* Send Mail
TRY.
CALL METHOD lo_send_request->send
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = lv_sent_to_all.
COMMIT WORK.
CATCH cx_send_req_bcs INTO lo_cx_send_req_bcs.
lo_cx_send_req_bcs->if_message~get_text(
RECEIVING
result = lv_result ).
MESSAGE lv_result TYPE 'E'.
ENDTRY.
* Inform User
IF lv_sent_to_all EQ 'X'.
COMMIT WORK AND WAIT.
MESSAGE 'Mail Sent Successfully' TYPE 'I'.
ELSE.
MESSAGE 'Error Sending Mail to External Id' TYPE 'E'.
ENDIF.
ENDMETHOD. "email_result_as_pdf
Regards
Kathirvel -
Problem with PL/SQL Function Body
Hi,
I'm getting the following error, when i run the report.
I'm trying to fetch a year value from a table based on a parameter value ":P33_YEAR"
ORA-01403: no data found
Error ERR-1904 Unable to compute item default: type = Function Body computation_type= DECLARE FY VARCHAR2(6); BEGIN SELECT DISTINCT YEAR1 INTO FY FROM REP WHERE YEAR = TRIM(:P33_YEAR);
RETURN FY; END;.
I have written this code in a PL/SQL Function Body for a Hidden item.
Please let me know whats wrong with this code?
Thanks
CK
Message was edited by:
user536304Your code is in a default value for an item, right?
You need to make sure :P33_YEAR is not null and handle the error in the PL/SQL if it is.
How is P33_YEAR populated? do you pass it in? check to see if it is making it there..
Message was edited by:
Bill Carlisle -
Burning problem with gneux.exe
hi, this is the problem with gui can any body suggest me how to download a file with name c:\program Files \sap\frontend\sapgui\gneux.exe its very urgent pls respond immediately
Hi,
Do you have the installation CD with you ?
Regards
Sunil -
Problem with mail displaying message bodies
I'm having problems with Mail displaying the body of an email. It will show the headers and that's all. I've turned on the raw format and can see everything so I know it's getting the emails ok.
I'm running my own mail server using IMAP. I also use two other email clients. Squirrelmail and Thunderbird on Windows 7. Both Squirrelmail and Thunderbird display the emails fine, but Mail on my Mac doesn't work.
Any suggestions???
Thanks!!Anyone have anything on this??
-
Hi!
I'm trying to execute a javascript method when the JSP page loads itself.
The problem I have encountered is onload method doesn't has effect:
The next line doesn't works:
<afh:body binding="#{backing_a.body1}" id="body1" onload="javascript:probandoMensajes()">
I have checked the function in javascript, and it's ok.
Any ideas?
Thanks in advance,
Jaime.Hi,
basically onload="javascript:probandoMensajes()" does call a method on the page root, using the browser URL (which I think is a detour that will never work sufficiently). If ever that works, then if using onload="javascript:document.probandoMensajes()".
However, just adding onload="probandoMensajes()" should do it as well
Frank -
I have an imac and am using iphoto. Currently I am having a problem with one particular album which shows in the main part of the window a triangle with an exclamation point. The two photos are at the bottom of the main window in the same area where the "info" "edit" "create" area is. I can see the two photos but I can not get them back into the main part of the window. I can't drag them anywhere either. I can't double click or right click on either of the two photos either. All I can do is click on either one and they get a little bigger. Before I saw the exclamation point in the main body of the window all I get is two squares with nothing in them and the entire border is made up of dashes. Can someone help me?
Make a temporary, backup copy of your library if you don't already have one (Control-click on the library and select Duplicate from the contextual menu) and apply the two fixes below in order as needed:
Fix #1
Launch iPhoto with the Command+Option keys held down and rebuild the library.
Screenshot is for iPhoto 9
Since only one option can be run at a time start with Option #3, followed by #4 and then #1 as needed.
Fix #2
Using iPhoto Library Manager to Rebuild Your iPhoto Library
1 - download iPhoto Library Manager and launch.
2 - click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option.
4 - In the next window name the new library and select the location you want it to be placed.
5 - Click on the Create button.
Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments. However, books, calendars, cards and slideshows will be lost. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory. -
My station is listed on Itunes Radio stations, but there's a problem with the connection. Does any body help us regarding this issue? The station name is KRAL FM under the Top 40 / Pop category
My station is listed on Itunes Radio stations, but there's a problem with the connection. Does any body help us regarding this issue? The station name is KRAL FM under the Top 40 / Pop category
-
SYSDBA - problem with viewing other users package body texts on sys account
Hi,
SQL Dev 1.0.0.15.27 has problem with correct display of other users package body texts on sys account. All bodies have "create or replace" text instead of all pck. bodies text.
I guest it's problem with SYSDBA role. On system account text is displayed correctly. Quest SQL Navigator 5.x has no problem with this. Any ideas ?
Regards,
MMHi Everyone,
Just so I can close the case on this issue, although I was successful in
using CSS to resolve the issue, actually, the issue was not really
resolved. There was (for me) still the problem of rollover images not
working in IE, and if I were ever to get another good night's sleep, I
would need to resolve it -- so I did. Recall me saying earlier about the
sizes being brought in to the javascript code by Dreamweaver? The original
issue with having the size of the small image in the code caused the code
to see the larger image as small also! However, when I deleted those size
attributes' numbers, I failed to delete the words "width" and "height"
along with the double quotes following each. So, while the other browsers
ignored these "blank" attributes within these double quotes, IE apparently
didn't, reading these "blank" values as some very small value, thus
displaying the image in the absolutely smallest size possible! Wow! When I
removed these two blank attributes, my problem went away! Live and learn!
So, to all who were desperately trying to assist me, please accept my
deepest and most sincere apologies. All the while I was blaming IE, I was
the guilty one!!! Shame on me, and thanks for the wonderful responses I
received from the Dreamweaver forum team. I will go and stand in the corner
for 8 hours with my dunce cap on...
Joe Dardard -
hi..
i've got problem with my iphone 4s gsm factory unlocked it won't connect to a wifi. i tried to hold the power and home button even reset the network setting but ended with i am not even can turn the wifi on. does any body can helpme?See this: http://support.apple.com/kb/TS1559
If you carefully follow all of the instructions in this tip and none of them restore WiFi then your radio chip has failed and you need to get the phone replaced by Apple. -
Simple question has any body had wifi problems with there 1st g i pod touch
repeat has any body had wifi problems with there i pod touch 1st g or any i pod touch older models in the last few months
You need to describe your problem. Many users haveposted about diffeent problems. Could it be this problem?
iOS: Wi-Fi or Bluetooth settings grayed out or dim -
Hi every body. I have some problem with my i pad mini's keyboard . After i opened the message icon , suddenly the shape of my keybord has been chenged . I don't know how to fix it? I was wondering if you'd mind helping me.thanks
That's so you can text with your thumbs. If it does' tog back together automatically put your finger on the tiny typewriter and you should get a pop up to reconnect keyboard. Or more easily put a finger on each one and pop them together.
Maybe you are looking for
-
Hi everyone I wonder if anyone can offer me some advice to rectify the problems I'm experiencing in my itunes? I have been saving my media to an external hard drive since rebuilding my itunes collection, while keeping the library on the hard drive of
-
Why is itunes no longer recognizing my iphone 5 on macbook pro?
My iphone 5 has stopped appearing in my itunes this week. I have tried following the troubleshooting guide on Apple Support but that did not solve the issue. Can anyone please help?
-
Ajax Autocomplete -- all links open in new windows
Hi I used Ajax Autocompete in one of my applications. But after i click the link which uses ajax autocomplete, strange behaviour is happens with other links in Internet Explorer. The other links that are supposed to be opened in the same window now s
-
Page fault in explorer.exe on Win98
I have installed 8i PE (I know this thread id for Lite, but I did not find an appropriate thread). When I rebooted the machine after installing, explorer.exe is receiving a page fault that I can not seem to recover from. Any tips on what I can do to
-
Primary site server a single point of failure?
I'm installing ConfigMgr 2012 R2, and employing a redundant design as much as possible. I have 2 servers, call them CM01,CM02, in a single primary site, and on each server I have installed the following roles: Management Point, Distribution Point, So