How2 implement back button

Hi Everyone!
I have a static webpage with a link to an htmldb application (no authentication, just a report).
I would like to create a browser back button in htmldb, that does just this:
onClick="history.back()"
But all created buttons demanded a page (in htmldb - or url) to branch to.
What would be the best way to implement such an back button?
Thanks,
Michael

Hi Michael,
i think your HTMLDB-page is a report. So do the following steps:
1. Create a button
2. Select the region for the button
3. Select "Create a button in a region position"
4. Give the button a name and a label and - that's important - select as action "Redirect to URL without submitting page"
5. On the wizard page for branching select as target "URL" and enter the URL (at the bottom of the page) "javascript:history.back()"
6. Click "Create button"
That's all.
Thomas ;-)

Similar Messages

  • Implementing a "back button" in a JSC project.

    I would like to give my use a "back button" that acts like the back button on most browsers.
    In other words, add a button to a page and when the user clicks that button, the user will be sent back to the previous page just like if they clicked the back button on the browser.
    I assume that this can be done using the onClick Javascript event for the button, but what exactly needs to be done in that method?
    I searched the Internet and it looks like something like this might work:
    Go back
    But how to convert that to JavaScript inside the JSC app I do not know.
    Does anyone know how this is done?

    Note that I tried adding:
    history.back()to the onClick event, but that didn't do anything.
    My full page code looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <jsp:text><![CDATA[
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    ]]></jsp:text>
        <f:view>
            <html lang="en-US" xml:lang="en-US">
                <head>
                    <meta content="no-cache" http-equiv="Cache-Control"/>
                    <meta content="no-cache" http-equiv="Pragma"/>
                    <title>DisplayDiagnosis Title</title>
                    <link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>
                </head>
                <body style="-rave-layout: grid">
                    <h:form binding="#{DisplayDiagnosis.form1}" id="form1">
                        <h:panelGrid binding="#{DisplayDiagnosis.centeringGridPanel}" columns="1" id="centeringGridPanel" style="left: 0px; top: 0px; position: absolute">
                            <h:graphicImage binding="#{DisplayDiagnosis.image1}" id="image1" value="resources/myLogo.JPG"/>
                            <h:panelGrid binding="#{DisplayDiagnosis.diagnosisPanel}" columns="3" footerClass="" id="diagnosisPanel"/>
                            <h:panelGroup binding="#{DisplayDiagnosis.groupPanel1}" id="groupPanel1" style="height: 50px; width: 100px">
                                <h:commandButton binding="#{DisplayDiagnosis.button1}" id="button1" onclick="history.back()" value="Back"/>
                            </h:panelGroup>
                        </h:panelGrid>
                    </h:form>
                </body>
            </html>
        </f:view>
    </jsp:root>

  • Back buttons and required fields...how to implement?

    Hello
    I would like some thoughts on the best approach to the following problem please.
    -You have a wizard, lets say made up of 2 pages.
    -Page 2 has some required fields.
    -User goes from page 1 to page 2 then wants to return to page 1 for whatever reason.
    -(Assuming they havent filled in the required components), what is the best way to let the user navigate back to page 1, without the system kicking in its required fields warnings etc..
    One option I have thought of is populating the fields myself, but this feels like a hack.
    Second option could be to edit the required=#{} of the required components when the back button is pressed?
    Any thoughts?
    JC.
    Message was edited by:
    jamesclinton

    Good tip.
    ok, back to the main thread. immediate = true will result in any data the user entered being forgotten. The solution does by-pass the required rules, so its a mini result.
    Tomahawk does have a stateSave component.
    <t:saveState id="save" value="#{bean.xxx}" />
    And a JavaScipt listener component.. I'm thinking both or one of these could be used to remember/store the state..
    If anyone has any other solutions then please post.
    JC
    Message was edited by:
    jamesclinton

  • Is it possible to invalidate session when I click my browsers back button

    Hai
    I have a question.
    I am building a jsp page with multiple forms.As of now,
    no login system has been implemented.
    I need my session to time out when the client click on the back
    button on the browser to prevent data corruption.
    Is there a possible way to do this in Java/ Script
    I know the use of session.invalidate() but how to tie it up to the
    browser's back button
    A second problem
    If I use session.invalidate() on Tomcat 3.2
    I find that it is not invalidated.But this same function on tomcat 4
    doesn't have any problem
    Could anyone help on these issues
    Thanks

    You don't mean you want to invalidate session every time you move to a new page, do you? If you do, after implementation of login system the users will be asked for passwords at each page. If you don't, it's better to use headers for your response.
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Expires", "-1");

  • Reporting Services add (browser) back button

    Dear all,
    I have a client that has 4 reports; 1 main, and 3 that are rendered when the user clicks the report data on the main report (which passes parameters to generate the other 3).
    They would like to have a back button in the report header of the 3 reports (they don't want to use the browser back button).
    Is this possible using a text box, then editing the navigation properties and does anyone have an example? Or am I missing something quite obvious?
    Any help would be gratefully received!!
    Dan

    Check this link on how to implement it
    http://road-blogs.blogspot.com/2010/04/adding-breadcrumbs-to-your-drillthrough.html
    Cheers,
    Jason
    P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)

  • Making sure you can't use back button to go back to a secure page

    I am wondering how I can go about ensuring that the user of my application can not use the back button to go back to a secure page after leaving it.
    What is the easiest way to implement this added security?
    Thank you.

    I think the easiest way would be to put in a javascript that opens a page of your choice (such as the home page of a site, for example) and another javascript that closes the browser window. You can get the new window script by clicking here. I'm not sure about the close browser window javascript, but I know that there is a close browser (kills the whole browser, and all the open windows) available here, but that may be a bit overkill. I think you could redo the javascript on the first one so it says something like close_window , but I'm new to javascript and wouldn't know for sure...
    Hope this helps!

  • How to resubmit the form when back button pressed

    Hi,
    In my application, iam implementing searching,
    when i submitting the form, i got some records and i navigated all the results through next and previous buttons.
    Problem occurs when i clicked on back button, it is showing "page expires and asking for resubmit the data".
    How can i show the previous page, when user clicked on back button.
    Iam using struts 1.0 and ibatis
    Please help me out.
    Thanks in advance,
    Mohan

    Hi mohan,
    try to store your search indices in a vector and put that vector in the session scope. at page first loading you get the first index from your vector and pass it in the request scope in your action class, due to the page you have to find a way to understand the passed index in request scope and translate it to the searched word location.really I have not a code sample, but it is just an idea.
    feel free to ask me.
    Thanks.
    Ahmad Elsafty

  • In IPhone Apps crash when press back buton . When press back back button Last class is appeared slightly slighly ash, with no error or warning .

    Hi,
    I am developing apps on for 4.1 and on Xcode3.2. My Apps crash when press back buton . When press back back button Last class is appeared slightly than crash, with no error or warning ....Here are the code....crash on Back Funtion
    #import "TransactionSummaryDetailViewController.h"
    #import "TransactionSummaryData.h"
    #import "Constant.h"
    #import "DataBase.h";
    #import "Common.h"
    #import "YPCardHolderServiceService.h"
    #import "SelectionScreenViewController.h"
    @implementation TransactionSummaryDetailViewController
    @synthesize table,cardReference;
    @synthesize waitIndicator,transactionsummary,keyArray,valueArray,isSummaryAvailable;
    @synthesize startDate,endDate;
    // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
        if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
            // Custom initialization
        return self;
    -(void)getrowcount{
        if(transactionsummary.cardholdernmae !=nil){
            [keyArray addObject:@"Card Holder Name: "];
            [valueArray addObject:transactionsummary.cardholdernmae];
        if(transactionsummary.cardnumber!=nil){
            [keyArray addObject:@"Card Number: "];
            [valueArray addObject:transactionsummary.cardnumber];
        if(transactionsummary.debittransactioncount != nil){
            [keyArray addObject:@"Debit Tx. Count: "];
            [valueArray addObject:transactionsummary.debittransactioncount];
        if(transactionsummary.debittransactionvalue!=nil){
            [keyArray addObject:@"Debit Tx. Value"];
            [valueArray addObject:transactionsummary.debittransactionvalue];
        if(transactionsummary.credittransactioncount!=nil){
            [keyArray addObject:@"Credit Tx. Count: "];
            [valueArray addObject:transactionsummary.credittransactioncount];
        if(transactionsummary.credittransactionvalue!=nil){
            [keyArray addObject:@"Credit Tx. Value: "];
            [valueArray addObject:transactionsummary.credittransactionvalue];
    // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    - (void)viewDidLoad {
        appDelegate = [[UIApplication sharedApplication]delegate];
        keyArray = [[NSMutableArray alloc]init];
        valueArray = [[NSMutableArray alloc]init];
        [self getrowcount];
        NSLog(@"Key Array Count is %d",[keyArray count]);
        [table setBackgroundColor:[UIColor clearColor]];
        [table setSeparatorColor:TableViewCellSeperatorColor];
        [waitIndicator setHidden:YES];
        [self setTitle:@"Summary Details"];
        UIButton *button =  [UIButton buttonWithType:UIButtonTypeCustom];
        [button setImage:[UIImage imageNamed:@"list.png"] forState:UIControlStateNormal];
        [button addTarget:self action:@selector(BacktoView) forControlEvents:UIControlEventTouchUpInside];
        [button setFrame:CGRectMake(0, 0, 76, 44)];
        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
        if(!isSummaryAvailable)
            if([Common isNetworkAvailable])
                [waitIndicator startAnimating];
                YPCardHolderServiceService *services = [[YPCardHolderServiceService alloc] init];
                YPTransactionsSummaryRequest *summaryRequest = [[YPTransactionsSummaryRequest alloc] init];
                summaryRequest.SC = appDelegate.SC;
                summaryRequest.userName = appDelegate.userName;
                summaryRequest.valid =TRUE;
                summaryRequest.cardReference =[NSString stringWithFormat:@"%@",cardReference];
                NSLog(@"Start Date Is %@ and End Date is %@",startDate,endDate);
                summaryRequest.startDate = startDate;
                summaryRequest.endDate = endDate;
                summaryRequest.applicationType = @"M";
                [services getTransactionsSummary:self action:@selector(getTransactionsSummaryHandlers:) transactionsSummaryRequest:summaryRequest];
                [summaryRequest release];
                [services release];
        [super viewDidLoad];
    //Handle the Response of getTransactionsSummary
    -(void)getTransactionsSummaryHandlers:(id) value
        [waitIndicator stopAnimating];
        // Handle errors
        if([value isKindOfClass:[NSError class]]) {
            NSLog(@"%@", value);
            return;
        // Handle faults
        if([value isKindOfClass:[SoapFault class]]) {
            NSLog(@"%@", value);
            return;
        // Do something with the YPLoginResponse* result
        YPTransactionsSummaryResponse* result = (YPTransactionsSummaryResponse*)value;
        if(result.statusCode == 0)
            NSLog(@"Number of Transaction is =%d",[result.transactionSummaryList count]);
            NSLog(@"Step 1 ='%@'",appDelegate.userID);
            NSString *deleteQuery = @"delete from TransactionSummary where userid = ";
            NSLog(@"Step 1 ='%@'",appDelegate.userID);
            deleteQuery = [deleteQuery stringByAppendingString:[NSString stringWithFormat:@"%@ and cardreference = '%@'",appDelegate.userID,cardReference]];
            NSLog(@"delete query= '%@'",deleteQuery);
            [DataBase deleteDataFromTable:deleteQuery];
            NSLog(@"delete query= '%@'",deleteQuery);
            //for (int i =0; i< [result.transactionSummaryList count]; i++)
            for (int i =0; i< [result.transactionSummaryList count] -2; i++)
                NSLog(@"for loop= %d",i);
                YPTransactionSummaryDetails *transactionSummary = (YPTransactionSummaryDetails*)[result.transactionSummaryList objectAtIndex:i];
                NSLog(@"cardholdername= '%@'",transactionSummary.cardholderName);
                /*NSString *insertQuery = @"Insert into TransactionSummary(cardholdername,cardnumber,debittransactioncount,debittransac tionvalue,credittransactioncount,credittransactionvalue,userid) values(";
                insertQuery =[insertQuery stringByAppendingString:[NSString stringWithFormat:@"'%@','xxxx xxxx xxxx %@',%d,%d,%d,%d,'%@',%@)",
                                                                   transactionSummary.cardholderName,transactionSummary.cardNumber,transactionSumm ary.debitTransactionCount,
                                                                   transactionSummary.debitTransactionValue,transactionSummary.creditTransactionCo unt,transactionSummary.creditTransactionValue,
                                                                   appDelegate.userID]];*/
                //Add by sarvesh
                NSString *insertQuery = @"Insert into TransactionSummary(cardholdername,cardnumber,debittransactioncount,debittransac tionvalue,credittransactioncount,credittransactionvalue,cardreference,userid) values(";
                insertQuery =[insertQuery stringByAppendingString:[NSString stringWithFormat:@"'%@','%@',%d,%d,%d,%d,'%@',%@)",
                                                                   transactionSummary.cardholderName,transactionSummary.cardNumber,transactionSumm ary.debitTransactionCount,
                                                                   transactionSummary.debitTransactionValue,transactionSummary.creditTransactionCo unt,transactionSummary.creditTransactionValue,cardReference,
                                                                   appDelegate.userID]];
                NSLog(@"Insert Query for Transaction Summary is %@",insertQuery);
                [DataBase InsertIntoTable:insertQuery];
            //Read Update Data From DataBase and Refresh Table
                NSString *query = @"Select * from TransactionSummary where userid = ";
                query = [query stringByAppendingString:[NSString stringWithFormat:@"%@ and cardreference = '%@'",appDelegate.userID,cardReference]];
            NSLog(@"select query= %@",query);
                NSMutableArray *temp=[DataBase getTransactionSummaryTableData:query];
                if([temp count] > 0)
                    transactionsummary = (TransactionSummaryData*)[temp objectAtIndex:0];
                    [keyArray removeAllObjects];
                    [valueArray removeAllObjects];
                [self getrowcount];
                [table reloadData];
    -(void)viewDidAppear:(BOOL)animated
        CGFloat navBarHeight = 50.0f;   
        CGRect frame = CGRectMake(0.0f, 20.0f, 320.0f, navBarHeight);
        [self.navigationController.navigationBar setFrame:frame];
        [super viewDidAppear:animated];
    -(IBAction)BacktoView
        NSLog(@"in back function..TrasactionSummaryDetail");
        SelectionScreenViewController *screenView=[[SelectionScreenViewController alloc] initWithNibName:@"SelectionScreenViewController" bundle:nil];
        [self.navigationController popViewControllerAnimated:YES];
        [screenView release];
    - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath{
        return UITableViewCellEditingStyleNone;
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
        return 1;
    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
        return cellHeightForGroupedTable;
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
        if(section == 0)
            return [keyArray count];
        else       
            return 0;
    - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
        NSString *title = nil;
        switch (section){
            case 0:{
                //title = @"Summary Details";
                break;
        return title;
    - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
        if ([self tableView:tableView titleForHeaderInSection:section] != nil) {
            return tableHeaderHeight;
        else {
            // If no section header title, no section header needed
            return 0;
    - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
        NSString *sectionTitle = [self tableView:tableView titleForHeaderInSection:section];
        if (sectionTitle == nil) {
            return nil;
        // Create label with section title
        UILabel *label = [[[UILabel alloc] init] autorelease];
        label.frame = CGRectMake(20, 6, 300, 30);
        label.backgroundColor = [UIColor clearColor];
        label.textColor = HeaderTextColor;
        label.shadowColor = HeaderTextShadowColor;
        label.shadowOffset = CGSizeMake(0.0, 1.0);
        label.font = HeaderTextFontSize;
        label.text = sectionTitle;
        // Create header view and add label as a subview
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320,60)];
        [view autorelease];
        [view addSubview:label];
        return view;
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
        UITableViewCell *cell = nil;
        NSString *cellIdentifier;
        cellIdentifier = @"SectionsTableIdentifier";
        int row = [indexPath row];
        CGRect nameLabelRect = CGRectMake(19 , 8, 240, 29);
        CGRect cardlabelRect = CGRectMake(19,31,240,15);
        UILabel *nameLabel = [[UILabel alloc] initWithFrame:nameLabelRect];
        UILabel *cardnumber = [[UILabel alloc] initWithFrame:cardlabelRect];
        cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
        if(cell == nil){
            cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:cellIdentifier] autorelease];
        // Remove all subview from cell content view
        for (UIView *view in cell.contentView.subviews){
            [view removeFromSuperview];
         [cell setAccessoryType:UITableViewCellAccessoryNone];
        [nameLabel setTextColor:firstLabelFontColor];
        [nameLabel setFont:firstLabelFont];
        [nameLabel setFont:firstLabelFontSize];
         nameLabel.textAlignment = UITextAlignmentLeft;
         nameLabel.text = [NSString stringWithFormat:@"%@ : %@",[keyArray objectAtIndex:row],[valueArray objectAtIndex:row]];
         [cell.contentView addSubview: nameLabel];
         cell.selectionStyle = UITableViewCellSelectionStyleNone;
        [cell setBackgroundColor:[UIColor clearColor]];
        [cell setBackgroundColor:TableViewCellColor];
        [nameLabel setBackgroundColor:[UIColor clearColor]];
        [cardnumber setBackgroundColor:[UIColor clearColor]];
        [cardnumber release];
        [nameLabel release];
        return cell;
    // Override to allow orientations other than the default portrait orientation.
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceO rientation {
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    - (void)didReceiveMemoryWarning {
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];
        // Release any cached data, images, etc that aren't in use.
    - (void)viewDidUnload {
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    - (void)dealloc {
        [table release];
        [waitIndicator release];
        [keyArray release];
        [valueArray release];
        [transactionsummary release];
        [super dealloc];
    @end

    This is the user-to-user tech support site.  For carrier issues go to the Dev forums.
    You might want to note that the current iOS is 4.3.3, and the current SDK is 4.3 and XCode 4.0.2

  • How can I "expire" a web page (prevent BACK button access)

    How can I "expire" a web page ?
    I know some sites will display the following message if we click on the
    BACK button in your browser.
    Warning: Page has Expired The page you requested was created using
    information you submitted in a form. This page is no longer available. As a
    security precaution, Internet Explorer does not automatically resubmit your
    information for you.
    To resubmit your information and view this Web page, click the Refresh
    button.
    How do I implement this feature??

    U want to disable back button click
    if yes i think
    javascript:window.history.forward(1);

  • Need help with java browser "Back" button

    All:
    I'm trying to make the "Back" button in my Java web browser work. Any help would be greatly appreciated. Here is my code:
    import javax.swing.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.util.*;
    import java.io.*;
    import javax.swing.text.html.*;
    import javax.swing.text.*;
    public class Browser implements HyperlinkListener, ActionListener
    String source = "http://www.google.com";
    final String GO = "Go";
    final String Back = "Back";
    JEditorPane ep = new JEditorPane(); //a JEditorPane allows display of HTML & RTF
    JToolBar tb = new JToolBar(); //a JToolBar sits above the JEditorPane & contains
    JTextField tf = new JTextField(40); // the JTextField & go button
    JLabel address = new JLabel(" Address: ");
    JButton back = new JButton(Back);
    JButton go = new JButton(GO);
    BorderLayout bl = new BorderLayout();
    JPanel panel = new JPanel(bl);
    JFrame frame = new JFrame("Billy Wolfe's Browser");
    protected Vector history;
    public Browser()
    openURL(source); //this method (defined below) opens a page with address source
    ep.setEditable(false); //this makes the HTML viewable only in teh JEditorPane, ep
    ep.addHyperlinkListener(this); //this adds a listener for clicking on links
    JScrollPane scroll = new JScrollPane(ep); //this puts the ep inside a scroll pane
    panel.add(scroll,BorderLayout.CENTER); //adds the scroll pane to center of panel
    tf.setActionCommand(GO); //gives the ActionListener on tf a name for its ActionEvent
    tf.setActionCommand(Back);
    tf.addActionListener(this); //adds an ActionListener to the JTextField (so user can
    go.addActionListener(this); //use "Enter Key")
    tb.add(back); //this adds the back button to the JToolBar
    tb.add(address); //this adds the Label "Address:" to the JToolBar
    tb.add(tf); //this adds the JTextField to the JToolBar
    tb.add(go); //this adds the go button to the JToolBar
    panel.add(tb,BorderLayout.NORTH); //adds the JToolBar to the top (North) of panel
    frame.setContentPane(panel);
    frame.setSize(1000,900);
    frame.setVisible(true);
    }// end Browser()
    public void openURL(String urlString)
    String start = urlString.substring(0,4);
    if(!start.equals("http")) //adds "http://" to the URL if needed
    urlString = "http://"+urlString;
    }//end if
    try
    URL url = new URL(urlString);
    ep.setPage(url); //this sets the ep page to the URL page
    tf.setText(urlString); //this sets the JTextField, tf, to the URL
    catch (Exception e)
    { System.out.println("Can't open "+source+" "+e);
    }//end try-catch
    }//end openURL
    public void hyperlinkUpdate(HyperlinkEvent he) //this allows linking
    HyperlinkEvent.EventType type = he.getEventType();
    if(type == HyperlinkEvent.EventType.ACTIVATED)
    openURL(he.getURL().toExternalForm());
    history.add(he.getURL().toExternalForm());
    }//end hyperlinkUpdate()
    public void actionPerformed(ActionEvent ae) //for the GO and BACK buttons
    String command = ae.getActionCommand();
    if(command.equals(GO))
    openURL(tf.getText());
    history.add(tf.getText());
    //JOptionPane.showMessageDialog(null, "This is a test");
    if(command.equals(Back))
    try
    String lastURL = (String)history.lastElement();
    history.removeElement(lastURL);
    lastURL = (String)history.lastElement();
    // JOptionPane.showMessageDialog(null, lastURL);
    ep.setPage(lastURL);
    if (history.size() == 1)
    back.setEnabled(false);
    catch (Exception e)
    System.out.println("ERROR: Trouble fetching URL");}
    }//end actionPerformed()
    }// end Browser class

    Here it is. I need to be able to click the Back button and view the previous URL.
    import javax.swing.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.util.*;
    import java.io.*;
    import javax.swing.text.html.*;
    import javax.swing.text.*;
    public class Browser implements HyperlinkListener, ActionListener
    String source = "http://www.google.com";
    final String GO = "Go";
    final String Back = "Back";
    JEditorPane ep = new JEditorPane(); //a JEditorPane allows display of HTML & RTF
    JToolBar tb = new JToolBar(); //a JToolBar sits above the JEditorPane & contains
    JTextField tf = new JTextField(40); // the JTextField & go button
    JLabel address = new JLabel(" Address: ");
    JButton back = new JButton(Back);
    JButton go = new JButton(GO);
    BorderLayout bl = new BorderLayout();
    JPanel panel = new JPanel(bl);
    JFrame frame = new JFrame("Billy Wolfe's Browser");
    protected Vector history;
    public Browser()
    openURL(source); //this method (defined below) opens a page with address source
    ep.setEditable(false); //this makes the HTML viewable only in teh JEditorPane, ep
    ep.addHyperlinkListener(this); //this adds a listener for clicking on links
    JScrollPane scroll = new JScrollPane(ep); //this puts the ep inside a scroll pane
    panel.add(scroll,BorderLayout.CENTER); //adds the scroll pane to center of panel
    tf.setActionCommand(GO); //gives the ActionListener on tf a name for its ActionEvent
    tf.setActionCommand(Back);
    tf.addActionListener(this); //adds an ActionListener to the JTextField (so user can
    go.addActionListener(this); //use "Enter Key")
    tb.add(back); //this adds the back button to the JToolBar
    tb.add(address); //this adds the Label "Address:" to the JToolBar
    tb.add(tf); //this adds the JTextField to the JToolBar
    tb.add(go); //this adds the go button to the JToolBar
    panel.add(tb,BorderLayout.NORTH); //adds the JToolBar to the top (North) of panel
    frame.setContentPane(panel);
    frame.setSize(1000,900);
    frame.setVisible(true);
    }// end Browser()
    public void openURL(String urlString)
    String start = urlString.substring(0,4);
    if(!start.equals("http")) //adds "http://" to the URL if needed
    urlString = "http://"+urlString;
    }//end if
    try
    URL url = new URL(urlString);
    ep.setPage(url); //this sets the ep page to the URL page
    tf.setText(urlString); //this sets the JTextField, tf, to the URL
    catch (Exception e)
    { System.out.println("Can't open "+source+" "+e);
    }//end try-catch
    }//end openURL
    public void hyperlinkUpdate(HyperlinkEvent he) //this allows linking
    HyperlinkEvent.EventType type = he.getEventType();
    if(type == HyperlinkEvent.EventType.ACTIVATED)
    openURL(he.getURL().toExternalForm());
    history.add(he.getURL().toExternalForm());
    }//end hyperlinkUpdate()
    public void actionPerformed(ActionEvent ae) //for the GO and BACK buttons
    String command = ae.getActionCommand();
    if(command.equals(GO))
    openURL(tf.getText());
    history.add(tf.getText());
    //JOptionPane.showMessageDialog(null, "This is a test");
    if(command.equals(Back))
    try
    String lastURL = (String)history.lastElement();
    history.removeElement(lastURL);
    lastURL = (String)history.lastElement();
    // JOptionPane.showMessageDialog(null, lastURL);
    ep.setPage(lastURL);
    if (history.size() == 1)
    back.setEnabled(false);
    catch (Exception e)
    System.out.println("ERROR: Trouble fetching URL");}
    }//end actionPerformed()
    }// end Browser class

  • Browser back button not maintain selections on previous page?

    Hi every one
    1. The following is my code for a home page.
    <h:form>
        <h:selectManyCheckbox value="#{home.value}">
             <f:selectItems  value="#{brandItems}"/>                  
        </h:selectManyCheckbox>
        <h:commandButton action="#{home.display}" value="Submit" />
        <s:link value="view newxt page" action="#{temp.getAll}" view="/table.xhtml" />
    </h:form>2. This is my session bean code
    @Stateful
    @Name("home")
    public class TempAction  implements Temp,Serializable
         private static final long serialVersionUID = 1L;
         String []value;
        @Out(required=false)
        List<SelectItem> brandItems;
         @Begin(join=true)
         public void getAll() {
              brandItems=new ArrayList<SelectItem>();
              brandItems.add(new SelectItem("First","First"));
              brandItems.add(new SelectItem("Second","Second"));
         public String[] getValue() {
              return value;
         public void setValue(String[] value) {
              this.value = value;
         public void display() {
              for(String a:value)
                   System.out.println("________________"+a);
        @End
        public void reset() {}
        @Destroy
        @Remove
        public void destroy() {}
    }3. I invoke getAll method by using following code in my pages.xml
    After visiting the second page by clicking the s:link , I go back to the first page by using browser BACK button . Then when I hit the SUBMIT button, I get the following error message in my jboss console and also the check boxs are deselected.
    16:29:05,843 INFO  [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
    sourceId=j_id16:j_id17[severity=(ERROR 2), summary=(value is not valid), detail=(value is not valid)]Kindly assist to resolve this problem. Many thanks in anticipation.
    By
    Thiagu.m

    Did you ever find a solution? I'm having this issue also.

  • How to set a back button to the caller page

    Hello,
    An application have a page that can be called by several other pages, for instance, an "addContact.faces" can be called by several other forms, when the user adds the contact or press a back button, the application should go back to the caller page.
    How can I implent this?
    Thanks in advance,
    Juan

    As an alternative, you could Ajax the stuff and put it in a popup div, which is a common technique nowadays. Then the user doesn't even navigate away from the page he/she was on, plus it is relatively easy to implement in a generic way so multiple pages can use it.
    Search for "css popup div" on google if you want to see this in action.

  • How to call custom BSP application on click of BACK button for SC in EBP.

    Hi All,
    We are implementing OCI using custom BSP applications.In EBP SC screen ,in step1 (Select Goods/Services), the links for these BSP applications are displayed.
    The user can create a shopping cart using these applications , after the items are transfered from BSP to SC on standard  EBP screen , in step2
    there are four buttons ,
    1)Refresh
    2)Check
    3)Back
    4)Continue.
    We need to call one of our custom BSP applications on click of  this BACK button
    How can i acchieve the same?
    Do i need to make changes in the standard ITS application or thers some other way?
    Thanks,
    Anubhav.
    Edited by: Anubhav Jain on Jul 1, 2008 7:24 AM

    To call a wd abap application from BSP use the method CL_WD_UTILITIES=>CONSTRUCT_WD_URL then just create a link in bsp with the url returned like this:
    <a href="url">Link</a>
    To pass data from wd abap to bsp or vice versa that a look at this blog: /people/koen.labie2/blog/2006/11/29/eating-cookies-with-webdynpro-and-bsp
    regards,
    Fabio Louzada Saito

  • IPhone: NavigationController Back Button

    The back button on a navigationController is supposed to be automatic, right? I have a table view hierarchy with a navigation controller that has two table views. I can click on a cell in the root view and it does the transition to the next view. However, when I click on the "back" button on the navigationController, the navigationController does a transition and displays the title of the root view, but the table view does not change back to the root view. I checked, and the stack still contains two objects after this half-transition. I can call popViewControllerAnimated myself from the second view, but I didn't think this was necessary. Also, I wouldn't know where to Is there some sort of flag I need to set if I want popViewControllerAnimated to be called automatically?
    Thank You,
    Bridger Maxwell

    I have looked through a few examples which use the UINavigationBar, and I can not find any differences between their code and mine. I even used a lot of code directly from one example. It is quite puzzling.
    Just so I can check, is there a way to prevent the back button from working by catching a message or something? I found
    - (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item
    in the docs as a method you can implement for a UINavigationBarDelegate protocol, but I can't even set the delegate for the UINavigationBar because I am using a UINavigationBarController, and the docs say I should never access the UINavigationBar inside the UINavigationBarController. I am really quite puzzled on this.
    Thank You,
    Bridger Maxwell

  • Cannot click back button on Internet Explorer,

    Dear Sir,
    In content Management  of EP6 SP14, KM content we cannot click "back button" in IE menu.  if we click back , it will show the error.
    How to solve this problem.
    Thank you and best regards,
    Vimol

    Hi Vimol,
    you can not solve this problem. The browser functions 'back', 'forward' and 'refresh' do not work properly on SAP EP 6. That's why you find the navigation links and the portal history in the portal header.
    There is a feature called 'External facing portal' or 'EFP' that solves your issue by rendering one HTML file for every portal page. But you'll have some restrictions concerning business packages, KM and collaboration when using EFP.
    There are a lot of threads in SDN about EFP, but here is an entry point:
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/43/13fd52a5732ba9e10000000a1553f6/frameset.htm">Implementing an external facing portal</a>
    Please be aware that EFP comes with NW2004s SPS6
    HTH,
    Carsten

Maybe you are looking for

  • Artist profile picture gone in music app, how to get it back?

    Hi Guys, I got an Iphone 5s 16gb space grey recently and i restored from backup after updating it from 7.1 to 7.1.2. I noticed that from my backup before and my old phone before my 5s (4s) that in the artists view in the Music app, there were artists

  • Using Time Machine for an external startup drive

    I've never used Time Machine; I just kept on using my older backup startup drive software when starting with Leopard three years ago. My husband is getting a new iMac with an external drive for backup because I convinced him that Time Machine is so e

  • SOA Suite Cluster: Can't seem to get it to work on a single machine

    Hi I'm new to clustering but the manuals are fairly straightforward so I thought I'd test out a load balanced SOA Suite. I've installed 3 homes (for the moment) 1 and 2 contain HTTP server and OC4J_SOA and the 3rd is the ADMIN home. I've set all up t

  • MPEG 4 Plays as a white screen

    Hi all, In the past I have had no problems convering files to play on my iphone, until now. I have a new camera which recored in MPEG 4 and all my movies (after 'creating a iphone version') play with a white screen both on the phone and in Itunes. Th

  • How to set PO status to 'Deleted'(I1040)   Manually

    Hi  All,      We need to mark a PO in SRM for Deletion ie status(I1040)  ,                                  can any one  guide me with  steps need to do the same. Regards Channappa Sajjanar