Pre pouplating selectone list box  with data

hello friends, im very new to jsf programming
I have one requrement like this.
In one jsp page there are many select boxes (jSF components).
and there is one backing bean corresponding to that jsp page.
I want to pre populate the select boxes with the data, from the database.
I dont know howand where to set the values to these select boxes.
please help me friends.
Thanks in advance.

You can pre-propulate the bean anytime before you attempt to build the page (on which the select boxes are on).
Use an action method, action listener, or even the beans constructor to populate the bean.
There are a few other times/ways you can pre-populate the bean, but they are more special cases.
Most people will use the beans constructor. It's the simplest and most straight forward way (plus, that's what a constructor is for... populating your Object with defaults). You can make your DB calls from within the constructor.
CowKing

Similar Messages

  • How to add a list box with values for a ztable in SM30

    Hello Gurus,
                    I had created a table maintenance for Ztable and added many extra functionality to that. Now i would like to add a list box or check table for a field. Can i do that with out Regenerating my table maintenance. Please help me its..very urgent.

    Have referred this domain to the data element, this should be the Field type in ur table for the particular field.
    Eg: <b>SE11 > table name > fields-ZTEST > fieldtype-ZZTEST</b>
    ZZTEST in the data element > create a domain for this data element and in that specify teh value range.
    Save and activate it.
    Make sure that u regenerate teh table maintenance generator else u cant see the changes.
    Now if u press F4 u can see only thevalues specified, also u will see only the list box with values in SM30.
    Try this,please let me know if u face any difficulties.

  • "Dynamic List Box with Single Selection" Survey Suite in CRM 6.0

    Hi
    I am using CRM 6.0. There in Survey Suite there are 2 answering options "Dynamic List Box with Single Selection" & "Dynamic List Box with Multiple Selection". I am able to make out, how we can assign values to this. I have seen example "Example_Dynamic_survey" also.
    I believe we have to use programming for populating this. But how do we have to carry that out.
    Thanx and Regards
    Hitesh

    Hi Hitesh,
    There is no need of programming for populating values for Answer category 'List Box with Single Selection' or 'List Box with Multiple Selection'. You have to follow the following steps to populate values for those:
    - In the Answer Category select List Box with Single Selection from drop down list
    - Then on left hand side tree, right click on Answer and select Insert Answer Option (Answer->Insert Answer Option)
    - Then on right side, provide Text for the answer (value)
    - To add more values, repeat the process Answer->Insert Answer Option and providing text for those answers in the right side.
    Similarly you can populate values for 'List Box with Multiple Selection' also.
    This has to be done in the transaction CRM_SURVEY_SUITE.
    Hope this is clear to you
    regards
    Srikantan

  • Selection screen list box with run time values

    Hi,
    I have to create a selection screen list box with with values at run time.
    This is actually for a maintanence view.
    Please help.
    Thanks
    Vimalraj

    Have a search in SDN and elsewhere for the function module 'VRM_SET_VALUES'... for example there's one at:
    Re: Listbox with Function code in Table control
    wherein the 2nd listbox contents are driven from the option selected in the first listbox.
    Jonathan

  • Need help with dependent lists boxes with ADF.

    Hello,
    I am doing a project that use tree dependent list boxes.
    Ex. State---->
    College---->
    List of courses of the college chosen above----->
    The way this should work is when I select the state automatically I want it to change to the correspondent list of colleges of that state and after i choose the colleges I want to be able to get all the courses that are given in that college.
    To implement the first two list boxes I create tree views on JDeveloper and and using SelectOneChoice for both State and Colleges. In the binding editor I bind the first View with the second and then the second view with the third and at this point if I execute the first SelectOneChoice would give me all the state and the second SelectOneChoice would give me the list of all the colleges that exist.
    Now on the third view that I create a binding variable and i put a Where state=:TheBindingVariable on the query.
    Also I set the first SelectOneChoice the outoSubmit property to true, id to StateId and PartialTrigger property to CollegeId.
    On pageDef.xml in the bindings I create action form where I select the third view from Date Collection and select Action as ExecuteWithParams. And I set the value under the parameters section to #{bindings.state.inputValue}.
    Under executables still in pageDef.xml I create a invokeAction and I set binds = ExecuteWithParams.
    On first SelectOneChoice on the ChangeValueListener i create a new ManageBeans which generate me a java class and I create a new method as well to use it to change the binding variable on the second SelectOneChoice.
    Here is the method:
    public void Change_StateId(ValueChangeEvent valueChangeEvent) {
    String StateId;
    valueChangeEvent.setPhaseId(PhaseId.INVOKE_APPLICATION);
    FacesContext adi = FacesContext.getCurrentInstance();
    ValueBinding vb = adi.getApplication().createValueBinding("#{bindings}");
    DCBindingContainer bc = (DCBindingContainer)vb.getValue(adi);
    if(valueChangeEvent.getNewValue().toString().equals("0")){
    StateId = "MA";
    OperationBinding opBindingCollegeLovIter = (OperationBinding) bc.get("ExecuteWithParams");
    opBindingCollegeLovIter.getParamsMap().put("TheState",StateId);
    opBindingCollegeLovIter.execute();
    }else{
    DCIteratorBinding statesLovIter = (DCIteratorBinding) bc.get("CollegeProvaView1Iterator");
    Row rw = statesLovIter.getRowAtRangeIndex(((Integer)valueChangeEvent.getNewValue()).intValue());
    StateId = (String) rw.getAttribute("State");
    OperationBinding opBindingCollegeLovIter = (OperationBinding) bc.get("ExecuteWithParams");
    opBindingCollegeLovIter.getParamsMap().put("TheState",StateId);
    opBindingCollegeLovIter.execute();
    I don't know what I have done wrong because I am new in this field and a little support would be really helpful.
    I am using JDeveloper 10.1.3.1.0 and Oracle SOA Suite 10.1.3.1.0.
    I would appreciate any help.
    Thanks a lot.

    user8116089 wrote:
    For some reason the first selectonechoice doesn't give me all the states that are in the database it gives me just the first 10.check the value of RangeSize for itarator in pageDef. in this case to show all items it must be set to -1
    Also there is a way to assign the first value of the first selectonechoice to null at the start.this is a problematic requirement since all items are bound to iterator and basically this should serve for navigation purpose so the first item is set as selected, but maybe some workaround exists...
    regards,
    Branislav

  • List box in data block

    Hi,
    I have trouble implementing a form that uses 2 master table. I tried using the one suggested here
    http://www.oracle.com/technetwork/developer-tools/forms/documentation/blockonajoin-131860.pdf
    but doesn't seem to support the specification I want.
    I have 2 tables say EMP and DEP, with the DML target table being EMP.
    But I also want to display the DEP.NO ( = EMP.DEP_NO) plus the DEP.NAME(which should disabled for change) but the field should be combo/list box
    This is so when I insert a new data, I can just select from the combo box field(which should be populated with all the possible values from DEP.NO in the DEP table). And when I select the DEP.NO, the DEP.NAME will automatically show. But if you just want to UPDATE, DEP.NO should be disabled (only ones from EMP table is enabled for CHANGE.)...
    Appreciate any suggestions.
    Thanks!

    Based on your description, you actually have just one master table and the second table is being used for reference only as it simply supplies the DEPT_NO and DESCRIPTION based on the DEPT_NO on the EMP record. There is no need to a block based on a join in this situation. Just create a data block based on the EMP table and populate your List Item (Poplist) using the value from the DEPT table.
    Do you really need to see the DEPT_NO of the department or will the department name stored in the DESCRIPTION column be enough? A Poplist will only display one value, typically the description of the underlying code (DEPT_NO). If your Department Poplist is attached to the EMP.DEPT_NO column in your form the description will automatically be displayed for the underlying EMP.DEPT_NO. If a user changes the Department using the Poplist the underlying EMP.DEPT_NO will receive the associated DEPT_NO and Forms will record a change has been made.
    When a new record is created, the Department Poplist will be NULL until your user selects a department from the list.
    This should satisfy your requirement!
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • List Box with Variable Entries in a Table Control

    Hi ,
       I have a requirement where a certain column F of the table control should be designed as dropdown list box. The problem is, i have to populate different entries for field F in each row of the Table control.
                                       Field List
    First Line -                   A,B,C
    Second Line -              A,B
    Third Line     -             A
    Is it possible in ABAP to achieve this . I should not use an input help. Can i achieve this with Drop down list ?
    Regards,
    Krishna Chaitanya . A

    Hi Priyaranjan,
    Assoon as you enter records and save it it gets saved , that is ok , but when you do scroll system goes to PAI , so you need to chk the value of ok_code when scroll button is pressed and write the code according to that .
    more over you need to increase the number of lines that can be displayed in a particular table control .
    Try this it may help you .
    <i>Reward points if helpful.</i>
    Regards,
    Amber S

  • List Box With Writing Facility

    Hello Experts ,
                            I want to create a list box in selection-screen with input facilty,
                            i.e i should be able write in that list box just in case of parameters , right now
                            i'm able to select values from drop down only .
                            in short it should just work like command field in screen , where we can write t-code
                            or select t-code from drop down .
    Regards
    Ajit

    Hi ajit,
    without logging onto system and creating a sample, I can tell you what online documentation says about [Using a Different Search Key|http://help.sap.com/saphelp_nw70/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm]
    READ TABLE itab WITH KEY k1 = f1 ... kn = fn result.
    The search key consists of arbitrary table fields k1 ... kn. If you do not know the name of a component until runtime, you can specify it dynamically as the content of a field n1 ... nn using (n1) = f1 (n2) = f2 .  If n1 ... nn is empty when the statement is executed, the search field is ignored.
    That means that for the READ TABLE statement you should use a number of key specifications not less than the possible maximum and then dynamically fill the key variables and key values.
    Do not forget to clear before you do the next read for another table.
    Hope it works.
    Also, this is SAP NetWeaver 7.0, I think dynamic key specification was not possible earlier.
    Regards,
    Clemens

  • Spawning pages from entries in a list box with entry text as title

    The background: I have a form with a list box which a user can populate with their own text via a text box and an 'add' button. This works fine.
    I've just added a template page with different content and 'spawn' button. This also works fine.
    The task: What I want to be able to do is use the entries in the list box from page 1 to spawn the same number of pages as entries and also populate a field in each newly spawned page with the name of the corresponding entry (to act as a title).
    How do I go about coding this?
    Current spawn code:
    var t = this.templates;
    var T = t[0];
    var XO = T.spawn(this.numPages, false, false);
    for (var i=0; i<m; i++) T.spawn(this.numPages, false, false, XO);

    This script will spawn pages depending on the number of items in myComboBox:
         var f = this.getField("myComboBox");
         var expTplt = getTemplate("tpltExpenses");
         for (var i=0; i<f.numItems; i++){
         expTplt.spawn(this.numPages,true,false);
    I'm not sure how to auto fill the text fields on the spawned pages though.

  • Initialize list box with array

    Hi ,
    I am hoping someone can help me with this one :
    I have an array of string (1- D).
    i want each element in the array to be a line in the list box.
    Thanks in advance to anyone that can help .
    Asaf

    You can do it with a property node, see the attached VI.  There may be other ways but I've done it this way for myself in the past.
    Hope this helps.
    -Dave
    Attachments:
    Array into listbox.vi ‏16 KB

  • How scroll through a list of items in list box with code in C# winforms to create auto scrolling

    I am new to programming and I have been tasked to create a form to display information in list box controls on a big screen. The list boxes have to show all data by auto scrolling through all data row by row then start again at the top once it has displayed
    all data. Is there a way to do this automatically in code using a timer? I look all over the web and have not found any way to do this in win win forms. Is it possible?
    Thanks 

    Here's the c# code
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    namespace WindowsApplication13
    public partial class Form1 : Form
    System.Timers.Timer timer = new System.Timers.Timer();
    int position = 0;
    public delegate void delegateUpdateListbox();
    public Form1()
    InitializeComponent();
    private void Form1_Load(object sender, EventArgs e)
    timer.Interval = 1000;
    timer.Enabled = true;
    timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
    void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
    position += 1;
    if (position == listBox1.Items.Count)
    position = 0;
    delegateUpdateListbox deleg = new delegateUpdateListbox(updateListbox);
    this.Invoke(deleg);
    void updateListbox()
    listBox1.SelectedIndex = position;
    As long as the listbox's SelectionMode is set to "One" (the default), you don't have to do anything to un-select the previous item.
    For your secnd question, the code inside the timer checks whether the position is the same as the length of the contents of the listbox and resets its value to zero, so that the selection will go back to the first item in the list.

  • Assign Color to a Box with Data Merge ?

    Hi. I have a simple question with the Data Merge feature.
    I made a template and one of the info in my spreadsheet is a reference to a musical style. But I want to make this reflect dynamically in my layout with a bullet with a color. For example, if the record is about Rock music, it will be labeled RED in my layout.
    Is there anyway to make that happen with data merge, or maybe with XML ??
    Thanks to help !

    there is a way throug xml, yes. but you would have to add extra code (attribute with unique value : the name of the paragraphstyle to be used) into the xml for every instance where you would need different colors.
    If you are interested, I could send you an example.
    Peter

  • Filling a multi-column list box with a query

    Hi folks!
    I'm really very unexperienced with Oracle Forms so I wasn't able to implement the following problem. I have got a database table called 'employees' with the columns 'id', 'firstname', 'lastname'. In my form I would like to have a listbox containing all the entries of this table (based on a select ... from employee) but with only 2 visible columns (firstname and lastname).
    My first question is, how to fill the list with the values from the query. The second question is, when the user selects an entry of the list (an employee), how can I get the ID of this employee?
    I hope you can help me!
    Thanx in advice
    Ingo

    A list item can have only two columns - one shown to the user and one invisible one which actually populates the item. In order to display your names you need to concatenate them into one.
    Create a record group with the query:
    select firstname||' '||lastname, id from employees
    then in a suitable trigger (eg when-new-form-instance)
    call POPULATE_LIST(list, recordgroup)

  • Reg:- How-to build dependent lists boxes with ADF and Faces(Frank.Nimphius)

    Hi,
    by using this i try to create a parent child relationfor selectonechice box and table.
    this is woking properly but as i start selecting values in SelectOneChice Box, value in tabel are seems to be Disappears.
    even i create navigation list and map them properly..
    please suggest me about this.
    Regards:-
    Bkumar

    Thanks for reply...
    but this is not one that i wants...<< Need to create Depandent selectOnechoice and table Adf page>>
    i created one parent SelectOneChoice list having some values, and one child tabel for there values. Navigation List.even i checked Auto Submit and Id for parent, and Partial triger for Child.
    When irun this application the values are not coming properly.
    please help me about this.

  • Link check box with data entry

    Is there a simple way to populate a field based on input in a checkbox?
    For examples, if a box is checked, then place a number in a specified field.

    what is the value that is going in when u check it.. did u debug it.. is the viewRowimps setter and getter getting called.. and is it having the right value set and got.. and ur sure that ur using selectBooleanCheckBox..
    ur binding the checkbox to the transient value right??

Maybe you are looking for

  • Frm-40502: oracle error: unable to read list of values

    Hi All, I am personalizing the assignment form, where we need to restrict the JOB LOV based on Organization value. In Forms Personalization we are creating the record group from query and attaching to Job field. The query is, SELECT DISTINCT j.NAME,

  • To reset the restriktion code

    How to reseat restriction code when I forgot the code

  • How tos....JTree

    To all Java developers out there: Hi! I would just like to ask for help regarding the implementation of JTrees. I am trying to make a JTree with an unknown number of directories or files. I have an Application folder. This folder may contain files, s

  • "Charging is not supported with this acessory" opped up out of the blue

    I left my phone charging after i woke up, took it off when it was 100% and went to work. When i came back home, i plugged it again and the "Charging is not supported with this acessory" error popped up. I was using the same cable and wall charger i a

  • JSP + database problem...

    Hi, i would like to retrieve certain column from the database table and display it in a table format... for example, String colName[] = request.getParameterValues("col_header"); // this means that this string is dynamic, will change upon the user sel