How to fill a javascript array by a jsp array when the jsp is run

Hi all,
The problem i am facing is -- i want to use an javascript array in a function. The records are being fetched by jsp.
How to fill the vaules in a javascript array, which are retrieved by a jsp array
Please suggest
Thanking You

You can use the code below:
<input type="button" value="Click Me" onclick="javascript:disp('<%= getString(str) %>')">
<%!
public String getString(String str[]){
String arrElements="";
for(int i=0;i<str.length;i++) {
arrElements+=str[i]+",";
return arrElements.substring(0,arrElements.length()-1);
%>
function disp(str) {
arr = str.split(",");
alert ("There are "+arr.length+" elements in the array");
Hope this helps.

Similar Messages

  • How archive infostructures are filled when the delete program runs(sd_cond)

    I could not find a suitable forum for this, hence posting it here. I need to know how the ZARIX tables get filled in SAP Archiving. As far as I know, they are filled automaticlaly when the delete job runs, but I could not find any code in SD_COND_ARCH_DELETE program.
    My issue is that my delete program did not fill one of the infostructures which was active and this infostructure corresponds to the zarix table. On the other hand, this infostructure got filled manually(verified in zarix also).
    Wondering how this could have happened. Can this be because multiple delete jobs are running creating various sessions. This is mainly with reference to the SD_COND archive object.

    Hi,
    There is a separate program to fill infostructures as when you fill them manually (Transaction SARJ, Environment -> Fill Structure) a new job is triggered. Have a look at the job that ran when you filled your infostructure manually and analyse the program that ran.
    There should not be any problem in filling the infostructures due to several archiving sessions running at the same time. If you face the same issue again, see if any of the archiving jobs (write, store, delete) failed for any reason. If all the jobs finished successfully but an infostructure didn't get filled then have a look for any OSS note related to this issue. If you can't find anything, raise an SAP message as the infostructures have to get filled automatically as otherwise there will be no access to the archived data.
    Hope this helps.

  • How can I throw a hard 404 error to apache when a JSP is not found.

    How can I throw a hard 404 error to apache when a JSP is not found.
    I want to let apache handle the error.

    [email protected] (Jeremy Conner) wrote in
              <[email protected]>:
              >How can I throw a hard 404 error to apache when a JSP is not found.
              >I want to let apache handle the error.
              >
              >
              First thought that comes to mind is to return HTML that tells the browser
              redirect to a nonexistent file under Apache. You can't tell Apache to
              throw a 404 unless you're in a mod. Maybe something they could add to the
              proxy, but until then, I think a redirection in the response HTML is your
              only option.
              Jesse
              

  • How do I save a PDF as an excel file when the PDF is horizontal. Adobe tries to rotate the page, but the data is entered in an  horizontal format.

    How do I save a PDF as an excel file when the PDF is horizontal. Adobe tries to rotate the page, but the data is entered in an  horizontal format.

    Thanks for the quick reply.  I figured out how to get the desired results by using tagging.  For anyone who may reference this post in the future, I went to "Customize" in the top right corner of Adobe, then selected "Create new tool set...", looked under "accessiblity and found the "tag" option.  Hit ok, tag is added to the toolbar.  Then I highlighted the dataset in the PDF that was relevant to the output format, then clicked "tag", saved as spreadsheet.  Sorry I can't provide more details on how tagging works or if there's a more elegant solution available, but I'm sure one's out there.

  • How do i get an itunes library from a phone when the computer has crashed and it needs to go on a new computer

    How do i get an itunes library from a phone when the computer has crashed and it needs to go on a new computer

    1) ensure iTunes is authorized for your iTunes store account(s)
    2) connect your device and right-click or control-click it in the iTunes Source list, then choose transfer purchases from the shortcut menu that appears.
    3) sync the device
    iTunes will wipe the iPhone but, since you transferred your purchases in the previous step, your content will be in your library and you can re-populate the iPhone with it.
    above works for purchases from the iTunes store. for everything else, check out this post by Zevoneer.

  • How to initialize the variables in the subvi when the main vi running?

    Hi, friends!
    Now I am working on a project with labview. I make a main vi  including many subvis.
    When the main vi running, I want to reinnitialize the variables in the subvi to zero.
    I know that I can realize that  using the local variable when I enter the subvi,
    but I want to keep the the values when I left the subvi and saw them when I
    click in this subvi again. So, I do not reinitialize the subvi when it runs. But, I
    don not know how to reinitialize the indicators in the subvi when I run the main
    VI in the first instance. I try to use the global variables, but it seems do not work
    well. Would you like to give me some advice? Thanks a lot!

    Hi dec,
          If I understand your question, try using the "First Call?" node in your Sub-VI - to initialize values the first time the VI executes every time the top-level VI is Run.
    If this doesn't work for you, just post again!
    Cheers.
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • HT1766 how to transfer photos from my ipad to my laptop when the ipad is disabled

    how to transfer photos from my ipad to my laptop when the ipad is disabled

    If you have photo stream on, you can stream from icloud (only photos from Camera Roll) otherwise no.

  • How can flex tell if  it's a mouseup event when the user releases the mouse button outside the flex application?

    how can flex tell if it's a mouseup event when the user
    releases the mouse button outside the flex application? Say for
    instance mousedown was done within a 500x500 embedded flex app but
    mouseup is outside or relased on the HTML background. One more
    thing, when we have something draggable, Flex doesn't execute the
    stopDrag() when the user releases the mouse button outside the
    embedded swf or fles app. Pls. help me with this. Thanks!

    I don't think the flex app can tell what happens outside the
    app. But it can detect when it leaves the app, so I have found the
    following line works fine inside initApp():
    this.stage.addEventListener(Event.MOUSE_LEAVE, yourFunction);
    and you have to:
    import flash.display.Stage;
    Doug

  • How to deal with the mouse events when the thread is running

    Hi everybody,
    I have a problem with my program.
    Now I want to present a picture for some time in the Canvas,then automatically clear the screen, but when the user press the mousebutton or keybutton, I want to stop the thread and clear the screen.
    How can I receive the mouse event when the thread is running?
    Thanks,

    I use my code in a GUI applet.
    I try to use the code tag, it's the first time.
                   Image im=sd.getStimulus(obj);
                   if(pos==null){
                        g.drawImage(im, (w-im.getWidth(null))/2,(h-im.getHeight(null))/2,null);
                   }else{
                        g.drawImage(im, pos.x,pos.y,pos.w,pos.h,null);
                   try{
                        sleep(showtime);
    //                    Thread.sleep(showtime);
                   }catch(InterruptedException e){}
                   if(pos==null){
                        g.clearRect((w-im.getWidth(null))/2,(h-im.getHeight(null))/2,im.getWidth(null),im.getHeight(null));
                   }else{
                        g.clearRect(pos.x,pos.y, pos.w, pos.h);
                   }

  • How to change a prospect status to customer in BP,when the prospect turns out to be a potential customer?Please help me with the details.

    How to change a prospect status to customer in BP,when the prospect turns out to be a potential customer?Please help me with the details.
    Moderation: Kindly search before you post

    Dear Ramesh,
    Using Account life cycle we can record the different stages of a BP.
    But at any point of time we can hold one Stage at Business partner.and once we change status Prospect ro Customer. We can't able to see Prospect Status in that BP.
    Ex -
    Stage A- Potentail
    Stage B- Prospect
    Stage C- Customer
    with the help of UI configuration we can define.
    Need your comment,
    Thx
    Karthik

  • No synch choice in safari. So how do I synch my bookmarks in safari to firefox when the synch icon firefox says you have to use does not exist in safari.

    no synch choice in safari. So how do I synch my bookmarks in safari to firefox when the synch icon firefox says you have to use does not exist in safari?
    I cannot set up synch with bookmarks in safari since there is no synch icon in preferences in safari.

    This is crazy. The directions on firefox keep telling you to go to links that do not exist to import bookmarks from safari.
    For example, it says;
    Firefox imports Safari settings automatically. Just go to File > Import... and select Safari. In the next window, check the boxes of what you want to import. For example, your Safari Bookmarks will appear in Firefox's Bookmarks menu as "From Safari." Whatever other bookmarks you had on your Safari Bookmarks Bar will automatically appear on your Firefox Bookmarks Bar, too.
    BUT THERE IS NO IMPORT LINK UNDER FILES ON FIREFOX!
    Then I tried to add a device. I got the code but the continue link was not on ever. I tried it over and over and it does not work.
    WHO MAKES THIS SYSTEM??? How can something that should be so simple be so impossible, and why does Firefox direct you to links that do not exist or, if they exist, do not work!
    Thanks,
    Mike Ruggeri

  • How do I download videos from my panasonic sdr-t55 when the file is unrecognized?

    How do I download videos from my panasonic sdr-t55 when the file is unrecognized?

    save it to desktop. Put it in movie maker. Publish it. Publish it as an avi file or wmv file then save to desktop again. It should be a good video format

  • How to know whether the javascript is disabled or not while loading the jsp

    Hi,
    My query is like how to know whether the javascript is disabled or not while loading the Application main JSP in Mozilla browser.
    I want some Java code or JavaScript code.

    To the point, just let JS fire a specific HTTP request inside the same session.
    This can be done in several ways. 1) Create a hidden <img> element and set the `src` attribute so that it will request a (fake) image from the server. The server just have to intercept on this specific request. 2) Fire an ajaxical request and let the server intercept on it. You can use a Filter for this which sets a token in the session scope to inform that the client has JS enabled.

  • How do I make this code generate a new pro when the "NEXT" button is pushed

    How do I make this code generate a new set of problem when the "NEXT" Button is pushed
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    /* Figure out how to create a new set of problms
    * Type a list of specifications, include a list of test cases
    * DONE :]
    package javaapplication1;
    import java.awt.GridLayout;
    import java.awt.Window;
    import javax.swing.*;
    import java.awt.event.*;
    * @author Baba Akinlolu -
    class Grid extends JFrame{
        int done = 0;
        final int score = 0;
        final int total = 0;           
            //Create Panels
            JPanel p2 = new JPanel();
            JPanel p3 = new JPanel();
            final JPanel p1 = new JPanel();
            //Create Radio buttons & group them
            ButtonGroup group = new ButtonGroup();
            final JRadioButton ADD = new JRadioButton("Addition");
            final JRadioButton SUB = new JRadioButton("Subtraction");
            final JRadioButton MUL = new JRadioButton("Multiplication");
            final JRadioButton DIV = new JRadioButton("Division");
            //Create buttons
            JButton NEXT = new JButton("NEXT");
            JButton END = new JButton("End");
            //Create Labels
            JLabel l1 = new JLabel("First num");
            JLabel l2 = new JLabel("Second num");
            JLabel l3 = new JLabel("Answer:");
            JLabel l4 = new JLabel("Score:");
            final JLabel l5 = new JLabel("");
            JLabel l6 = new JLabel("/");
            final JLabel l7 = new JLabel("");
            //Create Textfields
            final JTextField number = new JTextField(Generator1());
            final JTextField number2 = new JTextField(Generator1());
            final JTextField answer = new JTextField(5);
        Grid(){
            setLayout(new GridLayout(4, 4, 2 , 2));
            p2.add(ADD);
            p2.add(SUB);
            group.add(ADD);
            group.add(SUB);
            group.add(MUL);
            group.add(DIV);
            p2.add(ADD);
            p2.add(SUB);
            p2.add(DIV);
            p2.add(MUL);
            //Add to panels
            p1.add(l1);
            p1.add(number);
            p1.add(l2);
            p1.add(number2);
            p1.add(l3);
            p1.add(answer);
            p1.add(l4);
            p1.add(l5);
            p1.add(l6);
            p1.add(l7);
            p3.add(NEXT);
            p3.add(END);
            //Add panels
            add(p2);
            add(p1);
            add(p3);
            //Create Listners
            Listeners();
    void Listeners(){
          NEXT.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
             int answer1 = 0;
             //Grab the numbers entered
             int numm1 = Integer.parseInt(number.getText());
             int numm2 = Integer.parseInt(number2.getText());
             int nummsanswer = Integer.parseInt(answer.getText());
             //Set the score and total into new variabls
             int nummscore = score;
             int nummtotal = total;
             //Check if the add radio button is selected if so add
             if (ADD.isSelected() == true){
                 answer1 = numm1 + numm2;
             //otherwise check if the subtract button is selected if so subtract
             else if (SUB.isSelected() == true){
                 answer1 = numm1 - numm2;
             //check if the multiplication button is selected if so multiply
             else if (MUL.isSelected() == true){
                 answer1 = numm1 * numm2;
             //check if the division button is selected if so divide
             else if (DIV.isSelected() == true){
                 answer1 = numm1 / numm2;
             //If the answer user entered is the same with th true answer
             if (nummsanswer == answer1){
                 //add to the total and score
                 nummtotal += 1;
                 nummscore += 1;
                 //Convert the input back to String
                 String newscore = String.valueOf(nummscore);
                 String newtotal = String.valueOf(nummtotal);
                 //Set the text
                 l5.setText(newscore);
                 l7.setText(newtotal);
             //Otherwise just increase the total counter
             else {
                 nummtotal += 1;
                 String newtotal = String.valueOf(nummtotal);
                 l7.setText(newtotal);
      //Create End listener
    END.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            // get the root window and call dispose on it
            Window win = SwingUtilities.getWindowAncestor(p1);
            win.dispose();
    //new Grid();
    String Generator1(){
         int randomnum;
         randomnum = (1 + (int)(Math.random() * 100));
         String randomnumm = String.valueOf(randomnum);
         return randomnumm;
    public class Main {
         * @param args the command line arguments
        public static void main(String[] args) {
            // TODO code application logic here
            JFrame frame = new Grid();
            frame.setTitle("Flashcard Testing");
            frame.setSize(500, 200);
            frame.setLocationRelativeTo(null);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
    }Edited by: SirSaula on Dec 7, 2009 10:17 AM

    Not only are you continuing to post in the wrong forum but now you are multiposting: [http://forums.sun.com/thread.jspa?threadID=5418935]
    If people haven't answered you other posting its probably because we don't understand the question. Quit cluttering the forum by asking the same question over and over and then next time you have a new question post it in the proper forum. Your first posting was moved becuase you didn't post it properly.

  • How to create a backup of History so that even when the History is cleared the backup copy is available?

    My children are using some websites which they are not supposed to watch and when they leave the browser they are clearing all the History and I am unable to know which sites they have visited. Is there any way Not to delete or clear the History when the Browser is Closed? Or is there any way so that I can set up a log file some where in the system which logs all the History and I can access this log file later and monitor the sites and also I shall be able delete this log file whenever I like?
    In fact the History should be turned on and children should not have access to clear the History.

    It can be done.
    The problem is many kids will bypass almost anything you try. They presumably have internet access on phones, friends computers and internet cafes. Even if you block access to the UI for History there is a very simple method of clearing it still.
    If you solve the first problem how do you stop them installing a separate browser, or another copy of Firefox, or even running a new OS off a memory stick.
    There are methods of locking down most things, but you will need to look at the whole computer not just Firefox.

Maybe you are looking for

  • How can I make my clamshell boot from the CD-ROM

    I have a Japanese version 300mhz tangerine clamshell with 160MB RAM and a 3gb hard drive. It ran well on OS 9.2 until yesterday when I decided to upgrade (erased old OS) to OS 10.2. The upgrade went smoothly (although took quite a while). After the u

  • Passing values in a jsp

    I am sending 2 values to the next jsp page from a current jsp page. Am using a form like this <form name=report method=get action=./modules/pccr/pccr_assignedengineer_report.jsp target=assignedengineer_report> These are the 2 values <select name="ass

  • Macbook pro brightness problem

    my macbook pro contantly change brightness after turning off and on the computer. even though i uncheck "automatically adjust brightness" in System preferences-Display, it still changes after turning off and on the computer. anybody else having the s

  • Is there now a system call to send pass-through commands to ATA devices?

    I want to send pass-through ATA commands to SATA/ATA devices on intel-based solaris. From the beginning the USCSICMD ioctl has worked just fine on SCSI/SAS/FC targets on intel & sparc-based solaris, but the mechanism to send pass-through commands to

  • Joining Facts With Different Grains to NonConfirming Dimensions - Mystery

    Hi , Taxonomy Used is - CD stands for Confirmed Dimension && NCD stands for Non Confirmed Dimension. I have 3 Dimensions (CD1,NCD2,NCD3) and 2 facts (F1 & F2). ==> Fact F1 can be joined to only CD1 and NCD2 dimensions. Grain of Fact F1 is same as CD1