Getting problem in binding DropDown List with table data in visual JSF

Hi All,
I am new to visual JSF.
I am getting few problems while working over components.
I have succeeded in binding data of Person table in a drop down list .
By just drag drop ..it worked.
But while connecting to external DB this drag drop mechanism didn't work for me .
1st problem that i faced was by dragging method columns are not visible when i did right click-> bind to Data -> DataProvider window .
But i am successfully printed table Data in backend ie: by putting
for(int i=0; i<xn_white_listDataProvider.getAllRows().length;i++){
       System.out.println("  value :"+xn_white_listDataProvider.getValue("SUB_ID",xn_white_listDataProvider.getRowKey(Integer.toString(i))));
}I am not getting how to set Items in dropdown1
I tried putting
HelloSh.xn_white_listDataProvider.options['XNODE.XN_WHITE_LIST.SUB_ID, XNODE.XN_WHITE_LIST.SUB_ID'but it didn't work while for person data table
  items="#{HelloSh.personDataProvider.options['PERSON.PERSONID,PERSON.NAME']}"it is working
when i am writting items="24,28" in dropdown1 box
& printing its value in static text Like
<webuijsf:staticText id="staticText3" style="position: absolute; left: 72px; top: 120px" text="#{HelloSh.dropDown1.items}"/> it is printing fine .
Plz help me in this regard.
Any clarification if needed plz let me know.
Thanks in advance.

<h:selectOneMenu id="menu1" styleClass="selectOneMenu">
<f:selectItems value="*#{selectitems.pc_DynamicPortletEdit.regList}*" />
</h:selectOneMenu>When we bind the list to the h:selectOneMenu the code in the JSP will be as given above.
My doubts here are
1) But when i tried to bind the list to a selectonemenu the code in the JSP is looking like this one
<h:selectOneMenu id="menu1" styleClass="selectOneMenu">
<f:selectItems value="*#{selectitems.pc_DynamicPortletEdit.regList.regList.toArray}*" />
</h:selectOneMenu>2) Also in the runtime instead of displaying the values in the dropdown, i am getting the object names (javax.faces.model.SelectItem@680d0ccc) in the drop down.
What am I doing wrong? Any help here would be usefull for me.
BTW,
the code in the backing bean for setting the values is like this
List dropListValue = new ArrayList();
    for (int x=0; x<result.length; x++){ //where result is array of string values              
        SelectItem tempSelect = new SelectItem();
        tempSelect.setLabel(result[x]);
        tempSelect.setValue(result[x]);
        dropListValue.add(result[x]);                      
this.setRegList(dropListValue );The bean is in request scope only.

Similar Messages

  • Dropdown List in table - multicolumn foreign key

    Hello,
    Steve Muench has a nice screencast how to create a dropdown list in an editable adf table.
    Is there a way how to update this example to work with multicolumn foreign key between edited table and lookup table?
    Let's say lookup table has Code, Line attributes as primary key and edited table has foreign key attributes MasterCode and MasterLine. How populate the FK attributes by dropdown list?
    For editable table it's probably not possible directly from dropdown list. I tried to find a solution but I had problem to identify which lookup row was selected.
    Rado

    ok i have checked that for the past few days but its not what i want.
    i am using wizard to do this and i need to populate the database table records (individual field names) and display in the table control dropdown list.
    what the demo shows is only how to display a dropdown list with reference to the table names.

  • Select distinct using LINQ and bound to a dropdown list with id and display name

    Hi,
    On one of my sharepoint page, I want to populate dropdown list with countries, namely
    <asp:DropDownList ID="ddlCountry" runat ="server"></asp:DropDownList>
    In the code, I use LINQ:
     var country = (from p in dc.ProvCountries
                                   select p.country_code ).Distinct();
                ddlCountry.DataSource = country;
                    ddlCountry.DataBind();
    I want the country_code to be  the ID, while the country_name will be the display name in the dropdown, how can that be done?
    Thanks in advance.

    Hi,
    The following code for your check.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    namespace WebApplicationLib
    public partial class _Default : Page
    protected void Page_Load(object sender, EventArgs e)
    List<ProvCountries> list = new List<ProvCountries>();
    list.Add(new ProvCountries { country_code = "201", country_name = "A"});
    list.Add(new ProvCountries { country_code = "201", country_name = "B" });
    list.Add(new ProvCountries { country_code = "202", country_name = "C" });
    list.Add(new ProvCountries { country_code = "202", country_name = "D" });
    var country = (from p in list select new { p.country_code, p.country_name }).DistinctBy(p => p.country_code).ToList();
    ddlCountry.DataSource = country;
    ddlCountry.DataValueField = "country_code";
    ddlCountry.DataTextField = "country_name";
    ddlCountry.DataBind();
    ddlCountry.Items.Insert(0, new ListItem("Please select", ""));
    class ProvCountries
    public string country_code { get; set; }
    public string country_name { get; set; }
    static class DataDistinct
    public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
    HashSet<TKey> seenKeys = new HashSet<TKey>();
    foreach (TSource element in source)
    if (seenKeys.Add(keySelector(element)))
    yield return element;
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • Dropdown list in table control

    Hi,
    how do i create dropdown list in table control with reference to the database table field names? (dropdown list will be populated with the particular table field names upon selecting the input help value from an input box).
    please provide sample codes.
    thanks.
    will reward marks if useful.

    ok i have checked that for the past few days but its not what i want.
    i am using wizard to do this and i need to populate the database table records (individual field names) and display in the table control dropdown list.
    what the demo shows is only how to display a dropdown list with reference to the table names.

  • How do you isolate an album or artist in the new iTunes? (12.0) It is really frustrating when trying to listen to one album and I get the album in the list with all 1,025 other albums in my library.

    How do you isolate an album or artist in the new iTunes? (12.0) It is really frustrating when trying to listen to one album and I get the album in the list with all 1,025 other albums in my library. Same with the artist.

    Welcome to the  Discussion Forums
    ... I assumed that if I played the 1st track, it would continue to play the rest of the album (as iTunes does on my Macs and PCs),...
    You assumed correctly, and it should continue to play the rest of the album in order. Does this happen to all your albums. Have you tried restarting the tv.

  • I am trying to update my billing detail on my IPAD2. However it keep on saying that the country need at least 3 characters long. But the country field is a dropdown list with Malaysia's states all with 2 characters long only! I can't make any purchase now

    I am trying to update my billing detail on my IPAD2. However it keep on saying that the country need at least 3 characters long. But the country field is a dropdown list with Malaysia's states all with 2 characters long only! I can't make any purchase now because I can't verify the billing detail because it just doesn't work! Very frustrating now.

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • PR list with release date report..?

    Hi all
    Where we aill get the report of PR list with PR released date .
    Thanks
    sapmm

    hi,
    You can get the list of PR's from ME5A or from table EBAN etc...
    BUt its not possible to get the exact release date...
    It a biggest drawback..
    Regards
    Priyanka.P

  • Problem in mapping dropdown list  values with the queries

    hi,
    I am building a simple applicaittion of currency conversion.
    The scenario :
    I have a input form with a dropdown list and a input field to enter the amount
    I have created the drop down list with the respective details
    Value   Desc
    1          dollarToeuro
    2          euroTodollar 
    when the user selects the first option in the drop down list and then enters the value and gives a submit -> the conversion takes place
    but evrytime i select the second option --> the application hangs..
    i have given a guard condition in the submit action for each if the query as LIKE(@option,"1") OR LIKE(@option,"2") for the respective queries.
    Please can someone tell me where i am going wrong???
    Regards,
    Vaishali

    Hi ,
    what is the need of ur gaurd condition there?
    and try to run the model without that guard condition.
    Regards,
    Govindu

  • Dropdown list with custom All Values option

    Hi,
    We are running VC on 7.4 SP2. I have a dropdown list which gets its' values from a BW query. This works great except that I want to add a custom entry which selects all values.
    In BW you would do this by setting the selection variable to "" as in nothing specified/empty. This is also the default setting in VC (you made no selection so you will get all results) but once you select something this can not be deselected.
    So the idea is to add a custom entry All with value "" but apparently this gets send to BW as """" which is not a valid value. VC does not allow to use an empty value field.
    So basically I am stuck here. Any of you found a solution to this problem?
    regards,
    Matthias

    Hi Matthias,
    I see your point. I could suggest two options:
    1. In the dropdown input control, delete the value. Then press submit.
    This works fine, only we don't get the empty value in the list.
    2. To have the empty value in the list, like this:
    Add to the entries of the list:
    Then edit the mapping to the service to convert * into an empty string:
    Thanks,
    Udi

  • Populating dropdown list with entries in multiple text boxes?

    I'm creating a form that needs to be simple to use and complete.  I would like to be able to populate a drop-down list with entries the user puts into text boxes.  Can this be done?
    For more detail:
    In one location is a table, the use will type into a text box a Project Name, then other information such as location and total acres.
    In another location I've got a table where the user will enter the offerings from each project they listed in the 1st table.  It is a long table as it is, I cannot combine the two (will not fit on one page if I do combine them). 
    Instead of making the user type in the project names multiple times, I'd like to be able to take the project names the users input (from table one) and have those entries automatically populate the dropdown list in the second table.
    Any suggestions would be greatly appreciated!!!

    Not exactly a find and replace but you can do it.
    Select the text frames yu want to change the colors using the shift key to click select the frames.
    Then go to Edit>Edit Color>Recolor Art
    You wll see a dialog with red and black bars along side two shorter bars click the shorter bars to select a New Color a color picker will appear you can use the swatches or the color mixer.
    There is a live preview /so you will see the change in case you want to pick a different gray, of course you can always go back to the recolor art dialog.
    I am afraid you manually have to select text frames with multiple colors in order to accomplish what you want but the method above I believe is the only want to change the colors.
    This video shows how the dialog works but pretend the one frame I did not select is another color.
    http://www.wadezimmerman.com/videos/RecolorText.mov

  • Dropdown list with multiple selections

    I need to create a dropdown list in a selection screen and allow the user to select more than one option. Can this be done. I know how to use VRM_SET_VALUES to create a dropdown but it restricts me to selecting only one value. The user should be able to select multiple values. Thank you.

    Hello,
    Try to use this Fm
    PARAMETERS :
    y_p_list TYPE char32  AS LISTBOX VISIBLE LENGTH 22
                                  MODIF ID rsg. .
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR y_p_list.
      PERFORM y_f_dring_type_f4.
    FORM y_f_file_frmt_f4 .
      MOVE: text-212 TO y_wa_listbox1-field.
      APPEND y_wa_listbox1 TO y_i_listbox1.
      CLEAR y_wa_listbox1.
      MOVE  text-213 TO y_wa_listbox1-field.
      APPEND y_wa_listbox1 TO y_i_listbox1.
      CLEAR y_wa_listbox1.
      MOVE  text-214 TO y_wa_listbox1-field.
      APPEND y_wa_listbox1 TO y_i_listbox1.
      CLEAR y_wa_listbox1.
      MOVE  text-215 TO y_wa_listbox1-field.
      APPEND y_wa_listbox1 TO y_i_listbox1.
      CLEAR y_wa_listbox1.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'FIELD'
          dynpprog        = sy-repid
          stepl           = 1
          value           = ' '
          value_org       = 'S'
          display         = ' '
        TABLES
          value_tab       = y_i_listbox1[]
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
      ENDIF.
      REFRESH y_i_listbox1.
    ENDFORM.                    " y_f_file_frmt_f4
    Use this code you will get the List box in selection screen.

  • Problem sharing a Reminder list with another iCloud user

    I'm trying to share a Reminder list with my wife, and even though I follow the instructions, it doesn't seem to work.
    I go to iCloud.com in Safari on my Mac, click on Calendar, and I can see my list there in the sidebar, including the one I wish to share. There is a small circle to the right of each lists name, and the instructions say to click this and a pop-up window will appear and ask for the other iClud users info and send them the invitation to share the list. When I click on this circle, nothing happens. It seems like the link is dead. I tried re-loading the page and restarting Safari, but nothing works. Is anyone else having a problem with this?

    Go to ~/Library/Caches/com.apple.Safari
    Move the Cache.db file from the com.apple.Safari folder to the Trash.
    Restart your Mac. Go to iCloud.com. Try the x next to Reminders.
    ~ (Tilde) character represents the Home folder.
    For Lion:   To find the Home folder in OS X Lion, open the Finder, hold the Option key, and choose Go > Library

  • Get search criteria from query panel with table

    hi guys,
    i have a query panel with table that i created from a VO.
    i use the all queryable attribute in the generated DataControl.
    i hv a requirement to update the database value with the same search criteria with the query panel.
    but i want the submitted search criteria, not only written in the query panel criteria.
    i'm using JDEV & BPM 11.1.1.6
    i've already tried to get the criteria using
    QueryModel queryModel = getQueryPanel().getModel(); 
    QueryDescriptor queryDescriptor = queryModel.getSystemQueries().get(0);             
    ConjunctionCriterion cc = queryDescriptor.getConjunctionCriterion();
    for(int i=0;i<cc.getCriterionList().size();i++){
         AttributeCriterion ac = (AttributeCriterion)cc.getCriterionList().get(i);
         System.out.println("DEBUG LABEL : " + ac.getAttribute().getLabel());
         System.out.println("DEBUG VALUE : " + ac.getValues().get(0));    
    }        but it only get the value that filled in the search criteria input text, not the criteria that already been searched and viewed in the table
    my other question is, can i override the search button function ? so i can add a custom method to save the search criteria to my temporary variable.
    thanks
    Edited by: Juw on May 29, 2013 2:05 AM

    Is this https://blogs.oracle.com/jdevotnharvest/entry/how-to_tell_the_viewcriteria_a_user_chose_in_an_afquery_component or http://www.learnoracleadf.com/2013/05/programatic-handle-to-adf-query.html what you are looking for?
    Timo

  • Getting the description from dropdown list

    hi sdns,
    Just a quick check. My WD program have a set of dropdown list (by key) which is derived and populated by a complex series of logic.
    Now I need to update a textview of the description of dropdown list I select. I don't want to go through the complex codes again just to retrieve te descriptions but I want to directly access to the valueset to retrieve the description. I tried "gettext()" but it's giving me error.
    Anyone kind enough to provide me some snippet of codes to directly access to the selected description of my dropdown list? points will be awarded for useful answers....thanks.
    Jansen

    Hi Jansen,
    Let the attribute bound to DDKey be Val in Context.
    You will be putting key-value to DDKey by
    IWDAttributeInfo boutiqueInfo=wdContext.getNodeInfo()..getAttribute(IPrivate<View>.IContextElement.VAL);
    ISimpleTypeModifiable stf1=boutiqueInfo.getModifiableSimpleType();
    IModifiableSimpleValueSet svs=stf1.getSVServices().getModifiableSimpleValueSet();
    To get the text of the dropDown, first get the key of the dropDown selected by
    String key=wdContext.currentContextElement.getVal();
    Now u can get the value of this key from the SVS variable of DDby Key
    String ddValue=svs.getText(key);
    The key is case sensitive, so ensure the case also.
    U can check the existence of the key by
    if(svs.containsKey(key))
    and value by
    if(svs.containsText(key))
    Regards
    Fahad Hamsa

  • Add multiple entries to dropdown list without using data dictionary

    Hi,
    By default when we use a data dictionary element for dropdown list, all the possible values are listed in the dropdown. However when no data dictionary element is used for the dropdown list, it behaves like a parameter with a single line.
    I would like to know if it is possible to not use the data dictionary element and still have multiple lines in the dropdown.
    Thanks in advance.
    Shamia

    Check the below program :
    *report zxyz.
    report zxyz.
    Table diclaration
    tables: tvdir.
    Selection screento table View
      selection-screen skip 2.
      parameter p_tabnm(30) as listbox visible length 30 obligatory.
      selection-screen skip 1.
      selection-screen begin of block s1 with frame title text-001.
      parameter: p_radio1 radiobutton group g1,
                 p_radio radiobutton group g1.
      selection-screen end of block s1.
    Add values to list box
    at selection-screen output.
      type-pools: vrm.
      data: name  type vrm_id,
            list  type vrm_values,
            value like line of list.
      name = 'P_TABNM'.
      refresh list.
      value-key = 'V_024'.
      value-text = text-002. "'V_024-Purchasing Groups'.
      append value to list.
      value-key = 'V_T024D'.
      value-text = text-003. "'V_T024D-MRP Controllers'.
      append value to list.
      value-key = 'ZT604'.
      value-text = text-004. "'T604-Commodity Codes'.
      append value to list.
      value-key = 'T179'.
      value-text = text-005. "'T179-Product Hierarchies'.
      append value to list.
      value-key = 'TVM1T'.
      value-text = text-006. "'TVM1T-Business Manager'.
      append value to list.
      value-key = 'TVM2T'.
      value-text = text-007. "'TVM2T-Division manager'.
      append value to list.
      value-key = 'TVM3T'.
      value-text = text-008. "'TVM3T-Director'.
      append value to list.
      value-key = 'V_TVV2'.
      value-text = text-009. "'V_TVV2-Customer Group 2'.
      append value to list.
      call function 'VRM_SET_VALUES'
           exporting
                id     = name
                values = list.
    start-of-selection.
    Get flag of corresponding table view
      select single tabname flag from tvdir into tvdir
                    where tabname = p_tabnm.
    Set flag of corresponding table view
      if p_radio1 eq 'X'.
        if tvdir-flag ne 'X'.
          update tvdir set: flag  = 'X'
                     where tabname = p_tabnm.
        endif.
      endif.
      if p_radio eq 'X'.
        if tvdir-flag eq 'X'.
          update tvdir set: flag  = ''
                       where tabname = p_tabnm.
        endif.
      endif.
    Execute View/Table
      call function 'VIEW_MAINTENANCE_CALL'
        exporting
          action                               = 'U'
          view_name                            = p_tabnm
       exceptions
         client_reference                     = 1
         foreign_lock                         = 2
         invalid_action                       = 3
         no_clientindependent_auth            = 4
         no_database_function                 = 5
         no_editor_function                   = 6
         no_show_auth                         = 7
         no_tvdir_entry                       = 8
         no_upd_auth                          = 9
         only_show_allowed                    = 10
         system_failure                       = 11
         unknown_field_in_dba_sellist         = 12
         view_not_found                       = 13
         others                               = 14.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    Reset flag of corresponding table view
      update tvdir set: flag  = tvdir-flag
                    where tabname = p_tabnm.
    Thanks
    Seshu

Maybe you are looking for