How to populate form data in jsf

Hi
I have 2 questions about how to do things in jsf, i have been working with struts and so will give example of what i would do in struts
I have a jsf page for login, when i authenticate the next screen is a table with bunch of data,
Where do i populate this table data and pass it along to jsp page, in struts i would define a Bean and save this bean in request and pass it to jsp page,
I want to be able to go to home page from any page in my application, in struts i would just define HomeAction class and then add a home button on any page, and when this button is clicked, this would call this HomeAction will be get data to be displayed on homepage and build a bean and forward request to homepage.jsp,
how can do i this in jsf,

kulkarni_ash wrote:
I have a jsf page for login, when i authenticate the next screen is a table with bunch of data,
Where do i populate this table data and pass it along to jsp page, in struts i would define a Bean and save this bean in request and pass it to jsp page,You also need to define a bean, but you just use faces-config.xml to let JSF create and save it in request. As your question concerns the datatable, you may find this article useful to start with: [http://balusc.blogspot.com/2006/06/using-datatables.html].
I want to be able to go to home page from any page in my application, in struts i would just define HomeAction class and then add a home button on any page, and when this button is clicked, this would call this HomeAction will be get data to be displayed on homepage and build a bean and forward request to homepage.jsp,In JSF you can use navigation cases for this. Just have something like<h:commandButton action="home" value="home" />in your JSP page and the following in the faces-config:
<navigation-case>
    <from-outcome>home</from-outcome>
    <to-view-id>home.jsf</to-view-id>
</navigation-case>

Similar Messages

  • How to populate form data after LOV search on primary key

    This is the description:
    Pg. 1 contains an item defined as P1_CUSTOMER_ID (Popup Key LOV (Displays description, returns key value) with the list of values definition:
    select
    last_name || ' , ' || first_name display_value, cust_num return_value from customers order by 1
    Pg. 1 contains a button defined as P1_FIND_NOW (Redirect) with a URL redirect to Pg. 4.
    Pg. 1 contains a branch defined as Go To Page 4 (after processing), branch point = On Submit: After processing, action = page in this application, When Button Pressed = P1_FIND_NOW
    Pg. 4 contains two regions with multiple items, for example P4_ADDRESS_1, Display as Text Field (disabled, does not save state), Source Used = Always, replacing any existing value in session state, Source Type = Database column, Source value = ADDRESS_1
    Pg. 4 contains a process (before region) defined as POPULATE_CUST_INFO, Process point = On load, before region, Process error message = Customer could not be found, Source process =
    BEGIN
    SELECT
    CUSTOMERS.FIRST_NAME,CUSTOMERS.LAST_NAME,CUSTOMERS.BIRTH_DATE,
    CUSTOMERS.SEX,CUSTOMERS.MARITAL_STATUS,CUSTOMERS.PHONE_NUMBER_V,
    CUSTOMERS.PHONE_NUMBER_M, CUSTOMERS.ADDRESS_1,CUSTOMERS.ADDRESS_2,
    CUSTOMERS.ADDRESS_3,CUSTOMERS.CITY_NAME,CUSTOMERS.STATE_CODE,
    CUSTOMERS.ZIP_CODE,CUSTOMERS.COUNTRY_CODE
    INTO
    :P4_FIRST_NAME,:P4_LAST_NAME,:P4_DOB,:P4_GENDER,:P4_MARITAL_STATUS,
    :P4_VOICE,:P4_MOBILE,:P4_ADDRESS_1,:P4_ADDRESS_2,:P4_ADDRESS_3,
    :P4_CITY_NAME,:P4_STATE_CODE,:P4_ZIP_CODE,:P4_COUNTRY_CODE
    FROM CUSTOMERS
    WHERE :P1_CUST_ID = CUSTOMERS.CUST_NUM;
    END;
    I am getting the pop-up LOV and selecting a customer from the LOV, then clicking the FIND NOW button. This redirects to Pg. 4 where I expect to see all the data for the selected Customer populated into the various text fields (name, address, etc.). What is actually happening is I'm being redirected to Pg. 4 but
    the Process error message = Customer could not be found is displaying.
    If I run the same Source process query within SQL, I get a screen to
    enter bind variables, I enter an existing customer number (e.g.Y0001), and I get the message:
    ORA-06502: PL/SQL: numeric or value error
    The primary key for the CUSTOMERS table is CUST_NUM varchar2(17)

    Your message refers to "P1_CUSTOMER_ID" and "P1_CUST_ID". Is that a typo in the message? If not, perhaps that's the problem.
    Rodney

  • How to populate the data in LISTBOX   of Dialog programming

    Hi All,
    I know how to create a Listbox in Modulepool programming, But i do n't know how to populate the data in LISTBOX. Does anyone knows , please help me ?
    Thanks in advance
    KR

    hi,
    u need to write this after all modules of PAI in screen flow logic
    PROCESS ON VALUE-REQUEST.
      FIELD ifmtp-form_type MODULE fm_drop.
    MODULE fm_drop INPUT.
      CLEAR ifmtp.
      REFRESH ifmtp.
      ifmtp-form_type = 'C'.
      APPEND ifmtp.
      ifmtp-form_type = 'F'.
      APPEND ifmtp.
      ifmtp-form_type = 'H'.
      APPEND ifmtp.
      ifmtp-form_type = 'D'.
      APPEND ifmtp.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield  = 'FORM_TYPE'
          value_org = 'S'
        TABLES
          value_tab = ifmtp.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " fm_drop  INPUT
    here ifmtp-form_type is my list box field on screen in which ifmtp is my internal table and form_type is my field name
    i have declared internal table like
    DATA : BEGIN OF ifmtp OCCURS 0,
              form_type LIKE zform_track_mast-form_type,
           END OF ifmtp.
    reward if useful...

  • How to populate the data into the newly added infoobjects?

    Hi,
    how to populate the data into the newly added infoobjects?
    Thanx in advance,
    Ravi.

    hi ravi,
      here is one example how to enhance.
    Goto RSA6- select the 0Material.- Click on Enhance extract structure-> it will take u to the next screen there u need to create the field material group1. and append it to 0Material.
    Goback to RSA6-- RC on 0material-- it will take you to customer version edit screen- here unchk the Hide and Field only known in exit options n save it.
    Next Go back to RSA6-- 0material- click on Function enhancement it will take you to CMOD Screen( here we need to enter the project name and click create if not created on click display)
    In the next screen we find the function exits Like EXIT_SAPLRSAP_001 FOR T DATA AND EXIT_SAPLRSAP_002 FRO Master Data,_003 for Text n _004 for Hierarchies.
    select the appropriate function exit and double clikc on it. It will take you to Function builder screen.
    D Click on defn of Include ZXRSAU01. it will take you to abap editor screen.
    here u need to include the code for the enhanced fields n also write the code to populate the dat for that particular field.
    save it and avtivate the code.
    Hope this Is helpz,
    partha

  • How to populate TableView data on the other screen TextField

    Hi guru’s
    I am having problem in populating data from a table in one screen to a Text Field in the other screen. I have two classes FirstClass containing a textbox and a button. On pressing a button a second window is opened containing a Table of values. As the user double clicks a row the value of the second column of the row should be inserted into the textbox of the FirstClass. Code of both the classes is attached. Thanking you in anticipation.
    import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.geometry.Insets;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.TextField;
    import javafx.scene.layout.GridPane;
    import javafx.scene.layout.StackPane;
    import javafx.stage.Stage;
    public class FirstClass extends Application {
    public static void main(String[] args) {
         launch(args);
    @Override
    public void start(final Stage primaryStage) {
         primaryStage.setTitle("First Class");
    GridPane gridpane = new GridPane();
              gridpane.setPadding(new Insets(5));
              gridpane.setHgap(5);
              gridpane.setVgap(5);
    final TextField userNameFld = new TextField();
    gridpane.add(userNameFld, 1, 1);
    Button btn = new Button();
    btn.setText("Show Table");
    gridpane.add(btn, 1, 3);
    btn.setOnAction(new EventHandler<ActionEvent>() {
    @Override
    public void handle(ActionEvent event) {
         String a = TableClass.showDialog(primaryStage, true, "Table Window" );
         userNameFld.setText(a);
    StackPane root = new StackPane();
    Scene scene =new Scene(root, 300, 250);
    root.getChildren().addAll(gridpane);
    primaryStage.setScene(scene);
    primaryStage.show();
    import javafx.beans.property.SimpleStringProperty;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.event.EventHandler;
    import javafx.geometry.Insets;
    import javafx.scene.Scene;
    import javafx.scene.control.TableColumn;
    import javafx.scene.control.TableView;
    import javafx.scene.control.cell.PropertyValueFactory;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.GridPane;
    import javafx.scene.layout.StackPane;
    import javafx.stage.Modality;
    import javafx.stage.Stage;
    public class TableClass extends Stage {
         private static TableClass dialog;
         private static String value = "";
         public static class Person {
    private final SimpleStringProperty firstName;
    private final SimpleStringProperty lastName;
    private Person(String fName, String lName) {
    this.firstName = new SimpleStringProperty(fName);
    this.lastName = new SimpleStringProperty(lName);
    public String getFirstName() {
    return firstName.get();
    public void setFirstName(String fName) {
    firstName.set(fName);
    public String getLastName() {
    return lastName.get();
    public void setLastName(String fName) {
    lastName.set(fName);
         private TableView<Person> table = new TableView<Person>();
         private final ObservableList<Person> data =
         FXCollections.observableArrayList(
         new Person("JACK", "BROWN"),
         new Person("JOHN", "VIANNEYS"),
         new Person("MICHAEL", "NELSON"),
         new Person("WILLIAM", " CAREY")
         public TableClass(Stage owner, boolean modality, String title) {
              super();
              initOwner(owner);
              Modality m = modality ? Modality.APPLICATION_MODAL : Modality.NONE;
              initModality(m);
              setOpacity(1);
              setTitle(title);
              StackPane root = new StackPane();
              Scene scene = new Scene(root, 750, 750);
              setScene(scene);
              GridPane gridpane = new GridPane();
              gridpane.setPadding(new Insets(5));
              gridpane.setHgap(5);
              gridpane.setVgap(5);
              TableColumn firstNameCol = new TableColumn("First Name");
         firstNameCol.setMinWidth(100);
         firstNameCol.setCellValueFactory(
         new PropertyValueFactory<Person,String>("firstName")
         TableColumn lastNameCol = new TableColumn("Last Name");
         lastNameCol.setMinWidth(200);
         lastNameCol.setCellValueFactory(
         new PropertyValueFactory<Person,String>("lastName")
         table.setItems(data);
         table.getColumns().addAll(firstNameCol, lastNameCol);
         table.setOnMouseClicked(new EventHandler<MouseEvent>() {
                   public void handle(MouseEvent me) {
                        if (me.getClickCount() >= 2) {
                   String srr = table.getItems().get(table.getSelectionModel().getSelectedIndex()).getLastName();
                   value = srr;
                   dialog.hide();
         gridpane.add(table, 1, 5,1,20 );
              root.getChildren().add(gridpane);
         public static String showDialog(Stage stg, Boolean a , String title){
              dialog = new TableClass( stg,a, title);
              dialog.show();
              return value;
    }

    Cross posted
    http://www.coderanch.com/t/582014/JavaFX/java/populate-TableView-data-other-screen
    http://stackoverflow.com/questions/10734649/how-to-populate-tableview-data-on-the-other-screen-textfield-in-javafx-2-0
    Moderator advice: Please read the announcement(s) at the top of the forum listings and the FAQ linked from every page. They are there for a purpose.
    Then edit your post and format the code correctly.
    db

  • This is related to UCS-D : How to populate inventory data into lovs

    This is related to UCS-D : How to populate inventory data into lovs 

    I think you need to update the database from the applet.
    Then refresh the page to sync with values in the database.
    --Prasanna                                                                                                                                                                                                                                                                       

  • How to retain form data with cfpdf flatten option

    I created an intertactive form from an existing pdf using
    Acrobat 8.0/Live Cycle designer. Now I am trying to use it in my
    application where I use cfpdfform tag to first populate the pdf,
    and then create a flattened copy of the form using cfpdf
    action="wrtite" flatten="yes" command. But when I flatten the form,
    the form data is lost. This does not happen with other government
    forms like Form I-9 or W-4 that could be downloaded as interactive
    forms from their respective sites.
    I came across this article through a Google search
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_p-q_02.html.
    If you scroll down about half the page you will see this:
    "You can use the cfpdf tag to assemble interactive PDF form
    files into a single PDF document and flatten forms created in
    Acrobat (by using the flatten attribute with the write action);
    however, to process PDF form data, use the cfpdfform and related
    tags. You cannot use the cfpdf tag to flatten forms created in
    Adobe LiveCycle Designer ES."
    This is confusing - why can't the forms created in LiveCycle
    be flattened? What other tools we have to create interactive forms
    that can be flattened with form data?
    Please assist me with your pointers and responses. Would
    appreciate an early reply.
    Thanks very much.
    Raj

    Here's how I did it.  LiveCycle form does work in ColdFusion.  It even includes an image wich works untill I flatten the form.

  • How to populate the data for additional fields in custom report of fbl5n tr

    hallo friends,
    i ha ve to add some fields to the output of custome report of transaction FBL5N.
    Till now i have only added the fields to the output.
    Now i have to write the code to populate the data for those fields in the program.
    1.     Customer Credit Group(ACM/RCM): (Table: KNKK; Field Name: VKORG )
    2.     Credit Representative Group: (Table: KNKK; Field Name: SBGRP)
    3.     Customer Account Number(CAN#): (Table: KNKK; Field Name: KNKLI)
    4.     Alternative Payer(ALTP#) : (Table: KNA1; Field Name: KUNNR)
    5.     Risk Category: (Table: KNKK; Field Name: CTLPC)
    6.     Credit Info Number: (Table: KNKK; Field Name: KRAUS)
    7.     Rating: (Table: KNKK; Field Name: DBRTG)
    8.     Payment Index: (Table: KNKK; Field Name: DBPAY)
    9.     Credit control area: (Table: KNKK; Field Name: KKBER)
    10.     Company code: (Table: KNB1; Field Name: BUKRS)
    11.     Sales Organization: (Table: KNVV; Field Name: VKORG)
    These are al fields i have to populate in the program..
    MY ATTEMPTS:
    I tried getting the data for KNKK table by GET KNKK ,but it is giving some garbage values...
    And Logical database used here is DDF,and i have to add the VKORG of KNVV too...but KNVV is not there in DDF...
    Can anybody tell me how should i proceed..
    thanks in advance.

    Thnx Andreas,
    i have following doubts again..
    I have to add sales organisation field to the selection screen...(this is given in the req.)
    now if i will say GET KNKK...it would not keep account of this 'sales organisation' field...so how should i fetch the data with these input data( i.e. 'compny code' and 'customer' are the fields given by LDB and 'sales oraganisation' is the field i put it on the selection screen)
    And what about the KNVV-VKORG ,because the KNVV is not present in the LDB.

  • How to populate the data in to customised cube

    hi,
    guys, i have customised the infocube (0PUR_C01)by adding the additional info object , i want populate the data (using updaterule)  in to infocube with out loosing current data for hte added info object .
    can any help this, how to write updaterule
    thanks in advace
    ram

    Hi Ramanathan,
                If you need historical data for the newly added info object, you'll have to intitialize again from the source system.
    That means you'll have to delete the data and load it again from the source.
    If you don't want to delete the data, you can create an Export data source of the existing cube(say Cube A)
    and load the data to another cube(Say Cube B which is a copy of A).
    Then you can delete the data from Cube A and add the required info objects to cube.
    Then you have to create an Export data source of Cube B and load data back to Cube A from B.
    It depends on your business requirements.
    <b>Since you don't want Historical data for the newly added info object,
    there's no need to delete the existing data.
    Add the new info object and maintain the Update rules for this new info Object.
    The new records will be have values for this Info Object depending on the routine
    you specify in the update rules.</b>
    Refer these links for more information on Routines in Update Rules.
    http://help.sap.com/saphelp_nw04/helpdata/en/21/894eeee0b911d4b2d90050da4c74dc/content.htm
    <b>Creating Update Routines</b>
    http://help.sap.com/saphelp_nw04/helpdata/en/80/1a64fae07211d2acb80000e829fbfe/content.htm
    Hope this helps.
    Regards
    Hari
    Message was edited by: Hari Krishnan K

  • How to save form data as XML using Reader XI

    Dear all,
    I have designed a form using live cycle designer 9 and activated the form extensions using Acrobat X Pro.
    The form includes an email send button.
    Our clients uses the Reader X and XI.
    Using Reader X the pressing of the button will open a dialog box asking the user to send the form/form data using the default email client
    OR
    one can save the form data as xml file on the local machine and attach it later.
    However, using Reader XI there is no such possibility of saving the data as XML. One can just chose between the default email client or another email account.
    I tried even a button using javascript xfa.host.exportData("",0); but nothing. In fact the button shows no function at all.
    What do I wrong?
    Does anybody has a hint please?
    Thanks in advance.
    gersti

    I'm pretty impressed of Adobe and their stuff (I do NOT refer to the community), how helpful they are.
    Perhaps I didn't understand  the meaning on the offical customer support website, stating:
    The best way to contact us...  
    Ask our experts 
    Our community and staff are at your service 24/7
    Even worst, their is a similar question from 25/09/2013 (http://forums.adobe.com/message/5711946#5711946) and no feedback form Adobe stuff at all.
    Great service guys!
    Thanks a lot!

  • How to access form data in process_event of (IF_FPM_GUIBB_FORM)?

    I want to use the process_event function of a form GUIBB to run some validation of the form data. But how can I access the form data in process_event function? I do not want to make the validation on get_data, as I want to use the ev_result and et_messages parameter of process_event to stop the process if validation of the data fails.

    Hi Christian,
    thank you for the advice. This solves the issue!
    Thomas

  • How to populate form fields by choosing a parameter from a list of values?

    I have a unique field (say claim #)that is displayed at the top right of the page. Whenever I choose a value from the list of values and query the DB, all the subsequent forms(representation of one or more tables, linked by claim#) present below the search field should be populated with apt values.
    The issue here is, the forms displayed in the bottom of the page represent different master tables linked by the universal identifier(claim#) for my system.
    Please guide me if anyone knows a solution for this issue.
    Regards
    Arun

    You might want to look at the Acrobat Forms Data Format (FDF) Toolkit to create an FDF file that has the webbased PDF form refereced as the form source for the FDF data. You could also look at PDFTK and PDF Hacks.
    This is more of a developers issue than a simple Acrobat JavaScript issue.
    If may salary were to be doubled, I would still receive the same amount.
    If you do not like the responses ask for double your fee back.
    What do you expect for free?

  • How to copy form data from one pdf to another?

    Hi,
    I have created a pdf, added form data to it. Saved the form data as a fdf file - all good.
    I've updated the document and saved as a new pdf and would like to load the fdf data into it.
    So I select tools - forms - more forms options, and press the "import" function  - it goes grey and nothing happens.
    If I re-open the document the import function remains greyed out.
    I can find no way to import this data.... any ideas?
    I've tried going into form edit mode - adding a new field.  The import option is no longer greyed out so I click it and can select the fdf file hit open and ... the dialogue disappears and nothing happens.
    Is my Acrobat XI 11.0.07 badly installed - or what?

    You need to learn about the different types of PDFs. PDF/ A is an archive format that does not allow changes. PDF/X is used for graphics exchange
    For forms I would use only the PDF with a target version. Do not use the Optimizer feature.
    Forms always become larger due to the need to include the font for the various form fields. You might have to review the type fonts used by the form fields and one standard font as much a possible.
    It is possible to use the FDF file to move field values from one PDF to another.
    If you are trying to replace the underlying content and keep the form fields, use the replace pages.

  • How to populate the Data into Form

    Hi,
    I would like to know how we can populate value when it opens into form manager.
    For ex A person opens a form he enter the emploee id and all corresponding fields should get populated in corresponding with that from database.

    Hi,
    i m using live cycle designer 7.1, i have mapped the form with default values for example in a table if all the rows of the table is mapped with one default value and if one user info is populated in the table then all the default value is not printing ie in the remaining rows can any help in this regard

  • JSF - How to Clear Form Data

    I have a form.
    Scenario-1:
    Users input data into the form. After I successfully consume and process data, when I click back the HyperLink to the Form - say "Register" - the Register Form still contains the very same input of the previous user. And this happens to all Forms that I have in the Application.
    Scenario-2:
    I return String "success" after processing the Register Form, and I navigate back to the same "Register" Form. Here again, the Register Form contains the old data.
    I have the bean scope set to "session". I cannot set the scope to "request" since I consume data across beans.
    Can someone help me how to clear the [old] data in the forms once I consume the data?
    Thanks in Advance.
    Edited by: Ganesh-Babu-N-R on Apr 12, 2009 11:41 AM

    Ganesh-Babu-N-R wrote:
    I have the bean scope set to "session". I cannot set the scope to "request" since I consume data across beans.Request scoped data belongs in the request scope. I highly recommend you to rethink this approach. You can if necessary split data over beans or make use of h:inputHidden or t:saveState to transfer request scoped bean properties to the next request.

Maybe you are looking for

  • Best way to MouseDrag multiple objects around a scene.

    So I am having a little trouble trying to drag 3 Box's in a scene. Originally I had it set up where each was relocated to an x,y translated Z and set to a HWD. Then I figured I would, instead of the mouse click on the box itself, be in the root. From

  • Why did my macbook say it has to shut down?

    I left my macbook plugged in, downloading the latest CBC podcasts and when I return, there was an error message on the screen saying that the machine needed to shut down.  Fine.  I shut it down, but when I hit the power button to start up again, I he

  • URGENT: FaceTime and WebEx

    Hi All, I have an online meeting to attend tomorrow, and the host asked if I have a webcam.  Will FaceTime on my iMac (Lion) work with WebEx as a webcam? If not, how can I make it work? I have Java runtime installed, and am able to access the WebEx m

  • Load Balancing Linux servers with CSS 11050 series

    We would like to load balance Linux FTP and Web servers with a CSS 11050 series device. Does the content switch use SNMP to load balance the servers? If so, which MIBs need to be loaded on the servers?

  • Grouping Compilation albums together

    I have a number of different albums that have different artists on them. I want to go in on my iPod and listen to the whole album all the way through, but when I go to it in "albums" it's listed severel different times and each is by a different arti