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

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

  • 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.

  • LOV’s default format set to Check Box - Error

    1. I created a custom attribute and a custom Item type for a particular page group in 10g
    2. I created a LOV and used it in the custom attribute type
    3. I used the custom attribute type in the custom Item type that I created.
    4. While customizing the Item type, I set up the LOV’s (about 6 records) default format to Check Box.
    5. While adding the custom item type to a page, the custom attribute (which should be displayed as a Check Box) displays as shown below:
    &amp;amp;lt;INPUT TYPE=&amp;amp;quot;checkbox&amp;amp;quot; NAME=&amp;amp;quot;p_attribute&amp;amp;quot; VALUE=&amp;amp;quot;1&amp;amp;quot;&amp;amp;gt;1&amp;lt;BR&amp;gt; &amp;lt;INPUT TYPE=&amp;quot;checkbox&amp;quot; NAME=&amp;quot;p_attribute&amp;quot; VALUE=&amp;quot;2&amp;quot;&amp;gt;2&lt;BR&gt; &lt;INPUT TYPE=&quot;checkbox&quot; NAME=&quot;p_attribute&quot; VALUE=&quot;3&quot;&gt;3<BR> <INPUT TYPE="checkbox" NAME="p_attribute" VALUE="4">4<BR> <INPUT TYPE="checkbox" NAME="p_attribute" VALUE="5">5<BR> <INPUT TYPE="checkbox" NAME="p_attribute" VALUE="6">6
    6. I assume that the HTML is not rendered properly, or is it some sort of a bug?
    7. It displays properly if I select anything other than Check Box while setting up the LOV.
    8. I did test this in IE and Firefox and both displays the same thing.
    Any help or pointers would be greatly appreciated.
    Thanks!

    Update:
    I added 2 custom attributes to a custom item type. Both custom attributes are associated with separate LOV's. When I try to add the item, I get this following error and it's not allowing me to add the Item (custom item type from base URL):
    Error:
    Select a valid value from the LOV. (WWS-22207)
    Couldn't save attribute Version. (WWV-03005)
    Any help is appreciated.
    Thanks!

  • 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]

  • Dynamic check boxes

    Hi all,
    Is it possible to create check boxed dynamically?
    My exact rquirements is to create a page with a checkbox for each record displayed in a report in the page..
    And I dont know how many records would come down everytime..
    Thanks,
    Venkat

    Hi
    Do u want to display individual checkboxes for every individual record and the page can conain n number of records dynamically, if it is so then just create a tabular form and that
    should solve your problem.
    Hope it helps

  • How to get dynamic check box value in NW Mobile 7.1

    Hi,
    i have 5 rows it contains dropdown and checkbox in a row.when i click update button i need the values of checkbox.How to get?
    Regards,
    Kanagaraj.

    Hi Vidyadhar,
    I have dropdown in first page.based ondropdown value selected navigating to next page.In that i am using row repeater it has label,checkbox and dropdown.here i need to  know whether the check box is checked or not while clicking update button.
    Drow down value also not able to get.
    How to get Checkbox and dropdown values?
    can u provide some sample codes??
    Regards,
    Kanagaraj.

  • 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();

  • How to create check boxes dynamically in selection screen

    Hi Experts,
    I have a requirement of creating dynamic check boxes based on the number of records that are retrieved from a database table.
    Can you please suggest me how to achieve it.
    Regards
    RP.

    Hey RP,
    Try this way.
    REPORT ztest_program .
    DATA: it_data TYPE TABLE OF t001.
    DATA:check    TYPE char3.
    DATA:sy_index TYPE char2.
    DEFINE checkbox.
      parameters:&1 as checkbox.
    END-OF-DEFINITION.
    CHECKbox:c01,c02,c03,c04,c05,c06,c07,c08,c09,c10,
             c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,
             c21,c22,c23,c24,c25,c26,c27,c28,c29,c30,
             c31,c32,c33,c34,c35,c36,c37,c38,c39,c40.
    AT SELECTION-SCREEN OUTPUT.
      DESCRIBE TABLE it_data LINES sy-tfill.
      sy-tfill = 39. "This will be changed based on the itab records. I just hardcoded the value
      sy_index = 1.
      LOOP AT SCREEN.
        CONCATENATE 'C' sy_index INTO check.
        IF screen-name = check.
          IF sy_index GT sy-tfill.
            screen-active = '0'.
            MODIFY SCREEN.
            sy_index = sy_index + 1.
            CONTINUE.
          ENDIF.
          sy_index = sy_index + 1.
        ENDIF.
      ENDLOOP.
    Thanks
    Venkat.O

  • Oracle apex check box with update column

    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 crated 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

    I'm not really sure what your problem is but if you are trying to update/save data when a checkbox is checked I would use javascript to call an application process to do the update/save.
    /Daniel

  • How to Create Check Box in Dynamic Table

    Hi Friends,
    I've Created one Dynamic Table there i want to display 2 columns as Check Box.
    How to Add this check box as column cell variant.
    Looping the columns. In this One method SET_TABLE_CELL_EDITOR is ter. But i'm getting how to use this method. Kindly help in this Issue.
    Regards,
    jack.

    Hi upendra
    There are slight changes in the sivas code.Where is the data coming into the table.If its from a Model Node then iterate each element of the source node get that value compare and set the corresponding value in the element of the node binded to table.
    Create a boolean attribute "select" in the table node and bind it to checked property of the check box.
    for(int i=0;i<wdContext.node<tablenode>()..size();i++)
    if(wdContext.node<tablenode>().get<tablenode>ElementAt(i).select())
    wdContext.node<tablenode>().get<tablenode>ElementAt(i).set<yourattribute>(true);
    else
    wdContext.node<tablenode>().get<tablenode>ElementAt(i).set<yourattribute>(false);
    See the attribute is boolean so pass true or false as a values in setter methods.
    Regards
    Kalyan

  • Since updating to Firefox 3.6.15, I can no longer print coupons from SmartSource. The error message is that Java is not detected. The check box is longer showing in the Options/Content of this version of Firefox, so I can not enable it.

    # Question
    Since updating to Firefox 3.6.15, I can no longer print coupons from SmartSource. The error message is that Java is not detected. The check box is longer showing in the Options/Content of this version of Firefox, so I can not enable it.

    Same PC as I used to post the question. When I go to the "plug in check" page, it shows I am up to date and it is not disabled.
    Java(TM) Platform SE 6 U24
    Next Generation Java Plug-in 1.6.0_24 for Mozilla browsers 1.6.0.24

  • How to write the dynamic code for RadioGroupByKey and Check Boxes?

    Hi,
    Experts,
    I have created a WD ABAP application in that i have used RadioGroupByKey and CheckBox Ui elements but i want how to write the dynamic code to that i want to display male and female to RadioGroupByKey and 10  lables to check boxs.
    Please pass me some idea on it and send any documents on it .
    Thanks in advance ,
    Shabeer ahmed.

    Refer this for check box:
    Do check :
    bind_checked property is bind to a node with cardinality of 1:1
    CHECK_BOX_NODE <---node name
    -CHECK_BOX_VALUE <--attribute name of type wdy_boolean
    put this code under your WDDOMODIFYVIEW:
    DATA:
    lr_container TYPE REF TO cl_wd_uielement_container,
    lr_checkbox TYPE REF TO cl_wd_checkbox.
    get a pointer to the RootUIElementContainer
    lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    lr_checkbox = cl_wd_checkbox=>new_checkbox(
    text = 'WD_Processor'
    bind_checked = 'CHECK_BOX_NODE.CHECK_BOX_VALUE'
    view = view ).
    cl_wd_matrix_data=>new_matrix_data( element = lr_checkbox ).
    lr_container->add_child( lr_checkbox ).
    Refer this for Radiobutton :
    dynamic radio button in web dynpro abao
    Edited by: Saurav Mago on Jul 17, 2009 10:43 PM

