How to get the row selected in af:inputComboBoxListOfValues

Hi,
Am using jdev 11.1.1.2.1.
Am using af:inputComboBoxListOfValues component , i have made the component based on the " department id" and the display value is " department name".
In the value change listener i want to get the selected department id but currently am getting only the department name.(using valueChangeEvent.getNewValue().toString())
So is there any way to get the entire row and get the "department id" using that ??
Please help.
Thanks,
Hari

Sorry for the confusion, needed to check it out:
this code should work:
    public void nameValueCangeListener(ValueChangeEvent valueChangeEvent) {
        FacesContext contxt = FacesContext.getCurrentInstance();
        valueChangeEvent.getComponent().processUpdates(contxt); // after this the new row is selected!
        BindingContext lBindingContext = BindingContext.getCurrent();
        BindingContainer lBindingContainer = lBindingContext.getCurrentBindingsEntry();
        JUCtrlListBinding list = (JUCtrlListBinding) lBindingContainer.get("YOUR_LIST_BINDING_NAME");
        Row lFromList = (Row)list.getCurrentRow();
        Object lAttribute = lFromList.getAttribute("YOUR_ATTRIBUTE_YUO_WANT_TO_GET");
    }Timo

Similar Messages

  • How to get the old selection in ListSelectionListener valueChanged() method

    Hi,
    Is anyone know how to get the old selection index/value in the ListSelectionListener valueChanged() method? The list.selectedValue() always return the same value which is the new selection. The ListSelectionEvent.getFirstIndex() and getLastIndex are always firstIndex <= lastIndex so that you cant' tell which one is the old selection.
    Please help and thanks!

    Just test the two indexes (first and last): if the corresponding row is selected, then the other is unselected. That gives you the old (unselected) and new (selected) item.
    Of course, I have supposed that you were using a SINGLE_SELECTION model...
    Hope this helped,
    Regards.

  • How to get the row Count of a ResultSet

    How to get the row Count of a ResultSet

    Hi
    I'v tried rennie1's way ,but I only get zero,my code is:
    rs.executeQuery("select count(*) from t_test");
    if (rs.next()) int rowCount=rs.getInt(1);
    I also tried barni's way ,but the method rs.last() and rs.beforeFirst() throw a same Exception
    I tried another way,the code is:
    while rs.next(){
    // Do nothing ,just move the cursour to the last row
    int rowCount=rs.getRow()
    However,the rowCount still equal zero
    Any help would be greatly apprecite!
    note:
    I get connection by DataSource's JNDI name from client, the Server is Weblogic Server 6, the DBMS is Oracle.

  • How to get the previoulsy selected value in a combobox

    How to get the previoulsy selected value in a combobox. i WANT the current and the previously selected value of the combobox.

    Just add to combobox ItemListener. When item is changing in itemStateChanged arrives 2 events. ItemEvent.DESELECTED and ItemEvent.SELECTED with corresponding item's values. Just write something like this:
            comboBox.addItemListener(new ItemListener() {
                Object prevValue;
                public void itemStateChanged(ItemEvent e) {
                    if (e.getStateChange() == ItemEvent.SELECTED) {
                        //do what you need with prevValue here
                    } else {
                        prevValue = e.getItem();
            });

  • How to get the default selection color from JTable

    Hi, there,
    I have a question for how to get the default selection color from JTable. I am currently implementing the customized table cell renderer, but I do want to set the selection color in the table exactly the same of default table cell renderer. The JTable.getSelectionBackgroup() did not works for me, it returned dark blue which made the text in the table unreadable. Anyone know how to get the window's default selection color?
    Thanks,
    -Jenny

    The windows default selection color is dark blue. Try selecting any text on this page. The difference is that the text gets changed to a white font so you can actually see the text.
    If you don't like the default colors that Java uses then use the UIManager to change the defaults. The following program shows all the properties controlled by the UIManager:
    http://www.discoverteenergy.com/files/ShowUIDefaults.java
    Any of the properties can be changed for the entire application by using:
    UIManager.put( "propertyName", value );

  • Need to get the row selected in table control without ay action

    Dear Team,
    I have a requirement in which I need to pass the row selected of a table control to a variable.
    Here I need to get the row selected with out any other action
    then the action of selection of a row.
    Is it possible to read table control values using FM DYNP_VALUES_READ.
    thanks in advance,
    regards,
    Sai

    HI,
    Sai Kumar Potluri
    I tried in IDES it working.
    Here is the code.
    REPORT  ZPRA_TC_D.
    TABLES : SCARR.
    CONTROLS TC TYPE TABLEVIEW USING SCREEN 1.
    DATA : SELLINE TYPE I,
           SELINDEX TYPE I.
    DATA : ACT LIKE SCARR-CARRID,
           ANT LIKE SCARR-CARRNAME.
    DATA : ITAB LIKE SCARR OCCURS 0 WITH HEADER LINE.
    CALL SCREEN 1.
    *&      Module  STATUS_0001  OUTPUT
    *       text
    MODULE STATUS_0001 OUTPUT.
      SET PF-STATUS 'ME'.
    *  SET TITLEBAR 'xxx'.
    SELECT * FROM SCARR INTO TABLE ITAB.
    ENDMODULE.                 " STATUS_0001  OUTPUT
    *&      Module  MOV  OUTPUT
    *       text
    MODULE MOV OUTPUT.
      MOVE-CORRESPONDING ITAB TO SCARR.
    ENDMODULE.                 " MOV  OUTPUT
    *&      Module  USER_COMMAND_0001  INPUT
    *       text
    MODULE USER_COMMAND_0001 INPUT.
    CASE SY-UCOMM.
    WHEN 'BACK' OR 'UP' OR 'EXIT'.
      LEAVE PROGRAM.
    WHEN 'SEL'.
      GET CURSOR FIELD SCARR-CARRID LINE SELLINE.
      SELINDEX = TC-TOP_LINE + SELLINE - 1.
      READ TABLE ITAB INDEX SELINDEX.
      ACT = ITAB-CARRID.
      ANT = ITAB-CARRNAME.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0001  INPUT
    In Flow Logic.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0001.
    LOOP AT ITAB WITH CONTROL TC.
      MODULE MOV.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT ITAB.
    ENDLOOP.
    MODULE USER_COMMAND_0001.

  • How to get the row number

    Hi list,
    does any one know how I can get the row number the same as what I have in column rowno?
    thanks
    Arvin
    REATE   TABLE dbo.temptable
    ( y int  NOT NULL,
      e int not null,
      c int not null,
      rowno int not null)
    /* insert values  */
    INSERT INTO dbo.temptable(y,e,c,rowno ) VALUES
    (1,1,1,1),
    (1,1,2,1),
    (1,1,3,1),
    (1,20,1,2),
    (1,20,2,2),
    (1,20,3,2),
    (1,3,1,3),
    (1,3,1,3),
    (2,1,1,1),
    (2,1,1,1),
    (2,2,1,2),
    (2,2,1,2);

    You may update your rownumber column with Column "e".
    But why do you duplicate your data? May be there is no particular reason, you may be wasting space for it
    Try the below:
    CREATE TABLE dbo.temptable
    ( y int NOT NULL,
    e int not null,
    c int not null,
    ronum int null)
    INSERT INTO dbo.temptable(y,e,c ) VALUES
    (1,1,1),
    (1,1,2),
    (1,1,3),
    (1,20,1),
    (1,20,2)
    select * from temptable
    update dbo.temptable Set ronum=e
    Select * From dbo.temptable
    DRop table dbo.temptable

  • How to get the rows from a table having some column has any letter

    Hi All,
    suppose i have a table having columns id(number), code(varchar).
    code has alphanumeric characters (ex. ABC123, 67B56 etc).
    some codes are only numbers (2344, 7898 etc).
    how can i get the rows which have alphabets in the code.
    ex:
    id code
    1 AB45
    2 456
    3 890
    4 67B7
    how can i write a query such that it should give me the ids 1 and 4 (as they have alphabets in code)
    thanks in advance to all

    Thanks to one and all.
    i am gettig my required output.
    But i have a doubt in the operator.
    If i add or remove '[]' in the operator, i am getting different ouputs.
    There is a count difference in the result of the operators used.
    REGEXP_LIKE(<column>,'[[:lower:]]')
    REGEXP_LIKE(<column>,'[[[:lower:]]]')
    REGEXP_LIKE(<column>,'[:lower:]')
    Can anybody please explain what is the difference in using '[]', in the operator?
    What is the correct syntax, whether i have to use two '[]'s or one '[]'.
    Also, can i use REGEXP_LIKE() in oracle 8i version.( I am unable to use the operator in 8i)?
    Any query to get the required output in 8i version?
    Thanks in advance to all.

  • How to get the rows gap in the application file...?

    Hi All,
    Im working with Application server and I have a query like after transferring / printing 100 rows in the App server, I need 2 to 3 rows gap and then remaining will print.
    How to get the gap in the application file.
    Pls let me know.
    Puppy.

    Hi,
    when you are transfering the data to file
    loop at itab in wa_itab.
    counter  = count + 1.
    transfer wa_itab to fiel.
    if counter = 100
        clear wa_itab.
        transfer wa_itab to fiel.
        transfer wa_itab to fiel.
        transfer wa_itab to fiel.
       clear counter.
    endif.
    endloop.
    regards,
    Munibbau.K

  • How to get the Row and Column values in ALV (without using Objects)

    Hi All,
    I need to get the Row / Column when double click is used in ALV, I can use the double click event for this. However, I do not want to use the Object Oriented ALV. I want to implement the same functionality using general (using functions) ALV.
    Is there any way to get the row / column values for a Generia (non-OOPs) ALV report.
    Please help.
    Thanks,
    Vishal.

    Hello,
    The only think you have to do is to get the index where the user clicked, and then read the internal table you sent to the alv
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = 'prg_name'
          i_callback_pf_status_set = 'SET_PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND' " this is to the click event!!
          i_callback_top_of_page   = 'TOP_OF_PAGE'
          is_layout                = alv_layout
          it_fieldcat              = alv_fieldcat
          i_save                   = 'A'
          it_events                = alv_events[]
        TABLES
          t_outtab                 = i_totmez.  ---> TOUR IT.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    " then....
    FORM user_commandUSING r_ucomm     TYPE sy-ucomm
                                    ls_selfield TYPE slis_selfield.
    " r_ucomm -> HAS THE STATUS
    " ls_selfield-tabindex  -> HAS THE SELECTED INDEX
    " THEN READ THE INTERNAL TABLE
    " HERE YOU WILL HAVE THE SELECTED ROW
    READ TABLE i_totmez INDEX ls_selfield-tabindex.
    ENDFORM.
    cheers,
    Gabriel P.

  • JTree: How to get the currently selected node

    How do I get the currently selected node in JTree?
    getLastSelectedPathComponent() this method always return the last selected node and not the current one.
    Thanks in advance
    Sachin

    Use
    TreePath selectedPath = tree.getSelectionPath()If your tree allows multiple selections, use
    TreePath [] selectedPaths = tree.getSelectionPaths() this will return an array of all selected tree paths.
    Once you get the tree path, call the treePath.getLastPathComponent(). this should tell you the currently selected node.
    Hope this helps
    Sai Pullabhotla

  • VS2013 / Team Explorer vsix - How to get the currently selected build definition?

    Greetings,
    My goal with a simple extension is to right-click any build definition and if my "Show Build Def Stats" menu item is selected, pop a message box with some summary details I plan to pull from the IBuildDefinition interface.
    I'm missing something fundamental I'm sure, but I cannot figure out how in the menu handler the actual build definition that I clicked on.
    The menu command is added where I want it successfully:
    Symbol info used to get this there:
        <!-- This is the Build Definition Context Menu -->
        <GuidSymbol name="guidTeamExplorerBuildDefContextMenu" value="{34586048-8400-472E-BBBF-3AE30AF8046E}" >
          <IDSymbol name="menuBuildDefinitionContext" value="0x109"/>
        </GuidSymbol>
    I am stumped as to how to get the fact that I clicked the "ISRepository" build definition in either the Initialize() or MenuItemCallBack() methods, I haven't come across the right service or container object that I recognize.
    Much obliged!
    --Jordan

    I have been investigating this for a while using .NET Reflector and finally I got it:
    In VS 2013, add references to the following assemblies in the folder C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer:
    Microsoft.TeamFoundation.Controls.dll
    Microsoft.TeamFoundation.Build.Controls.dl
    And then use this code:
    Microsoft.TeamFoundation.Controls.ITeamExplorer teamExplorer;
    Microsoft.TeamFoundation.Controls.ITeamExplorerPage teamExplorerPage;
    Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt buildsPageExt;
    teamExplorer = base.GetService(typeof(Microsoft.TeamFoundation.Controls.ITeamExplorer)) as Microsoft.TeamFoundation.Controls.ITeamExplorer;
    teamExplorerPage = teamExplorer.CurrentPage;
    buildsPageExt = teamExplorerPage.GetExtensibilityService(typeof(Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt)) as Microsoft.TeamFoundation.Build.Controls.Extensibility.IBuildsPageExt;
    foreach (Microsoft.TeamFoundation.Build.Controls.Extensibility.IDefinitionModel definitionModel in buildsPageExt.SelectedDefinitions)
    System.Windows.Forms.MessageBox.Show(definitionModel.Name);
    * My new blog about VSX: http://www.visualstudioextensibility.com * Twitter: https://twitter.com/VSExtensibility * MZ-Tools productivity extension for Visual Studio: http://www.mztools.com.

  • How to get the row reference of inner table of an advance table

    Hi Gurus,
    Using R12.1.3, How to get the handle of inner table row reference of an advance table in controller.
    Regards,
    Zakir

    The javadoc for oracle.jbo.Key is really helpful.
    getAttributeNames()
    getAttributeValues()
    etc

  • HOW to emphasize the row selected in a different colour

    Hi all,
    there is any way to set the selected row in a table in a different background-colour?
    i want to emphasize the row selected by user, i try this:
    <af:column headerText="#{res['abogados.nombre']}"
    sortProperty="Nombre" sortable="true"
    binding="#{backing_app_Abogados.column14}"
    id="column14">
    <af:outputText value="#{row.Nombre}"
    binding="#{backing_app_Abogados.outputText14}"
    id="outputText14"
    inlineStyle="background-color:#{bindings.AbogadosView1.currentRow.codigo == row.Codigo ? 'red' : 'transparent'};"/>
    </af:column>
    but this sets the outputText's background to red, i want to set in red all the row..
    any idea?

    Does Rado's following blog entry help: http://adf-rk.blogspot.com/2007/01/adf-oracle-form-like-overflow-in-adf.html

  • How to get the current selected value of a combo box or a option button?

    Hello All,
    I want to catch the current selected value of a combo box and also of a option button and want save it into different variables in my code. These option button and combo box are in a SAP business one form which I have created through VB dot.net coding.
    But I don't know how to do that, can any one send any example code for this.
    Regards,
    Sudeshna.

    Hi Sudesha,
    If you want to get the selected values you can do it as follows: The Combo Box value you can get from the combo box. If you want to get it on the change event, you must make sure that you check when BeforeAction = False. If you want to get an Option Button value you should check the value in the data source attached to the option button.
            Dim oForm As SAPbouiCOM.Form
            Dim oCombo As SAPbouiCOM.ComboBox
            Dim oData As SAPbouiCOM.UserDataSource
            oForm = oApplication.Forms.Item("MyForm")
            oCombo = oForm.Items.Item("myComboUID")
            oApplication.MessageBox(oCombo.Selected.Value)
            oData = oForm.DataSources.UserDataSources.Item("MyDataSourceName")
            oApplication.MessageBox(oData.ValueEx)
    Hope it helps,
    Adele

Maybe you are looking for

  • Workspace Error while granting permissions

    Hi- I need help on this error. An error window will pop up every time I right clicked on a report/folder at workspace and try to grant access to report/folder (as native admin). (Right click on report/folder and choose Properties) Recently I migrated

  • Os 10.6.8 Acrobat Reader v 9 and 10 won't work

    I have an iMac 24 running OS 10.6.8 and I can no longer load .pdf files from internet sites. I can load them when they are on my local HDD. I deleted Adobe Reader a couple times and re-installed version 10.1 and then ver 9. All I get when I try to lo

  • Replicating Product groups after client copy WRONG

    Hi Folks, I've taken a client copy from client 100 to 050 in both SRM SD1CLNT100 and ECC ED1CLNT100. I've done BDLS to replace log. sys. in both systems for both SRM and ECC log sys. eg. ED1CLNT100 to 050 and SD1CLNT100 to 050. After replication of c

  • Heap corruption in mulithreaded program

    Hi, We have a big mulithreaded program (on Solaris 8) which crashes randomly. The crash location varies every time. But, the top of the back trace is more or less the same every time. Is it heap corruption OR any known bugs in the libraries or platfo

  • Applet Impersonating a browser for file upload

    Has anyone ever tried to make an applet talk to a servlet and upload a file (multipart encoded) to an appropriate servlet, if so, then I would like to learn how. Thanks.