Create dynamically  check box

hi,
i need a sample code to create a check box dynamically

JCheckBox checkBox = new JCheckBox(...);
somePanel.add( checkBox );
somePanel.revalidate();

Similar Messages

  • Dynamic check box

    Hi I need help from all java expertise, I need to create dynamic check boxes. table have the customer name, one customer have multiple locations, on selection of customer name, all the locations should be displayed with chek box option, so that the user will allocate some rebate or ajustment to a particular location. How to achive this. any help will be appericiated
    thanks

    Lets assume that you got your customer information and everything is stored in a ResultSet rs
    The value of the radio buttons in this case will be the customer name but you can change it
    to whatever you want that way you can get the parameter accordingly to do your updates.
    <%
    ResultSet rs = ....... ;
    for( int n = 1; n <= rs.size(); n++ )
    while (rs.next()) {
    String custName = rs.getString("CUSTOMER_NAME");
    String custLoc = rs.getString("CUSTOMER_LOCATION");
    %>
    <tr>
    <td BGCOLOR="#FFFFCE" valign="top" align="left"><input type="radio" name="radioButton" value="<%=custName%>"> </td>
    <td BGCOLOR="#FFFFCE" valign="top" align="left"><%=custName%> </td>
    <td BGCOLOR="#FFFFCE" valign="top" align="left"><%=custLoc%> </td>
    </tr>
    <% } // end while loop
    } // end for loop
    %>
    </table>

  • Apex with dynamic check box....

    hi to all:
    i have report emp.it contain data like eno,ename,sal,record .
    example:eno ename sal record
    100 a 100
    200 b 3000 going on...
    using this column i am making report by using apex and report contain one submit button also.
    1)in this report i am creating dynamic check box depend on eno..see my coding
    declare
    str varchar2(3000);
    begin
    str:='select htmldb_item.CHECKBOX(10,eno,DECODE(record,1,''CHECKED'')) "SELECT" ,eno,ename,sal ,record from emp where 1=1';
    return str;
    end;
    2)in process created after  submit
    iam created pl/code like ..this code for
    declare
    i number;
    str varchar2(2000);
    emp_id number;
    begin
    FOR i in 1..HTMLDB_APPLICATION.G_F10.count
    LOOP
    IF HTMLDB_APPLICATION.G_F10(i) is not null then
    SELECT htmldb_application.G_F10(i) INTO emp_id from dual;
    --insert into my_log values(emp_id);commit;
    update emp set record=1 where eno=emp_id ;
    commit;
    else if HTMLDB_APPLICATION.G_F10(i) is null then
    update emp set record=0 where eno=emp_id ;
    commit;
    else
    null;
    end if;
    end loop;
    end;
    my requirenent:
    a)if check box checked then -update -record column -1
    b)if check box uncked then -update - record column -0
    in process coding--
    eno alway is not null only..
    so i want to do check box with update the record column..like this
    a)if check box checked then -update -record column -1
    b)if check box uncked then -update - record column -0
    pls give solution.
    output i want like this example:
    chebox eno ename sal record
    checked(X) 100 a 300 1
    checked(x) 200 b 300 1
    next time i am trying to make uncheck first row like
    chebox eno ename sal record
    unchecked 100 a 300 0
    checked(x) 200 b 300 1

    Hi VKR,
    Please try this,
    <cfform name="frmTest"  format="Flash" action="test.cfm" method="post"  >
    <cfscript>
        qryCountry = queryNew("Country,CountryID");   
          queryAddRow(qryCountry);  
          querySetCell(qryCountry, "Country", "India");  
          querySetCell(qryCountry, "CountryID", "1");  
          queryAddRow(qryCountry);  
          querySetCell(qryCountry, "Country", "England");
           querySetCell(qryCountry, "CountryID", "2");    
          queryAddRow(qryCountry);  
          querySetCell(qryCountry, "Country", "Kenya");
           querySetCell(qryCountry, "CountryID", "3");      
    </cfscript>   
        <cfformgroup type="repeater"  query="qryCountry">                       
            <cfinput type="checkbox" value="{qryCountry.currentItem.CountryID}" name="chk" Label="{qryCountry.currentItem.Country}">                               
        </cfformgroup>
        <cfinput type="submit" name="submit" width="100" value="Submit"  >
    </cfform>
    Hope this will help

  • How do I create a check-box matrix question using Acrobat XI Pro?

    I would like to insert a question that is a 10 x 10 matrix that allows respondents to select multiple boxes in each row.  For example, the "add item > rating scale" feature formats a matrix the way I would like, although it only seems to allow for radio buttons.  With this feature, respondents can only select one item per row.  Is there any way to use this feature with check-boxes rather than radio buttons?  Or a different feature to create a matrix that allows for multiple selections per row? 
    Thanks so much,
    Andy 

    I created a 30 page Form in Microsoft Word with 20 to 30 check boxes on each page using the Zapf Dingbats Font.
    When I used Acrobat XI Pro to automatically convert the form it fails to create usable check boxes.
    It worked properly about 3 times on test pages but it will not do it again.
    Manually inserting check boxes one by one on 30 pages is mind numbing to say the least.
    Why doesn't the software work properly anymore?

  • How to create a check box with an X

    Hi,
    How do you create a check box with an X as apposed to a tick?
    Thanks

    Go to the check box's properties and in the Options tab choose "Cross" as the check box style.

  • Create a check box in excel cell  using sap abap

    Dear Sap Master's,
    Please give me some idea on  how to create a check box in excel cell using abap program..
    (OLE concept).
    Thanks
    Moderator message: please search for available information first.
    Edited by: Thomas Zloch on Jan 12, 2012

    select the cell then open the cell formatter:
    process should be similar in the iOS version.  I do not have any iOS devices with Numbers so I cannot check.  I did find this link that may help:
    http://support.apple.com/kb/PH3374?viewlocale=en_US

  • How does one create a "check box" in a cell?

    How does one create a "check box" in a cell?

    select the cell then open the cell formatter:
    process should be similar in the iOS version.  I do not have any iOS devices with Numbers so I cannot check.  I did find this link that may help:
    http://support.apple.com/kb/PH3374?viewlocale=en_US

  • How do I create a check box?

    Hey there,
    I want to create a check box beside a text, like "keep me logged in". Anyone who can explain me how to do that?
    Thanks,
    alewei

    A checkbox is a form element. Fireworks doesn't do forms. You'll need to do that in Dreamweaver.

  • Creating Dynamic select boxes

    Can we create dynamic select boxes which will change when the user selection changes. How many levels we can go about.
    For example
    we have one combo box named states--> depending upon the states selected the corresponding districts should be shown in the other combo box, and when the user selects a district it should show the corresponding villages or towns and further..
    Can we do it without ajax concept. if yes how?
    If we have to use ajax one level is easy how to go about two or three levels.
    Thanks in advance.

    Hi !
    ya it is possible to change values of Combobox depending on the value changed in another combobox.
    it is possible when you implement Model and by reference of that
    model you can change values of that combobox such as.
    model1.removeAllItems();
    model1.addItemAt(location); etc
    inspite of this if you need code help i will provide it to you.

  • How to create the Check box and Text Area inside the Assignment block

    Dear all,
            I am new to web UI development. my requirement is to create the Check box and Text box in the Assignment block. Can anyone help me to do this requirement.
    Thanks & Regards,
    Ashok.

    Hi,
      Please place the below code in the GET_P methods of the fields.
      For Text Area 
    CASE iv_property.
        WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
          rv_value = cl_bsp_dlc_view_descriptor=>field_type_textarea.
      ENDCASE.
    For Check Box 
    CASE iv_property.
        WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
          rv_value = cl_bsp_dlc_view_descriptor=>field_type_checkbox.
      ENDCASE.
    Regards,
    Lakshmi.Y

  • R12: New Instance creation: what is create warranty check box?

    Hello all,
    In R12, we can create Item instance from Contract launchpad screen itself.
    When New Instance sub form opens, it has "create warranty" check box.
    What is the purpose of this checkbox?
    Regards
    Preeti

    Yes,you can create so that you can cover this instance in the same contract quickly ( i am hoping it is not automatically adding to the contract where you created from). This must be keeping in mind the customer service getting calls about new product that customer wanted to get covered.
    Warranty creation depends on whether the product (item) has BOM with warranty item as a component or not. Do you have that setup done for this item?
    Thanks
    Nagamohan

  • Need code for Dynamic check box creation in struts

    dynamic checkbox should be created with details of data stored in database(with check mark for already selected check box).
    once user make any change to that page and click submit the result ahould be saved in database..
    can anybody explain me how to proceed this.
    If any sample source code you have plz do sent me..

    consider these are the details in database
    1. apple checked
    2. orange
    3. mango
    4. grapes checked
    consider a jsp page which should display list of fruits in the datsbase,
    the jsp page should retrieve these data and diaplay with check box.
    These should be generated dynamically.
    Assume the jsp page has option for user to enter some other fruit name which should be updated into database of fruits and that should be displayed with the jsp page during next visit.(i.e) number of fruits in the database is not constant.

  • Dynamic check box creation in selection screen

    Hello,
    I am trying to put up some check boxes dynamically in a selection screen. The number: of check boxes required and the 'checkbox label text' is to be retrieved from a database table. I have retrieved all these values in AT SELECTION-SCREEN OUTPUT event. But, I dont know how to create check box parameters using these dynamic values.  Please help..

    hi Giffin,
    Create a program with name 'Z_13317_DYN_CHKBOX' and paste the following code in it. Also make ensure that an include with name 'Z_13317_DYN_INCL' is not existing earlier because this program will be overwritten each and everytime.
    Z_13317_DYN_CHKBOX will take an integer as an input. After giving input, click on the button on selection screen.
    Suppose, if you have given 3 as input and if you have clicked the button, then 3 checkboxes will be generated on your selection screen.
    REPORT  Z_13317_DYN_CHKBOX.
    types :begin of t_itab1,
            line(72),
           end of t_itab1.
    data: incl type table of t_itab1 with header line.
    parameters: p_tab type i,
                p_frst type c no-display.
    selection-screen begin of line.
    selection-screen: pushbutton 2(20) but1 user-command cli1.
    selection-screen end of line.
    include z_13317_dyn_incl if found.
    initialization.
    at selection-screen output.
      if p_frst = ' '.
        p_frst = 'X'.
        perform crt_dyn_incl.
      endif.
    at selection-screen.
      case sy-ucomm.
        when 'CLI1'.
        perform crt_dyn_incl.
      endcase.
    *&      Form  crt_dyn_incl
    *       text
    form crt_dyn_incl .
      perform populate_incl.
      perform del_incl.
      insert report 'Z_13317_DYN_INCL' from incl.
      commit work.
      submit z_13317_dyn_chkbox via selection-screen with p_frst = p_frst.
    endform.                    " crt_dyn_incl
    *&      Form  del_incl
    *       text
    form del_incl .
      call function 'RS_DELETE_PROGRAM'
        exporting
         program                          = 'Z_13317_DYN_INCL'
         suppress_checks                  = 'X'
         suppress_popup                   = 'X'
         with_cua                         = ' '
         with_documentation               = ' '
         with_dynpro                      = 'X'
         with_includes                    = ' '
         with_textpool                    = ' '
         with_variants                    = ' '
      if sy-subrc <> 0.
      endif.
    endform.                    " del_incl
    *&      Form  populate_incl
    *       text
    form populate_incl .
      data: v_cnt type n.
      do p_tab times.
        v_cnt = v_cnt + 1.
        incl-line = 'parameters: '.
        concatenate incl-line 'p_chk' v_cnt into incl-line.
        concatenate incl-line 'as checkbox.' into incl-line separated by space.
        append incl.
        clear incl.
      enddo.
    endform.                    " populate_incl
    Regards,
    Sailaja.

  • Dynamic Check Box Error

    Hi All,
            I have created Dynamic UI Checkbox which is creating dynamic checkboxes based on the database Table fields.
    Here is my code in Start View
    // This file has been generated partially by the Web Dynpro Code Generator.
    // MODIFY CODE ONLY IN SECTIONS ENCLOSED BY @@begin AND @@end.
    // ALL OTHER CHANGES WILL BE LOST IF THE FILE IS REGENERATED.
    package com.titan.retailauditreport;
    // IMPORTANT NOTE:
    // ALL IMPORT STATEMENTS MUST BE PLACED IN THE FOLLOWING SECTION ENCLOSED
    // BY @@begin imports AND @@end. FURTHERMORE, THIS SECTION MUST ALWAYS CONTAIN
    // AT LEAST ONE IMPORT STATEMENT (E.G. THAT FOR IPrivateStartView).
    // OTHERWISE, USING THE ECLIPSE FUNCTION "Organize Imports" FOLLOWED BY
    // A WEB DYNPRO CODE GENERATION (E.G. PROJECT BUILD) WILL RESULT IN THE LOSS
    // OF IMPORT STATEMENTS.
    //@@begin imports
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDCheckBox;
    import com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTransparentContainer;
    import com.sap.tc.webdynpro.progmodel.api.IWDNode;
    import com.sap.tc.webdynpro.progmodel.api.IWDNodeElement;
    import com.sap.tc.webdynpro.progmodel.api.IWDNodeInfo;
    import com.sap.tc.webdynpro.progmodel.api.IWDUIElement;
    import com.titan.retailauditreport.wdp.IPrivateStartView;
    //@@end
    //@@begin documentation
    //@@end
    public class StartView
    Logging location.
      private static final com.sap.tc.logging.Location logger =
        com.sap.tc.logging.Location.getLocation(StartView.class);
      static
        //@@begin id
        String id = "$Id$";
        //@@end
        com.sap.tc.logging.Location.getLocation("ID.com.sap.tc.webdynpro").infoT(id);
    Private access to the generated Web Dynpro counterpart
    for this controller class.  </p>
    Use <code>wdThis</code> to gain typed access to the context,
    to trigger navigation via outbound plugs, to get and enable/disable
    actions, fire declared events, and access used controllers and/or
    component usages.
    @see com.titan.retailauditreport.wdp.IPrivateStartView for more details
      private final IPrivateStartView wdThis;
    Root node of this controller's context. </p>
    Provides typed access not only to the elements of the root node
    but also to all nodes in the context (methods node<i>XYZ</i>())
    and their currently selected element (methods current<i>XYZ</i>Element()).
    It also facilitates the creation of new elements for all nodes
    (methods create<i>XYZ</i>Element()). </p>
    @see com.titan.retailauditreport.wdp.IPrivateStartView.IContextNode for more details.
      private final IPrivateStartView.IContextNode wdContext;
    A shortcut for <code>wdThis.wdGetAPI()</code>. </p>
    Represents the generic API of the generic Web Dynpro counterpart
    for this controller. </p>
      private final com.sap.tc.webdynpro.progmodel.api.IWDViewController wdControllerAPI;
    A shortcut for <code>wdThis.wdGetAPI().getComponent()</code>. </p>
    Represents the generic API of the Web Dynpro component this controller
    belongs to. Can be used to access the message manager, the window manager,
    to add/remove event handlers and so on. </p>
      private final com.sap.tc.webdynpro.progmodel.api.IWDComponent wdComponentAPI;
      public StartView(IPrivateStartView wdThis)
        this.wdThis = wdThis;
        this.wdContext = wdThis.wdGetContext();
        this.wdControllerAPI = wdThis.wdGetAPI();
        this.wdComponentAPI = wdThis.wdGetAPI().getComponent();
      //@@begin javadoc:wdDoInit()
      /** Hook method called to initialize controller. */
      //@@end
      public void wdDoInit()
        //@@begin wdDoInit()
    //          IWDNodeInfo node=wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,null,null);
    //         IPrivateStartView.INodeAElement ele=wdContext.createNodeAElement();
    //         wdContext.nodeNodeA().addElement(ele);
    //         IWDNodeInfo multiplenode=wdContext.nodeNodeA().getNodeInfo();
    //         IWDNodeInfo multipleinfo=multiplenode.addChild("MultiNode",null,true,true,false,false,false,true,null,null,null);
    //          multiplenode.addAttribute("roles", "ddic:com.sap.dictionary.string");
    //          multipleinfo.addAttribute("roles", "ddic:com.sap.dictionary.string");
    //          IWDNodeElement elem;
         //IWDNodeInfo node=wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,null,null);
         //node.addAttribute("BrandID");
        ResultSet rs=null;
        ResultSetMetaData rsmd=null;
        Connection con=null;
        PreparedStatement pst=null;
        String status="SELECT BrandMaster.BrandID,BrandMaster.BrandName FROM BrandMaster WHERE BrandMaster.BrandID=?";
        try{
             Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
             wdComponentAPI.getMessageManager().reportSuccess("Driver Loaded");
             con=DriverManager.getConnection("jdbc:odbc:Pankaj");
             wdComponentAPI.getMessageManager().reportSuccess("Connected");
             pst=con.prepareStatement(status);
             pst.setInt(1,1);
             rs=pst.executeQuery();
             wdComponentAPI.getMessageManager().reportSuccess("Query Fired");
             rsmd=rs.getMetaData();
             int ttlcolumns=rsmd.getColumnCount();
             wdComponentAPI.getMessageManager().reportSuccess("Populating Data1");
              IWDNodeInfo node=wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,null,null);
              //node.addAttribute("BrandID","BrandID:com.titan.retailauditreport");
              node.addAttribute("BrandID",);
             while(rs.next())
                  wdComponentAPI.getMessageManager().reportSuccess("Populating Data");
    //               IWDNode node1=wdContext.nodeNodeA().getChildNode("MultiNode",IWDNode.NO_SELECTION);
    //               IWDNodeElement elem=wdContext.nodeNodeA().createElement();
    //               node1.addElement(elem);
                   IWDNode node1=wdContext.getChildNode("DynamicNode",0);
                   IWDNodeElement ne1=node1.createElement();          
                   for(int i=1;i<=ttlcolumns;i++)
                        if(i==1)
                             //elem.getBrandID(rs.getString(i));
                             String s1=rs.getString(i);
                             ne1.getAttributeValue("BrandID"+s1);
                        else if(i==2)
                             //elem.getBrandName(rs.getString(i));
                             //String BN=setBrandName((rs.getString(i)));
                             String s2=rs.getString(i);
                             ne1.getAttributeValue("BrandName"+s2);
                   rs.close();
                   pst.close();
                   con.close();
                   wdComponentAPI.getMessageManager().reportSuccess("Resources Closed");
         catch(Exception e)
              wdComponentAPI.getMessageManager().reportException("Error  "+e,true);
        //@@end
      //@@begin javadoc:wdDoExit()
      /** Hook method called to clean up controller. */
      //@@end
      public void wdDoExit()
        //@@begin wdDoExit()
        //@@end
      //@@begin javadoc:wdDoModifyView
    Hook method called to modify a view just before rendering.
    This method conceptually belongs to the view itself, not to the
    controller (cf. MVC pattern).
    It is made static to discourage a way of programming that
    routinely stores references to UI elements in instance fields
    for access by the view controller's event handlers, and so on.
    The Web Dynpro programming model recommends that UI elements can
    only be accessed by code executed within the call to this hook method.
    @param wdThis Generated private interface of the view's controller, as
           provided by Web Dynpro. Provides access to the view controller's
           outgoing controller usages, etc.
    @param wdContext Generated interface of the view's context, as provided
           by Web Dynpro. Provides access to the view's data.
    @param view The view's generic API, as provided by Web Dynpro.
           Provides access to UI elements.
    @param firstTime Indicates whether the hook is called for the first time
           during the lifetime of the view.
      //@@end
      public static void wdDoModifyView(IPrivateStartView wdThis, IPrivateStartView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
        //@@begin wdDoModifyView
        if(firstTime)
              IWDTransparentContainer theGroup= (IWDTransparentContainer)view.getElement("RootUIElementContainer");
              theGroup.createLayout(com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDMatrixLayout.class);
              theGroup.destroyAllChildren();
              IWDUIElement uiElement = null;
             IWDCheckBox icb=(IWDCheckBox)view.createElement(IWDCheckBox.class,"CheckB");
              //IWDAttributeInfo info = wdContext.getNodeInfo().getChild("NodeA").getChild("MultiNode").getAttribute("roles");
              icb.bindChecked("DynamicNode.BrandID");
              uiElement=icb;
              theGroup.addChild(uiElement);
        //@@end
    The following code section can be used for any Java code that is
    not to be visible to other controllers/views or that contains constructs
    currently not supported directly by Web Dynpro (such as inner classes or
    member variables etc.). </p>
    Note: The content of this section is in no way managed/controlled
    by the Web Dynpro Designtime or the Web Dynpro Runtime.
      //@@begin others
      //@@end
    But iam not able to add attribute in the statement
    int ttlcolumns=rsmd.getColumnCount();
             wdComponentAPI.getMessageManager().reportSuccess("Populating Data1");
              IWDNodeInfo node=wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,null,null);
              //node.addAttribute("BrandID","BrandID:com.titan.retailauditreport");
              node.addAttribute("BrandID",);
    its throwing an error
    Error:com.sap.tc.webdynpro.services.exceptions.WDTypeNotFoundException: type Boolean not found
    Is that my database connectivity code ?
    Can anybody plz help me out?
    i
    Thanks and Regards
    Santosh Saraf

    Hi,
        It didnt work.So i changed my coding,Iam able to get checkbox.
    Here is my code
      public static void wdDoModifyView(IPrivateStartView wdThis, IPrivateStartView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
        //@@begin wdDoModifyView
        IWDMessageManager msgMngr=wdThis.wdGetAPI().getComponent().getMessageManager();
         if(firstTime)
              //IWDTransparentContainer theGroup= (IWDTransparentContainer)view.getElement("RootUIElementContainer");
              IWDTransparentContainer theGroup= (IWDTransparentContainer)view.getElement("TransparentContainer");
              theGroup.createLayout(com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDMatrixLayout.class);
              theGroup.destroyAllChildren();
              //IWDUIElement uiElement = null;
              //IWDUIElement uiElement1 = null;
              IWDUIElement uiElementnew = null;
              //IWDCheckBox icb2=(IWDCheckBox)view.createElement(IWDCheckBox.class,"CheckA");
              //IWDCheckBox icb1=(IWDCheckBox)view.createElement(IWDCheckBox.class,"CheckB");
              //icb1.setText("Checkbox1");
              //icb2.setText("Checkbox2");
              Connection con=null;
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con=DriverManager.getConnection("jdbc:odbc:Pankaj");
    Statement st=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    ResultSet rs=st.executeQuery("select * from BrandMaster");
    int count=0;
    while(rs.next())
         count++;
    msgMngr.reportSuccess(""+count);
    rs.beforeFirst();
    IWDNodeInfo node=wdContext.getNodeInfo().addChild("DynamicNode",null,true,true,false,false,false,true,null,null,null);
    node.addAttribute("BrandID","ddic:com.sap.dictionary.boolean");
    while(rs.next())
         IWDNode node1=wdContext.getChildNode("DynamicNode",0);
         IWDNodeElement ne1=node1.createElement();
         ne1.setAttributeValue("BrandID",new Boolean(true));
         //ne1.getAttributeValue("BrandID"+rs.getString(2));
         IWDCheckBox icbnew=(IWDCheckBox)view.createElement(IWDCheckBox.class,"Checknew");
         icbnew.setText(rs.getString(2));
         icbnew.bindChecked("DynamicNode.BrandID");
         uiElementnew=icbnew;
         theGroup.addChild(uiElementnew);
    msgMngr.reportSuccess(""+count);
    catch(Exception e)
              //IWDAttributeInfo info = wdContext.getNodeInfo().getChild("NodeA").getChild("MultiNode").getAttribute("roles");
    //          icb1.bindChecked("DynamicNode.BrandID");
    //          icb2.bindChecked("DynamicNode.BrandID");
    //          uiElement=icb1;
    //          uiElement1=icb2;
    //          theGroup.addChild(uiElement);
    //          theGroup.addChild(uiElement1);
              try
              {if(con!=null)
    con.close();
              catch(Exception e)
        //@@end
    The following code section can be used for any Java code that is
    not to be visible to other controllers/views or that contains constructs
    currently not supported directly by Web Dynpro (such as inner classes or
    member variables etc.). </p>
    Note: The content of this section is in no way managed/controlled
    by the Web Dynpro Designtime or the Web Dynpro Runtime.
      //@@begin others
      //@@end
    But now the problem is i need to have five dynamic checkboxes based on my tablebut iam getting only one check box with the first value of a column in a table(First Row).
    I want to display all the five rows,even if iam giving the rs.next in while loop.
    Here ia my table structure
    Master Table
    BrandID      BrandName
    1             abc
    2             def
    3             ghi
    4             jkl
    5             mno
    Iam getting the only one checkbox with abc as text,i want all the five rows checkbox.
    Plz help me out in this regard
    Thanks and Regards
    Santosh Saraf

  • Dynamic check box status android app

    Hello All,
                   I desperately need your help. I have created dynamically created check boxes depending on my selection for my android app using the following code snippet.
    for(var i:int=0 ; i<data.PromptText.length; i++)
                                                       chk = new CheckBox();
                                                       chk.label= data.PromptText.getItemAt(i);
                                                       chk.name=data.ResponsePromptID.getItemAt(i);
                                                       chk.addEventListener(MouseEvent.CLICK,ClickEvent);
                                                       chk.width = 1000;
                                                       chk.height = 50;
                                                       addElement(chk);
    Now after click on each check box, I need to check which check box of the list of check boxes created ?
    Please help me, this is driving me nuts.

    Hi,
    I see you have "addElement" rather than "addChild", so this is Flex, right?
    So there is an easier way to do that in any case, I think.
    For example, you could use CheckBox to create a custom renderer and then use your PromptText IList as dataProvider to a list, something like this:
    1. Your item renderer
    [code]
    <?xml version="1.0" encoding="utf-8"?>
    <s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                                            xmlns:s="library://ns.adobe.com/flex/spark"
                                            xmlns:mx="library://ns.adobe.com/flex/mx"
                                            autoDrawBackground="true"
                                             width="100%" mouseDown="itemrenderer1_mouseDownHandler(event)"
                                            >
    <fx:Script>
              <![CDATA[
                         * Override selected to provide bindable property
                         * as ItemRenderer.selected is not flagged as bindable.
                        override public function set selected(value:Boolean):void {
                                  super.selected = value;
                                  cbSelect = value;
                        [Bindable] protected var cbSelect:Boolean = false;
                         * Override to set ctrlKey and so to leverage Adobe's existing
                         * click to toggle functionality.
                        protected function itemrenderer1_mouseDownHandler(event:MouseEvent):void
                                  // ctrlKey is used by the component to toggle multiple selection
                                  // behaviour but, for checkbox, we want to treat all as a multiple
                                  // selection toggle, so set it to true.
                                  event.ctrlKey = true;
              ]]>
    </fx:Script>
              <!--
              Use CheckBox with selection tied to render selection
              and mouseEnabled=false to prevent conflicts with CheckBox
              own interactivity.
              -->
              <s:CheckBox label="{data}" selected="{cbSelect}"
                                             top="4" bottom="4" left="4" right="4"
                                            mouseEnabled="false" mouseChildren="false"
                                            />
    </s:ItemRenderer>
    [/code]
    2. The application that uses the item renderer:
    [code]
    <?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" minWidth="955" minHeight="600"
                                     layout="{vl}">
              <fx:Script>
                        <![CDATA[
                                  import flashx.textLayout.formats.VerticalAlign;
                                  import mx.collections.ArrayCollection;
                                  import mx.collections.Sort;
                                  import spark.components.CheckBox;
                                  import spark.events.IndexChangeEvent;
                                  import spark.layouts.VerticalLayout;
                                  private var promptBuilder:int = 0;
                                  private var idBuilder:int = 0;
                                  [Bindable] protected var PromptText:ArrayCollection = new ArrayCollection(
                                            ["Prompt text 1...","Second Prompt text...","Third prompt as text...","Prompt...","Prompt...","Prompt..."]
                                  [Bindable] protected var ResponsePromptID:ArrayCollection = new ArrayCollection(
                                            [++idBuilder,++idBuilder,++idBuilder,++idBuilder,++idBuilder,++idBuilder]
                                   * Change handler called whenever an item is selected or deselected.
                                  protected function list1_changeHandler(event:IndexChangeEvent):void
                                            displayCurrentSelection();
                                   * Simple demonstration of interrogating list to find what is and is
                                   * not selected.
                                  protected function displayCurrentSelection():void {
                                            var s:String = "STATUS OF LIST AT "+(new Date).toTimeString();
                                            // selectedIndices returns a list of the data indices of any selected items.
                                            var vs:Vector.<int> = listDisplay.selectedIndices;
                                            if(!vs.length) {
                                                      // If zero length, nothing selected
                                                      s += "\n(No selection.)";
                                            } else {
                                                      // If length, then we have work to do.
                                                      // 1. Indices populated in order of clicking, but we want them
                                                      // in order of display, so sort.
                                                      vs = vs.sort(sortOnInt);
                                                      // 2. Now loop through to see what is and isn't there.
                                                      for(var i:int=0;i<vs.length;i++) {
                                                                // Index is position in the data set that was selected
                                                                // This should match the parallel array of ids.
                                                                var index:int = vs[i];
                                                                s += "\nID:"+ResponsePromptID.getItemAt(index)+" = "+PromptText.getItemAt(index);
                                            // Populate the display variable.
                                            currentSelection = s;
                                            // Simple sort function.
                                            function sortOnInt(a:int,b:int):int {
                                                      return a>b ? 1 : -1;
                                  [Bindable] protected var currentSelection:String;
                        ]]>
              </fx:Script>
              <fx:Declarations>
                        <!-- Place non-visual elements (e.g., services, value objects) here -->
                        <s:VerticalLayout id="vl" paddingBottom="10" paddingTop="10" paddingLeft="10" paddingRight="10" />
              </fx:Declarations>
              <s:Label text="Click to toggle item selection" fontWeight="bold" />
              <s:List id="listDisplay"
                                  layout="{new VerticalLayout}" width="100%"
                                  labelField="label" dataProvider="{PromptText}"
                                  itemRenderer="CBItemRenderer"
                                  allowMultipleSelection="true"
                                  change="list1_changeHandler(event)"
                                  />
              <s:Label text="{currentSelection}" width="100%" />
    </s:Application>
    [/code]

Maybe you are looking for