How to set selected radioButton

Hi,
There are tons of examples on the websites to show you how to detect selected radioButton or click event. But It is not easy to find aone example to show you how to set selected radioButton.
Here is my code, but not working, Is it not well handle on it for Flex?
[Bindable]       
private var selectedRadioButton:RadioButton;
private function initSelect(): void {
        selectedRadioButton = rb1;
<mx:RadioButtonGroup id="rbg" selection="{selectedRadioButton}"
                   change="rbg_change(event);" />
                <mx:HBox>
              <mx:RadioButton id="rb1"
                      label="Active" group="{rbg}" />
              <mx:RadioButton id="rb2"
                      label="Lock" group="{rbg}" />
</mx:HBox>
Thanks

it's simple set its selected property true. For instance
myRadioButtonSelectedOnStart.selected="true"
Sincerely,
Michael
El 14/05/2009, a las 10:32, "master.card" <[email protected]> escribió:
>
Hi,
>
There are tons of examples on the websites to show you how to detect 
selected radioButton or click event. But It is not easy to find aone 
example to show you how to set selected radioButton.
>
Here is my code, but not working, Is it not well handle on it for 
Flex?
>
private var selectedRadioButton:RadioButton;
private function initSelect(): void {
        selectedRadioButton = rb1;
<mx:RadioButtonGroup id="rbg" selection=""
                   change="rbg_change(event);" />
                <mx:HBox>
              <mx:RadioButton id="rb1"
                      label="Active" group="" />
>               <mx:RadioButton id="rb2"
>                       label="Lock" group="" />
</mx:HBox>
>
>
>
Thanks
>

Similar Messages

  • How to set selection screen

    I have a question that ...
    i have 2 options --
    when select 1st option , show group1 screen
    when select 2nd option, show group2 screen
    like the follow ..which is pretty work!....but i have another question that how to set the screen field ..
    my question is that if i select group1 screen...i want to set
    if S1_EBELN = '' and S1_IHREZ = ''.
        message e398 with 'pls input one of these two options!'.
      elseif S1_EBELN ne '' and S1_IHREZ ne ''.
        message e398 with 'Only one of these two options input is allowed&#65281;'.
      endif.
    i've tried to insert these statement within the LOOP...but not work ......
    so can anyone know how to set?
    PARAMETERS:
    R1 RADIOBUTTON GROUP OPT1 USER-COMMAND R DEFAULT 'X'.
    PARAMETERS:
    R2 RADIOBUTTON GROUP OPT1.
    SELECTION-SCREEN BEGIN OF BLOCK RPT1 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS: S1_BUKRS FOR EKKO-BUKRS MODIF ID ABC. 
    SELECT-OPTIONS: S1_EBELN FOR EKKO-EBELN MODIF ID ABC . 
    SELECT-OPTIONS: S1_IHREZ FOR EKKO-IHREZ MODIF ID ABC .  
    SELECTION-SCREEN END OF BLOCK RPT1.
    SELECTION-SCREEN BEGIN OF BLOCK RPT2 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS:  S2_BUKRS FOR EKKO-BUKRS MODIF ID DEF.
    SELECT-OPTIONS: S2_MBLNR FOR MKPF-MBLNR MODIF ID DEF.   
    SELECT-OPTIONS: S2_XBLNR FOR MKPF-XBLNR MODIF ID DEF .   
    SELECTION-SCREEN END OF BLOCK RPT2.
    IF R1 = 'X'.
        LOOP AT SCREEN.
          IF screen-group1 = 'DEF'.
            screen-input = '1'.
            SCREEN-required = '1'.
            SCREEN-INVISIBLE = '1'.
            screen-input = '0'.
            screen-output = '1'.
            screen-active = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
    ELSEIF R2 = 'X'.
        LOOP AT SCREEN.
          IF screen-group1 = 'ABC' .
            screen-active = '0'.
            screen-input = '0'.
            screen-output = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.

    Modified ur code .
    tables : ekko, mkpf.
    PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.
    PARAMETERS : R2 RADIOBUTTON GROUP RG .
    SELECTION-SCREEN BEGIN OF BLOCK RPT1 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS: S1_BUKRS FOR EKKO-BUKRS MODIF ID ABC.
    SELECT-OPTIONS: S1_EBELN FOR EKKO-EBELN MODIF ID ABC .
    SELECT-OPTIONS: S1_IHREZ FOR EKKO-IHREZ MODIF ID ABC .
    SELECTION-SCREEN END OF BLOCK RPT1.
    SELECTION-SCREEN BEGIN OF BLOCK RPT2 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS: S2_BUKRS FOR EKKO-BUKRS MODIF ID DEF.
    SELECT-OPTIONS: S2_MBLNR FOR MKPF-MBLNR MODIF ID DEF.
    SELECT-OPTIONS: S2_XBLNR FOR MKPF-XBLNR MODIF ID DEF .
    SELECTION-SCREEN END OF BLOCK RPT2.
    at selection-screen output.
    IF R1 = 'X'.
    LOOP AT SCREEN.
    IF screen-group1 = 'DEF' .
    screen-active = '0'.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF R2 = 'X'.
    LOOP AT SCREEN.
    IF screen-group1 = 'ABC' .
    screen-active = '0'.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    ENDIF.
    at selection-screen .
    if r1 = 'X'.
    if s1_ebeln[] is initial and s1_ihrez[] is initial..
    message e001(zxx) with 'pls input one of these two options!'.
    endif.
    if NOT s1_ebeln[] IS initial.
    IF NOT s1_ihrez[] IS INITIAL.
    message e001(zxx) with 'only one entry in Ebeln or Ihrez is
    allowed'.
    ENDIF.
    ENDIF.
    endif.
    START-OF-SELECTION.
    WRITE:/ 'hi'.
    ***add on
    split the text into two texts .
    <b>if NOT s1_ebeln[] IS initial.
    IF NOT s1_ihrez[] IS INITIAL.
    message e001(zxx) with text-001 text-002.
    *'only one entry in Ebeln   = text-001
    or Ihrez is allowed'.       = text-002.</b> 
    regards,
    vijay

  • How to set selected file in FileChooser showSaveDialog to default file name

    Hi,
    How do I set selected file in JavaFX 2.0 FileChooser showSaveDialog, so I can prompt the user with a suggested default file name?
    I am converting a Java Swing application I wrote a few years ago to JavaFX 2.0.
    In the Swing application, I use setSelectedFile() as follows:
    JFileChooser jFileChooser = new JFileChooser();
    jFileChooser.setSelectedFile(new File(backupfile));
    jFileChooser.setCurrentDirectory(new File(outputDirectory));
    FileFilter filter = new FileNameExtensionFilter("Comma Delimited (*.csv)", "csv");
    jFileChooser.addChoosableFileFilter(filter);
    jFileChooser.setFileFilter(filter);
    filter = new FileNameExtensionFilter("XML Document (*.xml)", "xml");
    jFileChooser.addChoosableFileFilter(filter);
    jFileChooser.setAcceptAllFileFilterUsed(false);
    jFileChooser.setDialogTitle("Export File");
    int returnVal = jFileChooser.showDialog(jFrame, "Export");
    This would show a file chooser with the file name text field pre-populated with a default backup file name.
    I can't find an equivalent in JavaFX.
    Also, in the Swing application, I was able to determine which extension filter was selected at run time using getFileFilter().getDescription() as follows:
    String extension = jFileChooser.getFileFilter().getDescription();
    if (extension.equals("XML Document (*.xml)")) { ...
    I can't find an equivalent in JavaFX.
    Thanks,
    Barry

    You can use the open sequence file method on the application manager (then you only need to wire the file path)
    Rodéric L
    Certified LabVIEW Architect

  • How to set selected Language from Portal dropdown in Logon to User profile

    Hi Gurus,
    I select a language in Portal Language dropdown in the Logon Page.
    After login in the content is getting displayed in the browser language.
    I want the portal content to be displayed in the selected language in the portal LogonPage.
    I checked the thread Logon page change to add a dropdown for language
    The is the requirement for me too .
    Kindly suggest me on how to set the language in the Portal user Profile so that the portal contents gets displayed in the selected languages from the dropdown .
    Thanks in Advance

    Hi Prasanna,
    The language that the portal is displayed in depends on the following
    heirarchy, with the languages at the top of the list taking precedence
    over those at the bottom:
    1. Component (iview) language (defined in the portalapp.xml)
    2. Portal Mandatory language (defined in the prtDefault.properties)
    3. User language (defined in the user#s profile).
    4. Request language (defined by the browser).
    5. Portal Default language (defined in the prtDefault.properties)
    6. System Default language (default locale defined by the OS).
    So for example, if you have your portal user language (as in point 3)
    set to Russian, but the language of the iView that is the logon page
    (as in point 1) set to English, that logon page will be displayed in
    English.
    Keeping the above in mind, please make the necessary changes to the
    configurations and check if it helps.
    Regards,
    Sowmya
    Edited by: Sowmya K on Jun 2, 2011 11:32 AM

  • How to set selected all checkboxes in all dataTable's rows?

    Hi there,
    I'm trying to perform this simple task: having a dataTable with a column containing checkboxes, how can I allow (with a button, a "super" checkbox or so) to simultaneously set selected all checkboxes in all rows?
    And - is it possible to do so without calling the submit of the page?
    Thanks to everyone!

    Yes, the paging for <h:dataTable> works pretty good, it manages the task through four methods created in the java code -- DataTable1_firstPageAction(), DataTable1_previousPageAction(), DataTable1_nextPageAction(), DataTable1_lastPageAction() -- without adding any javascript in the jsp page.
    Maybe I could test if a java script similar to the <ui:table>'s one fit also the dataTable...
    thanks

  • ADF Faces: af:menuTabs - How to set selected tab

    I cannot find any documentation on how to set the selected tab of an af:menuTabs instance.
    Please help.

    Hi,
    the method above works if you manually inserts the menu items into a menu component, but not if you declaratively bind each component to a menu model.
    Following the ADF developer's guide, I created a dynamic menu using menuTabs (Section 11.2 Using dynamic menus for navigation). But somehow I don't get a difference in appearance between the selected and unselected tabs.
    I am also confused with the explanation in the tutorial. It says "The menu model in conjuction with nodeStamp controls whether a menu item is rendered as selected. As described earlier, a menu model is created from a tree model, which contains viewId information for each node. ViewIdPropertyMenuModel, which is an instance of MenuModel, uses the viewId of a node to determine the focus rowKey. Each item in the menu model is stamped based on the current rowKey. As the user navigates and the current viewId changes, the focus path of the model also changes and a new set of items is accessed. MenuModel has a method getFocusRowKey(), which determines which page has focus, and automatically renders a node as selected if the node is on the focus path."
    Any suggestions where I should add code to change the appearance of the selected tab? I am using the default Oracle skin.
    Greetings,
    Birgit

  • How to set selected row in alv display?

    Hi,
    How do I select some particular row in alv - say at first display i want to highlight 4th row. How can i do that?
    Thanks,
    Sheel

    try to use method set_selected_rows just after method for first display.

  • How to set selected text on JTextPane ?

    I need to set selected text on a JTextPane. I used setSelectionStart(); and setSelectionEnd(); but it doesn't work.
    Can anybody help me?

    I'm not sure if this is what you are looking for, but the following code sample was revised from the tutorial TextSamplerDemo.java. It will hightlight the word "selected" in yellow in the JTextPane.
    //created with j2sdk1.4.0_01
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    import java.awt.event.*;      
    public class SelectedText extends JFrame {
        public SelectedText() {
            super("Selected Text");       
            //Create a text pane.
            JTextPane textPane = createTextPane();
            JScrollPane paneScrollPane = new JScrollPane(textPane);
            paneScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
            paneScrollPane.setPreferredSize(new Dimension(250, 155));
            paneScrollPane.setMinimumSize(new Dimension(10, 10));
            Container pane = getContentPane();
            pane.add(paneScrollPane);
        private JTextPane createTextPane() {
            JTextPane textPane = new JTextPane();
            String[] initString =
                    { "This is the ", //regular
                      "selected",     //selected
                      " text. "       //regular
            String[] initStyles = {"regular", "selected", "regular"};
            initStylesForTextPane(textPane);
            Document doc = textPane.getDocument();
            try {
                for (int i=0; i < initString.length; i++) {
                    doc.insertString(doc.getLength(), initString,
    textPane.getStyle(initStyles[i]));
    } catch (BadLocationException ble) {
    System.err.println("Couldn't insert initial text.");
    return textPane;
    protected void initStylesForTextPane(JTextPane textPane) {
    //Initialize some styles.
    Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
    Style regular = textPane.addStyle("regular", def);
    StyleConstants.setFontFamily(def, "SansSerif");
    Style s = textPane.addStyle("selected", regular);
    StyleConstants.setBackground(s, Color.YELLOW);
    public static void main(String[] args) {
    JFrame frame = new SelectedText();
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    frame.pack();
    frame.setVisible(true);
    S.L.

  • How to set selected text color in Spark TextInput

    I'm trying to make Spark TextInputs and MXFTETextInputs look like Halo/MX TextInputs as much as possible, since I have a mix of both Spark and MX TextInputs in my application. I know I can set the
    selection background color to black using focusedTextSelectionColor. How can I set the selected text color to white so it matches the MX white-on-black look?

    This works, if you set the enabled property directly on the s:TextInput:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx">
        <s:layout>
            <s:VerticalLayout horizontalAlign="center" verticalAlign="middle" />
        </s:layout>
        <s:controlBarContent>
            <s:CheckBox id="ch" label="enabled" selected="true" />
        </s:controlBarContent>
        <fx:Style>
            @namespace s "library://ns.adobe.com/flex/spark";
            @namespace mx "library://ns.adobe.com/flex/mx";
            s|TextInput:disabled {
                color: red;
        </fx:Style>
        <s:Group>
            <s:TextInput id="ti" text="The quick brown fox jumps over the lazy dog" enabled="{ch.selected}" />
        </s:Group>
    </s:Application>
    It can get a bit trickier when you're setting the enabled property on a parent container, since (I believe) that the child control's enabled properties are still set to true and just the container is disabled. One possible workaround would be to bind the child TextInput control's enabled property to the container's enabled property. That way the s:TextInput should still go to it's disabled state and you can customize the disabled state's styles to have darker text, or whatever else you want.
    <s:Group id="gr" enabled="{ch.selected}">
        <s:TextInput id="ti" text="The quick brown fox jumps over the lazy dog" enabled="{gr.enabled}" />
    </s:Group>
    Peter

  • ALV - How to set selected rows into internal table

    Hi all,
    I am tying to set with an 'X' flag the selected rows in my ALV using an internal table that contains all rows showed.
    More exactly I have tried to follow these steps.
    1) I have added the filed SEL (type SEL) to my ALV structure zrt_bo_slabsend and I defined my internal table in this way
         DATA: gt_report TYPE STANDARD TABLE OF zrt_bo_slabsend,
                    gw_report TYPE zrt_bo_slabsend.
    2) I have set gw_layo-box_fname = 'SEL' to gw_layo (ALV layout)
    Pressing the "delete button" that I have insert on the top of the ALV, I intercept correctly my user command and I call a form (named "delete_lines") where I have this abap code
    FORM delete_lines.
        DATA: l_subrc          LIKE sy-subrc,
            lw_grid_settings LIKE lvc_s_glay.
    gw_layo-box_fname         = 'SEL'.
                                     "set field name to store row selection
      gw_layo-edit              = 'X'. "makes whole ALV table editable
      gw_layo-zebra             = 'X'.
    gv_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY_LVC'
      exporting
          i_callback_program       = gv_repid
         i_callback_pf_status_set = gc_status
         i_callback_user_command  = gc_user_command
         is_layout_lvc            = gw_layo
         it_fieldcat_lvc          = gw_fkat
         i_grid_settings          = lw_grid_settings
          i_save                   = 'X'
          is_variant               = variant
          it_events                = gt_events
        TABLES
          t_outtab                 = gt_report
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      LOOP AT gt_report ASSIGNING <report> WHERE SEL = 'X'.
        DELETE gt_report.
      ENDLOOP.
    ENDFORM.
    I'd like to select many rows in my ALV report, than by pressing the delete button I'd like to see a refresh of my ALV, without the selected rows. I want to save it only at the end of my action, only by pressing the save button.
    Any suggestion about the abap code will be well appreciated.
    Thanks in advance for your kind help.
    Regards.
        Giovanni

    Hi Giovanni,
    I am using the method:-
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                =
    *   I_BUFFER_ACTIVE                   =
       I_CALLBACK_PROGRAM                = gd_REPID
       I_CALLBACK_PF_STATUS_SET          = 'UDIT'
       I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
    *   I_CALLBACK_TOP_OF_PAGE            = ' '
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  =
    *   I_BACKGROUND_ID                   = ' '
       I_GRID_TITLE                      = 'Mainatin cell entry'
    *   I_GRID_SETTINGS                   =
       IS_LAYOUT_LVC                     = GS_LAYOUT
       IT_FIELDCAT_LVC                   = I_FIELDCAT[]
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS_LVC             =
    *   IT_SORT_LVC                       =
    *   IT_FILTER_LVC                     =
    *   IT_HYPERLINK                      =
    *   IS_SEL_HIDE                       =
       I_DEFAULT                         = 'X'
    *   I_SAVE                            = 'X'
    *   IS_VARIANT                        =
       IT_EVENTS                         =
       IT_EVENT_EXIT                     =
    *   IS_PRINT_LVC                      =
    *   IS_REPREP_ID_LVC                  =
       I_SCREEN_START_COLUMN             = 30
       I_SCREEN_START_LINE               = 14
       I_SCREEN_END_COLUMN               = 120
       I_SCREEN_END_LINE                 = 25
    *   IT_EXCEPT_QINFO_LVC               =
    *   I_HTML_HEIGHT_TOP                 =
    *   I_HTML_HEIGHT_END                 =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = IT_ZCP_DEMAND_SYS1
    * EXCEPTIONS
    *   PROGRAM_ERROR                     = 1
    *   OTHERS                            = 2
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    I have made five buttons on my toolbar (add, delete, save, back, exit).
    Kindly tell me how can I catch the sy-ucomm of these buttons.
    NOTE: this FM is written inside an user-exit, so I cannot make forms.
    Thanks in advance.

  • How to set Selected Ship-To in BasketUI?

    Hi Experts,
    Can you please help me how (in java code) to "set" the selected ship-to in BasketUI?
    In the code below, at the option, I just need to display the selected="selected" option.
    The output:
    <option  value="1">OPTION_A</option>
    <option  selected="selected" value="2">OPTION_B</option>
    ============================================
    BasketUI ui = new BasketUI(pageContext);
    <select class="select-xlarge" name="headerShipTo" id="headerShipTo" <% if (ui.isAccessible) { %> title="<isa:translate key="b2b.acc.shipto.title"/>" <% } %> >
           <isa:iterate id="shipTo" name="<%= MaintainBasketBaseAction.SC_SHIPTOS %>"    type="com.sap.isa.businessobject.ShipTo">
                       <option <%= ui.getShipToSelected(shipTo) %> value="<%= shipTo.getTechKey() %>">
                                  <%= JspUtil.encodeHtml(shipTo.getShortAddress()) %>
                       </option>
           </isa:iterate>
    </select>
    Thank you very much,
    jemaru

    The method ui.getShipToSelected(Shipto shipto) method checks if the input shipto is the selected Header Shipto
    and returns a string value selected="selected' , and blank string is the current selected shipto is not what is passed to this method.
    Since the BasketUI is, as the name says an UI class, there are no "setters". The UI class actually derives the values from the active basket / order / item objects. So, if you want to set the selected value, you must set this to the actual business object - the order
    Here is what one will do in an Action class to set item ship-to. Use the code below only as an example. You can reuse some of the code in the JSP also.
    //Say, this is what you have from your JSP
    //ship-to selected index
    RequestParser.Parameter shipToCustomer =  requestParser.getParameter("customer[]");
    // Somewhere in the item loop. You are setting the item shipto..
    // Assumed that order object is already available to you..
    ShipTo selectedShipTo = order.getShipTo(new TechKey(shipToCustomer));
    order.getItem(techKey).setShipTo((selectedShipTo == null) ?
                             ShipTo.SHIPTO_INITIAL : selectedShipTo);
    Is this what you are looking for?

  • How to set selection in UIPickerView after view has loaded?

    I have a UIPickerView working just fine, and I can set the current selection when a button is clicked, but how can I set the current selection when the view appears?
    I've tried to set the selection in viewDidLoad, viewDidAppear and viewWillAppear to no avail, I've also tried to do it in initWithNibName. Again no joy.
    As far as I can tell, the sequence of events is that my nib gets loaded by the view, my UIPickerViewDelegate interface methods are called to configure the picker, but what message can I pick up after all that has occured to set the selection?

    Hey Paul-
    I use this in one of my apps and it works great. Once the view loads, the picker gets set to the value I want with a nice animation. Let's say you want to set it to row 3.
    - (void)viewWillAppear:(BOOL)animated {
    [myPicker selectRow:3 inComponent:0 animated:YES];
    Of note: If you have the function - (void)viewWillAppear without the :(BOOL)animated part, it won't throw an error on compile, nor will it get called. Yes, I learned that firsthand.
    Hope this is what you are looking for.

  • How to set selected item of SelectOneMenu

    HI,
    I want to manually set the selected item of SelectOneMenu, can anyone tell me how can I do?
    Below is my code:
    <h:selectOneMenu binding="#{Monitor.dropdown1}" id="dropdown1" onchange="submit();" valueChangeListener="#{Monitor.pageItemsValueChange}">
        <f:selectItems binding="#{Monitor.dropdown1SelectItems}" id="dropdown1SelectItems" value="#{Monitor.pageItems}"/>
    </h:selectOneMenu>I tried to use dropdown1.setValue to set it, but I wonder which class type I can use.

    Initialize the value to the value you want to select:
    <h:selectOneMenu id="model" value="#{SearchVehicle.modelField}">
    <f:selectItems value="#{SearchVehicle.models}"></f:selectItems>
    </h:selectOneMenu>public class SearchVehicle{
    private String modelField = "XYZ";
    }

  • How to set selected field in one choice

    Hi,
    I am using ADF 11.1.1.3 and dynamic tab shell.
    In my application i create a question based on different subjects.
    This subject is a drop down and the value of this drop down is coming from a VO.I dropped that VO as Select One Choice on my page fragment.
    And create question.But when i go to edit that question i want to show the subject ( which was selected at the time of question creation) as selected and the other options in drop down.
    For Example-
    While creating i had 3 subjects
    A,B,C .I selected B and created a question.
    When i tried to edit the question i fetch the selected subject from one VO (VO to fetch the quetsions detal) and the list from another one.
    The option i tried to resolve this is -
    I drop the subject VO on edit page as select one choice and in in value of select ites i set the subject from questiondetailVO
    *<af:selectOneChoice*
    label="Subject:"
    shortDesc="Select the program description"
    *binding="#{backingBeanScope.backing_fragments_Ques.existingSubject}"*
    *id="existingSubject"*
    *showRequired="true"*
    *unselectedLabel="Select Subject"*
    *value="#{bindings.Subject_DESC.inputValue}"> (selected SUbject fom questionVO*
    *<f:selectItems value="#{bindings.SubjectVO1.items}"*(Subject list from Subject VO)
    *binding="#{backingBeanScope.backing_fragments_Ques.selectItems10}"*
    *id="selectItems10"/>*
    *</af:selectOneChoice>*
    Any idea why this is not wokring or what is the correct way to achieve the same?

    Hi,
    I used following code
    OAMessageLovInputBean lovbean=(OAMessageLovInputBean)webBean.findIndexedChildRecursive("AssetNumber");
    OAMessageChoiceBean Choicevalue=(OAMessageChoiceBean)webBean.findIndexedChildRecursive("EamWrPriority");
    if (pageContext.isLovEvent())
    String lovInputSourceId = pageContext.getLovInputSourceId();
    if(lovInputSourceId.equalsIgnoreCase("AssetNumber"))
    if(lovbean!=null)
    String slovVal=(String)lovbean.getValue(pageContext);
    String prValue = getPRValue(pageContext.getApplicationModule(webBean).getOADBTransaction(),slovVal);
    //String prValue = "1";
    Choicevalue.setValue(pageContext,prValue);
    }// end of processFormRequest
    private String getPRValue(OADBTransaction con,String slovVal)
    // System.out.println("In WorkRequestDffCO.getContextValue.organizationID" + organizationID);
    String prValue = null;
    String sql = "select decode(ml.meaning,'AC1',1,'AC2',1,'AC3',3,'AC4',3,null) from FND_LOOKUP_VALUES_VL ml ,mtl_serial_numbers msi where ml.lookup_type = 'MTL_EAM_ASSET_CRITICALITY' and msi.ASSET_CRITICALITY_code = ml.lookup_code and msi.serial_number = 'slovVal' ; //'30AC-TR002B'"
    Statement st = null;
    ResultSet rs = null;
    try
    st = con.createStatement(1);
    rs = st.executeQuery(sql);
    if(rs.next())
    prValue = rs.getString(1);
    catch(Exception e)
    e.printStackTrace();
    finally
    try
    if(st != null)
    st.close();
    if(rs != null)
    rs.close();
    catch(Exception e)
    e.printStackTrace();
    return prValue;
    Query is executing but no value is retuning, if i use hard coded value in where condition like '30AC-TR002B' it is tt's returning value .

  • How to set selected entity of a collection in the current, and publish it.

    Hi frnds,
      I have collection which contains n number of entities,
    now i am  filtering the collection and getting a unique entity.
    what i need is that i want to publish this entity as current.
    How can I set this filtered entity to the current?
    regards
    Ashraf.

    Hi Ashraf,
    You have to iterate the collection using the following methods first till you access the entity to which you want to change the
    focus.
    IF_BOL_BO_COL~GET_FIRST
    IF_BOL_BO_COL~GET_NEXT
    IF_BOL_BO_COL~GET_PREVIOUS
    IF_BOL_BO_COL~GET_LAST
    Once you reach the corresponding entity, the following method will give that entity when called.
    IF_BOL_BO_COL~GET_CURRENT
    Then you have to call the following method to publish this focus.
    IF_BOL_BO_COL~PUBLISH_CURRENT
    If you have already iterated to the unique entity in the collection, then you just need to do the publish_current.
    Regards,
    Leon

Maybe you are looking for