Maybe you are looking for

  • No updatable devices found after firmware update

    Unfortunately I didn't check here before doing the latest updates. I dl'd the following on the night of July 1: 2007-07-01 01:49:08 -0400: Installed "SuperDrive Firmware Update" (2.1) 2007-07-01 01:49:31 -0400: Installed "iTunes" (7.3) 2007-07-01 01:

  • Problem with skype

    My nokia x202 is able to download skype,but when i sign in it says "skype is unable to connet your phone network.please suggest how to run skype on my phone

  • MSI Gaming GTX 970 4GD5 OC BIOS request

    Hello, my S/N: 602-V317-01SB1409073268 Current BIOS according to MSI Live Update : NV317MH.210 Is there any later versions for my card? Thanks

  • HT6114 Install problem

    After installing the most recent Mavericks upgrade (10.9.2) I now have a big gray question mark next to the Apple icon (@) on my dock.  When I move my mouse over the question mark it says:  CF_INTRO_6_LANGUAGE.  I don't know what this means or what t

  • Apache 2.0.59 - cannot read certificate revocation list

    Hello, i've installed a thawte SSL certificate on a Netware 6.5 SP7 server with apache 2.0.59. If i want to validate the certificate with C1, i get the following error "cannot read certificate revocation list" ! I've found in a forum task, that this