Toggle Button  in JSP

I have a submit button in my JSP and its initial value is "Show". When I click that button, I post the form to do some action and wants to change the button caption as "Hide". Since I'm posting the form, button caption is changing back to its initial value. Is there any way to toggle properly. Thanks in advance.

if your page doesn't reload after submiting the form
then you may use javaScript to change the name(property) and value of the button,
just assign it an "id" and access it as
document.getElementById(_ID).value and
document.getElementById(_ID).name if your page reloads after submiting the form you can change corresponding properties of the button in the backend
reply me if you want more detail
Regards
Manish

Similar Messages

  • To open a window & html page at a time on a single button, in JSP.

    Hello!
    I want to open 1 window as well as i want to open 1 html page on a single button click at a same time, in JSP.
    on button's "action" event i am opening the html page and button's "onclick" event i am opening the window, but it is not showing these 2 actions at a time. only window gets open when i click the button.
    [Also on form's "action" event i am having validate() function.]
    how do i open a window & html page at a time on a single button, in JSP?
    I don't know how to do this. I have stuck over here, if anyone is having any solution, please let me know.
    I need your help.
    Thank You.

    write js as
    window.open(page, "Popup", windowprops);
    windowprops = "height="+hi+",width="+wd+",top="+ wint +",left="+ winl +",location=no,"
              + "scrollbars=yes,menubars=no,toolbars=no,resizable=no,status=yes";
              encapsulate this in one function and call that function on button click event !!

  • Contacts Calendars Bookmarks Find My iPhone toggle buttons won't switch on

    I have a new iPhone 3GS, but under Settings - Mail Contacts Calendars - My .Mac account, I cannot get the toggle buttons for Contacts, Calendars, Bookmarks and more importantly Find My iPhone, to switch to 'ON'. Mail however is 'ON'. When I click them to 'on' they just immediately turn themselves off again. This means that my iPhone does not show up in my .Mac/MobileMe account and therefore Find My iPhone will not work.
    As far as I can see everything is set up correctly. I've looked through posts here, read Apple's suggestions, but none of these will switch to 'On'.
    Fetch New Data is set to Push. Fetch is set to every hour. Location services are On.
    In iTunes, Mail Contacts Calendars Bookmarks are all set to sync.
    Under Account Info for my .Mac/Mobile Me account I am still using the older .Mac settings as I still prefer my [email protected] email address - could this have anything to do with the problem? Should I try deleting the account manually and re-adding it manually with the new Mobile Me settings?
    When I set up my iPhone 3GS I used the backup of my old 1st Generation iPhone to set up the new phone in iTunes. The settings above wouldn't toggle on the old phone either, so I wonder if I have inadvertantly brought a bug across by restoring from the old phone backup?
    Really puzzled now. Has anyone come up with a solution or is it a problem at Apple's end?

    OK, solved my own problem! For anyone else having the same sort of problem, all I did was to manually delete my .Mac/MobileMe email account on my iPhone completely, shut down the iPhone completely, switch it on again, and manually add my .Mac/Mobile Me account back on the phone - this time using my address as [email protected], forcing it to use the me.com servers instad of my older .Mac servers.
    Instantly I was able to toggle the buttons and switch on Find My iPhone, which is now showing up online in my .Mac account.
    Now I've just got work out how to change my outgoing email address back again to [email protected] because I HATE @me.com! It's a horrible email address, and sounds really self-important.

  • What's wrong with my toggle button bar?

    I've used one before, and I don't understand why my toggle
    button bar is not showing the "active" state for the first index of
    the viewStack it is linked to.
    Normally, I use mainStack.selectedIndex = 0 and that
    highlights the first (default) item of the view stack.
    I change the viewstack with a timer, and all subsequent
    states the correct button highlights, even when I have it loop
    around to the first item again. It's only initially on load.
    Thoughts?

    Thanks, Greg.
    That didn't work either, but it got me thinking. Moving it to
    the end of the function that assigns the children to the view stack
    finally worked:

  • I have a button in JSP page inside an UIWebView by pressing the button i want to run another existing iPhone native application in background only.Do anyone have a solution for this.

    I have a button in JSP page inside an UIWebView by pressing the button i want to run another
    existing iPhone native application in background only.Do anyone have a solution for this.

    Sounds like a virus.... I hope it's not...
    Launching Other Apps within an iPhone

  • Image in a microsoft toggle button activex

    HI
    I cannot put an picture in a control button(MS Active X) because i do not
    know the type of the proprties "Picture"
    Thanks

    Thomas Esposito wrote
    > i do not know the type of the proprties "Picture"
    > Thanks
    ==========================================
    Hi Thomas,
    Microsoft ActiveX Toggle Button takes following picture file formats in most
    environments (and I think Labview shouldn't be an exception)
    *.(bmp, dib, gif, jpg, wmf, emf, ico) and cur and may be some more
    For inserting picture recommended method is to use properties browser and
    choose the property picture. It is expected that you see a prompt that will
    open load picture dialog box.
    HTH
    Cordially,
    Rishipa
    All reply to this newsgroup please
    ==========================================

  • Toggle button does not work correctly in project preview

    Hello,
    I am working on a project and recently discovered the "toggle button" advanced action that lilibiri posted (Love the toggle button!!). Initially i had used the rollover funktion but found out via html5 tracker, that rollover is not supported by html5 and tablets. To the problem: When I test the slides individually everything works fine. As soon I preview my project and click on my smartshape buttons that toggle the image/text, the project jumps back to previous slides. Now, i probably do not understand the conditional action in terms of what it is actually telling CP to do. So i am guessing it is a user problem. I would be super greatful to anyone who can help me solve this, since i am bound to a dead line to finish this. THANKS!!
    -N
    Here are some screenshots of the conditional actions (its in german..."Ausdruck" is Expression, "Einblenden" is Show, "Ausblenden" is Hide

    Hello,
    You are mixing up Frames with Slides. Try:
    Expression  cpCmndGotoFrame = cpInfoCurrentFrame -1
    Lilybiri

  • How to create multiple toolbar buttons in jsp ?

    hi all,
    how to create multiple toolbar buttons in jsp ?
    plz help me

    mgmt
    plzhttp://www.catb.org/~esr/faqs/smart-questions.html#writewell
    How To Ask Questions The Smart Way
    Eric Steven Raymond
    Rick Moen
    Write in clear, grammatical, correctly-spelled language
    We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway). Answering questions for careless and sloppy thinkers is not rewarding; we'd rather spend our time elsewhere.
    So expressing your question clearly and well is important. If you can't be bothered to do that, we can't be bothered to pay attention. Spend the extra effort to polish your language. It doesn't have to be stiff or formal ? in fact, hacker culture values informal, slangy and humorous language used with precision. But it has to be precise; there has to be some indication that you're thinking and paying attention.
    Spell, punctuate, and capitalize correctly. Don't confuse "its" with "it's", "loose" with "lose", or "discrete" with "discreet". Don't TYPE IN ALL CAPS; this is read as shouting and considered rude. (All-smalls is only slightly less annoying, as it's difficult to read. Alan Cox can get away with it, but you can't.)
    More generally, if you write like a semi-literate b o o b you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like a semi-literate b o o b to save two entire keystrokes.

  • How Do I Make a Toggle Button

    How would I do this?
    I want to create a toggle button, so when the button is in
    it's default position it says "Sound On" and when clicked again it
    says "Sound Off" etc.

    Comp. 792 wrote:
    > How would I do this?
    >
    > I want to create a toggle button, so when the button is
    in it's default position it says "Sound On" and when clicked again
    it says "Sound Off" etc.
    There is many ways to achieve that.
    You could have movie clip with two frames, button in frame 1
    with action go to nextFrame()
    and button in second frame with action go to prevFrame(); so
    they would toogel each other
    back and forth.
    You could have one movie clip with single frame and just an
    action on timeline frame:
    sound1 = new Sound(this);
    sound1.attachSound("loopSound");
    sound1.start(0, 999);
    buttonName.onPress = function() {
    (playing=!playing) ? sound1.stop() : sound1.start(0, 999);
    (give button instance name "buttonName" and you all set ....
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Integrated scroll panels and unmovable toggle buttons

    Hey,
    iam looking for an expert. I am working on an HMI development and wanted to use Flash Catalyst. However, I think I am already reached the limits of FC. But perhaps there is a FC solution because I can not program Flash.
    Problem:
    In my layer, I have different graphical objects and text blocks. A part of them I want to move with a scroll panel. That's easy, not a problem.
    However, all these objects (including the scroll panels) should be integrated in a master scroll panel. This means, that all parts, even the integrated scroll panels, should be moveable at the same time. I managed this.
    Now, I need multiple toggle buttons. With these Buttons I wanted to change the form of some of the graphical objects resp. the text blocks. But the buttons have to be unmovable. This function (to change the form of the objects) is relatively easy but in combination with the integrated scroll panels it isnt. The buttons are able to move the objects when these buttons are pasted in the "deepest" layer, the layer of the objects. But there, the buttons are moveable and slide out of the screen (with the master scroll panel) and not clickable.
    How can I manage this? I need unmovable toggle buttons, with these I want to change the forms of objects. The objects are pasted in integrated scroll panels. I hope it's understandable!
    Can someone help me? It would be glad if the answer does not depend on the learning of the flash programming!
    Thanks.

    After 2 days of banging my head against a wall (doesn't it always go that way)...
    Turns out one of my panels had sub-panels causing the problem. Visibility to the parent panel was controlled by a button on one of the child panels. Once I "promoted" the button to the parent panel, the panel (screen) flow worked great.
    Is this 'undocumented functionality'? Why should it matter how deep the button is nested? (incidentally, the reason it worked in my test environment was the lack of other components - aka the child panel)
    Well, regardless. Thanks to those who gave it thought.

  • Toggle button problem..really urgent

    hi there.. i have a problem with my code and i hope someone can help me as i have a dateline to meet for my programme..
    i have a set of 10 toggle buttons with 1 single actionlistener..
    here is the code
    p3=new JPanel();
    b1=new JPanel();
    ActionListener listener1 = new b1();
    for (int i=1; i<=10;i++)
    JToggleButton button1 = new JToggleButton(("A"+i));
    button1.addActionListener(listener1)
    b1.add(button1);
    p3.add(b1);
    whenever the user activates a button, a textarea below will show the name of the button..
    for example.. if user clicks on A3.. it will appear A3 below..
    this is my code below of wat i have done..
    public class b1 implements ActionListener
    public void actionPerformed(ActionEvent e)
    Object source = e.getSource();
    textarea1.append(((JToggleButton) e.getSource()).getText()+",");
    my problem is this.. if the user were to deactivate the button,the textarea below will not show anything..
    for example, if user click on A4, it should appear A4 in the textarea and when user click on A4 again, the textarea should not show A4 again.
    and if user click on 2 buttons example A1 and A5
    textarea should show A1, A5
    and if user click on A1 again, the textarea should juz show A5 and A1 should not be there.
    any help would be greatly appreciated..=)

    i created 2 sets of buttons like this..
         //Buttons that Starts with A
         b1 = new JPanel();
    JToggleButton[] buttons1 = new JToggleButton[11];     ToggleButtonListener1 listener1 = new ToggleButtonListener1(buttons1);
              for(int i=1; i<buttons1.length; i++)
              buttons1[i] = new JToggleButton("A" + i);
                   buttons1.addActionListener(listener1);
              b1.add(buttons1[i]);
              p3.add(b1);
         //Buttons that Starts With B
              b2 = new JPanel();
         JToggleButton[] buttons2 = new JToggleButton[11];
         ToggleButtonListener1 listener2 = new ToggleButtonListener1(buttons2);
              for(int i=1; i<buttons2.length; i++)
              buttons2[i] = new JToggleButton("B" + i);
              buttons2[i].addActionListener(listener2);
                   b2.add(buttons2[i]);
                   p3.add(b2);
    i bind these 2 groups of buttons in a single actionlistener like this
    class ToggleButtonListener1 implements ActionListener
         private JToggleButton[] array;
         public ToggleButtonListener1(JToggleButton[] array)
              this.array = array;
         public void actionPerformed(ActionEvent e)
              ta1.setText("");
              for(int i=1; i<array.length; i++)
              if(array[i].isSelected())
         ta1.append(array[i].getText() + ",");
              continue;
    the problem i have now is that the 2 sets of buttons are not displayed on the textarea..
    for example if user clicks on A1, the textarea should appear A1 and if user clicks on B1, the textarea should display both A1 and B1.. how do i do that..?

  • Toggle Button in a selection screen

    Hey Folks,
    I am pretty new to Screen/Selection Screen programming. I want to how does one go about adding a toggle button in a selection screen?
    The toggling of a button should trigger
    1) Toggling between visibility of blocks
    2) Toggling the name of the button
    3) Toggling the icon on the button
    Lastly what is the icon for an expan/collapse operation?
    Thanks,
    Puja.
    Edited by: Puja Malhotra on Oct 2, 2008 8:14 AM

    Toggling was made possible with the loop at screen during selection screen output

  • Print button in JSP

    Is it possible to create a PRINT button in JSP which will also "shrink-to-fit" the page too when printing?
    i'm new to JSP as some people know... thank you

    the system im making is for people with very small knowledge of computers and wouldnt know how to shrink to fit a page in print preview... so i want to create a button on the website which will do this for them

  • Word 2010 Ribbon toggle button page size feedback

    For a Word template I am developing a custom ribbon for end-user ease of use and to protect the structure of the document. There is one issue I am currently running into for which I cannot find a solution.
    It started with a footer image which needs to be rescaled with the page width (page size and orientation) while retaining its aspect ratio. Apparently this is not possible without VBA (tried fill image for shape and set relative width, but that leaves
    the height fixed), so now the idea is to get a pull-down menu with toggle buttons for page size and orientation and change the image size using a macro. The options are A4 portrait, A4 landscape, A3 portrait and A3 landscape. The problem now is how
    to get the run-time feedback of page size and orientation to highlight the page setup of the active section, like the built-in size and orientation buttons.
    Hopefully this can be done.

    Hi AlexFolmer,
    Sorry for the delay.
    >> Create a custom ribbon menu with buttons to select the paper size, this can be done without too much effort. However, if this is to be implemented I would like the button representing the current paper size/layout to be highlighted in the same way
    as the Word native paper size/orientation buttons do
    Do you mean that you want to create a custom ribbon menu for user to select the Page size, and when you click the ribbon button, the current page size could be highlight. In my option, you could do as below:
    1.  Add a Combobox into the custom ribbon, set the items with “Item1”, “Item2”
    2. Add event to comboBox1_TextChanged, key code like below:
    private void comboBox1_TextChanged(object sender, RibbonControlEventArgs e)
    if (comboBox1.Text == "Item1")
    Globals.ThisDocument.PageSetup.PaperSize = Microsoft.Office.Interop.Word.WdPaperSize.wdPaperA3;
    else if (comboBox1.Text == "Item2")
    Globals.ThisDocument.PageSetup.PaperSize = Microsoft.Office.Interop.Word.WdPaperSize.wdPaperA5;
    For combobox, it has the function to highlist the selected item. At this time, we need to solve the issue for opening the document, the combobox would show the current pagesize. You could refer the code below:
    private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
    if (Globals.ThisDocument.PageSetup.PaperSize == Microsoft.Office.Interop.Word.WdPaperSize.wdPaperA5)
    comboBox1.Text = "Item2";
    You could refer the link below for more information about Globals.ThisDocument.PageSetup.PaperSize
    Reference:
    https://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.pagesetup.papersize(v=office.11).aspx
    In addition, if you have issues about PageSetup.PaperSize, I will recommend you post a new thread.
    The reason why I suggested is:
    #1 There would be more community members to discuss the question.
    #2 For people who have the similar question, it would be easier for them to find the answer from a specific thread.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Changing the functionality of mouseClicked via Toggle Buttons

    Hi,
    I want to be able to change the drawings produced by clicking the mouse by choosing what I want to draw from a series of toggle buttons on my GUI.
    I have an on my GUI, on top of a jPanel and when I click on it each click draws a red circle on the point of the image I click on.
    Now I want to be able to choose what my click will draw on the image through toggle buttons that I've added on the GUI to illustrate what each ToggleButton will enable to draw.
    For example a toggle button should enable the mouse to draw the number 1 on the image when clicking, while another toggle Button enables the mouse to draw red circleso on the image.
    Please help, I'm kinda lost here.

    I want to change what is drawn to the screen using clicks with the usage of toggle buttons.
    This class I have enables me to draw red oval shapes with a single click on an image on the top of a jPanel.
    public class GPanel extends javax.swing.JPanel {
    private int xPos = -1;
    private int yPos = -1;
    BufferedImage img;
    private boolean updateFlag = false;
    public void setUpdate(boolean b)
    updateFlag = b;
    @Override
    public void paint(Graphics g) {
    g.drawImage(img, 0, 0, null);
    if (updateFlag == true)
    repaint();
    updateFlag = false;
    clearVectors();
    else
    for (int i = 0; i <xCoordinates.size(); i++)
    xPos = (Integer)xCoordinates.get( i );
    yPos = (Integer)yCoordinates.get( i );
    g.setColor(Color.RED);
    g.drawOval(xPos, yPos, 25, 25);
    g.fillOval(xPos, yPos, 25, 25);
    public void clearVectors()
    xCoordinates.clear();
    yCoordinates.clear();
    public GPanel() {
    try {
    img = ImageIO.read(new File("I:\\fr.jpg"));
    } catch (IOException e) {
    @Override
    public Dimension getPreferredSize() {
    if (img == null) {
    return new Dimension(100,100);
    } else {
    return new Dimension(img.getWidth(null), img.getHeight(null));
    private Vector xCoordinates = new Vector();
    private Vector yCoordinates = new Vector();
    public void setCoordinates(int xPos, int yPos)
    xPos = _xPos;
    yPos=_yPos;
    xCoordinates.add(_xPos);
    yCoordinates.add(_yPos);
    public void update()
    this.repaint();
    public BufferedImage toImage() {
    BufferedImage im = new BufferedImage(1024, 768, BufferedImage.TYPE_INT_RGB);
    Graphics gr = im.getGraphics();
    this.paint(gr);
    return im;
    public static void main(String[] args) {
    JFrame f = new JFrame("Load Image Sample");
    f.addWindowListener(new WindowAdapter(){
    @Override
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    f.add(new GPanel());
    f.pack();
    f.setVisible(true);
    And this is the mouse event handler that draws with the click...
    private int xPos,yPos;
    private void gPanel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_gPanel1MouseClicked
    xPos = evt.getX();
    yPos = evt.getY();
    gPanel1.setCoordinates(xPos,yPos);
    gPanel1.paint( gPanel1.getGraphics());
    But now I want to change the thing that is drawn with pressing toggle buttons on my GUI...
    And I don't know what to modify in the code and how to do it....I'm looking for an elegant way so that I can reuse the code that I have written. Just change the thing what will be drawn with the mouse click...

Maybe you are looking for

  • How do I transfer everything from iPhone 3GS to my new iPhone 4S?

    I purchased an iPhone 4S to replace my iPhone 3GS (which I will keep for spare, other chores).  What I assumed I could do (and it seems I accomplished when I had upgraded from a 3G to 3GS) was that there was a way to restore my 3GS backup to the iPho

  • CS3 JS progress bar function

    I'm trying to create a progress bar function but the code below creates 6 instances of the progress window rather than updating the info in the first window.  I've gone the for loop process to make progress bars work is this the only way it can be us

  • Preverify and inner classes

    Hi. I'm trying to use a makefile to reduce build time for my project. The way it works: 1. compile all the altered .java files 2. preverify all of the replaced/new .class files from step 1 -- each individual file by file. However, I've run into a ser

  • Bug in Cipher ?

    I ve come across what I believe is a bug in the JRE. Posting to this forum to get input from someone else and double check I m not missing something before I submit a bug report. In a nutshell, if I pass a bytebuffer which has a position >0 to the me

  • Ne pas remplir un tableau avec les valeur par default

    Bonjour Voila mon problème. L'utilisateur doit selectionner une zone sur une image et l'ajouter à une liste. Il peut aller jusqu'à 3 zones. Il peut également choisir le mode de traitement de l'ensemble des zones. Lorsqu'il démare l'acquisition, on en