Checkbox using ValueChangeListener

Hi,
I have a table and one column having values 'Y','N'.so in my jsp page i drag as adf table and one column as boolean checkbox column it contains 'y','N' values..so i want that if i select my column name checkbox it should select all the row..if i deselect it should deselect all the row ...please tell me that how to create that ....
for that i created ValueChangeListener but its not working...can you tell me the solution

Check this article from ADF code corner which discusses about the use-case:
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/99-checkbox-for-delete-in-table-1539659.pdf
Thanks,
Navaneeth

Similar Messages

  • In the old Numbers I could change the colour of a checkbox using rules - I cannot seem to do this in new Numbers 2013?

    In the old Numbers I could change the colour of a checkbox using rules - I cannot seem to do this in new Numbers 2013?
    I have an old Numbers sheet where I could make the checkbox Cell go Green when ticking "Equal to" TRUE. When I open the old sheet it into new iWork it functions correctly. But I am unable to copy or paste the rule - nor recreate it.
    Any suggestions on how to create a Conditional checkbox cell that goes green once ticked would be most apprecicated.
    Thanks - Steve

    Numbers 3.0 is missing the logic-based "equal to TRUE" or "equal to FALSE" conditions for conditional formatting.  The replacement is text based: "text is TRUE" or "text is FALSE".  You can apply these rules to cells formatted as checkboxes.

  • Capturing data from a select many checkbox using adf components (11g)

    Hi
    I am new to this technology. Can anybody tell me how to capture the data selected in a checkbox
    I have created the checkbox(Af:selectmanycheckbox) using a webservice.
    Thanks,
    Tim

    Hi
    @Jonas : Thanks for the reply
    In the link its setting the values using a backing bean method lyk this
    <af:selectManyCheckbox label="Locations" id="smc1"
    value="#{sessionScope.weatherBean.locationsSelected}">
    <f:selectItems value="#{sessionScope.weatherBean.locationSelectItems}"
    id="si1"/>
    </af:selectManyCheckbox>
    but in my case am populating the values in the checkbox using a webservice
    <af:selectManyCheckbox value="#{bindings.result.inputValue}" --- result is the list binding while adding a webservice to the data control
    label="result" id="smc1">
    <f:selectItems value="#{bindings.result.items}" id="si1"/>
    </af:selectManyCheckbox>
    So for now am getting values like result red,blue green
    now if i want to select red and blue and display it in a text field on the click of a command button.*pls guide me how to save the selected value and display multiple values in a input/outpt text field*

  • Having problems reading checkbox using $(item).value

    Is this the correct way to get the value of a checkbox using javascript
    var rem = 'P525_REMOVE_TEST';
    var isRem = $x(rem).value;
    alert(isRem);
    The checkbox return value is 'YES'
    I am getting undefined. What am I doing wrong?
    Howard

    Hi,
    Check box will return data only if it is checked otherwise it will return null.
    Put this code in "HTML Form Element Attributes" of your check box
    onchange="if (this.checked ) { alert(this.value);} else {alert('not checked')};"Regards,
    Manish

  • How to create a list from checkboxes using Numbers on iPad?

    I am creating a guest list using Numbers foriPad. First sheet is a list of invited people with checkboxes (Yes/No/still to reply) in next column. In the next sheet i want create a list of everyone that has replied yes.
    I have tried using the if statement, but I dont want any blank cells.
    -IF(A2;TRUE;A1) gives name in A1 if box is checked, but gives 0 or something else if i specify. But i want to automatically start on next row to avoid blank or 0-
    Example:
    David   V
    Lisa.     V
    Derek 
    Brad.   V
    Paul.
    John
    The separate list in another sheet should then be:
    David
    Lisa
    Brad
    Any help will be appreciated.

    Can you use the the reorganize panel to sort the list?
    Idon't have Numbers on the iOS so I am not sure.  You are posting in the forum for Numbers on Mac OS X.
    you can also add a new column (let's say C)
    where
    C1=if(A1, A1, "")
    this will include the name from column A  when the checkbox in B is checked.  You can then copy column C and paste values using the menu item (Edit > Paste Values, or equivalent in iOS... not sure what it is)

  • Dynamic action on checkbox using jQuery selectors

    Aim: Have a classic report with a checkbox for each record that fires a dynamic action. I'd like to source the relevant ID/value within Javascript (ultimately PL/SQL)
    Consider a classic report using the following query
    SELECT label
    ,apex_item.checkbox
      (p_idx   => 15 -- f42
      ,p_value => id
      ,p_attributes => 'id="f15_'||id||'" class="xyz"'
      ) chk
    FROM   my_tableDefine a dynamic action with
    Event: Click
    Selection type: jQuery selector
    jQuery selector: .xyz
    No condition
    Scope:Bind
    I have an action executing javascript
    var me = this.triggeringElement;
    console.log('me:'||me);
    console.log('name:'||me.attr('name') );
    console.log('id:'||me.attr('id') );
    console.log('value:'||me.prop('val'));Affected elements Selection type: Triggering element
    When I run the page and check a box, the DA fires, but all output shown in the console log is blank.
    I've tried copious variations to get this right, such as using $(this.triggeringElement)
    These pages make me feel confident I have the syntax right
    http://stackoverflow.com/questions/12038392/oracle-apex-checkbox-to-manipulate-other-values-when-checked-unchecked
    http://iadviseblog.wordpress.com/2011/08/24/get-triggering-element-in-da/
    But my values are still null?! Anyone know what I've missed?
    Apex 4.1.1
    Scott

    var me = this.triggeringElement;
    console.log('me:'||me);
    console.log('name:'||me.attr('name') );
    console.log('id:'||me.attr('id') );
    console.log('value:'||me.prop('val'));<ul>
    <li>Concatenation in javascript is with +* and not *||* (which means OR)</li>
    <li>Also, this.triggeringElement is a reference to the DOM element, it is not a jQuery object. So wrapping it in $() is required when you wish to access properties through jQuery.</li>
    <li>.prop('val') won't work. You need to check for the existence of a property-line attribute, which in case of a checkbox could be "checked".</li>
    <li>dynamic action on a report: use scope Live to prevent functionality from working when the report is refreshed/paginated</li>
    </ul>
    var me = $(this.triggeringElement);
    console.log('me:'+me);
    console.log('name:'+me.attr('name') );
    console.log('id:'+me.attr('id') );
    console.log('value:'+me.prop('checked'));

  • Checking Previously Selected Checkboxes using apex_item.checkbox API

    Hello everyone,
    Before I get into the exact nature of my 'problem at hand', I feel it would be a good idea to give you readers a little background info regarding what I'm working on.
    I'm designing a page in my application (a Targeted Email Communications System) entitled the "Impacted Services Selection Screen." In a nutshell, this page will offer multiple check boxes that allow them to select/deselect the applications they wish to be notified about. Additionally, for each service, the user has the option to select the option to receive "planned" outage notifications, "unplanned" outage notifications, or both.
    I'm working with a report region where I'm querying a table called "TEC_APPS" to populate my checkboxes. This table holds three columns which are:
    (1) Primary Key APP_ID: Numerical identifier for each selectable service.
    (2) APP_NAME: Name of the application itself (i.e. Banner INB, Oracle Collaboration Suite, etc.)
    (3) ENTRY_TYPE: Type of entry within the table. I have four categories: (1) Planned Outage Notification, (2) Unplanned Outage Notification, (3) Horizontal Rule Formatting, (4) Title
    The reason for the "ENTRY_TYPE" column is primarily to format the report so it doesn't look like a "table with a bunch of check boxes inside of it".
    Here's the sql query for my report region:
    select APP_NAME,ENTRY_TYPE,APP_ID,
    decode(ENTRY_TYPE,
         'Planned Outage Notification',apex_item.checkbox(1,APP_ID) || ENTRY_TYPE,
         'Unplanned Outage Notification',apex_item.checkbox(1,APP_ID) || ENTRY_TYPE,
         'Title',APP_NAME,
         'Horizontal Rule Formatting','<hr size="6" width = "100%" color="#898A8A">')as result
    from TEC_APPS
    order by APP_ID;basically, this query generates check boxes for ENTRY_TYPEs of Planned/Unplanned Outage notification, Formatted Title Headers for an ENTRY_TYPE of a title, and an html Horizontal Rule for ENTRY_TYPES of horizontal rule formatting (the reason being my boss's specifications required there to be a formatted line that separates each check box group by context). That way, the groups will look like (note '[]' are meant to represent the check boxes):
    BANNER INB
    [ ] Planned Outage Notification
    [ ] Unplanned Outage Notification
    PORTAL
    [ ] Planned Outage Notification
    [ ] Unplanned Outage Notification
    etc....
    Additionally, I have an after submit process which uses the apex global array to store the selected check boxes and perform an insert into a different table called "TEC_SERVICES", which has the columns:
    (1) PRIMARY_KEY SERVICE_ID: Numerical Identifier for each specific service requested for notification.
    (2) SUB_ID ("subscriber id"): Numerical Identifier for each person using this application
    (3) APP_ID: Foreign key reference to "TEC_APPS" which holds information regarding which application the user has selected for each SERVICE_ID
    Here's the code for the process:
    DECLARE
       l_arrayMark  NUMBER;
       CURSOR c_id_check (aMark IN NUMBER) IS
       SELECT service_id,sub_id,app_id
       FROM tec_services
       WHERE sub_id = :p4_sub_id
       AND app_id = aMark;
       r_id_check c_id_check%ROWTYPE;
    BEGIN
    FOR i in 1..APEX_APPLICATION.G_F01.count
    LOOP
       BEGIN
          l_arrayMark := to_number(APEX_APPLICATION.G_F01(i));
        OPEN c_id_check(l_arrayMark);
        LOOP
          FETCH c_id_check into r_id_check;
          IF c_id_check%NOTFOUND THEN
            insert into "TEC_SERVICES"
            ( "SERVICE_ID",
              "SUB_ID",
              "APP_ID"    )
            values
            ( TEC_SERVICES_SEQ.nextval,
              :P4_SUB_ID,
              to_number(APEX_APPLICATION.G_F01(i)));
            EXIT;
          ELSIF c_id_check%found THEN
            EXIT;
          END IF;
        END LOOP;
        CLOSE c_id_check;
        EXCEPTION
        WHEN DUP_VAL_ON_INDEX
        THEN NULL;
        END;
    END LOOP;
    END;The sub-block loop basically checks to see if the user already has a record for that APP_ID, and if so exits the loop. I threw the unique key EXCEPTION in at the end just to be safe. I'm new to sql and pl/sql so I'm still trying to learn this stuff. I have come pretty far since I first started about 5 weeks ago.
    Anyways, here's my problem:
    I need to create a process that queries my TEC_SERVICES table to see if the person using my application already has a subscription for the "APP_ID" each checkbox in my report represents. If they do, the page is supposed to load with that/those checkbox(s) already checked. My problem is I'm not quite sure how to update those checkbox values. I have created a "before header" process that aimed at doing this, but is not working. Here is the "rough draft" of the code:
    DECLARE
       l_arrayMark NUMBER;
       CURSOR c_id_find (aMark IN NUMBER)IS
       SELECT sub_id, app_id
       FROM tec_services
       WHERE sub_id = :p4_sub_id
       AND app_id = aMark;
       r_id_find c_id_find%rowtype;
    BEGIN
    if APEX_APPLICATION.G_F01.count = 0 THEN return;
    end if;
    FOR i in 1..APEX_APPLICATION.G_F01.count
    LOOP
        BEGIN
        l_arrayMark := to_number(APEX_APPLICATION.G_F01(i));
        OPEN c_id_find(l_arrayMark);
        LOOP
        FETCH c_id_find INTO r_id_find;
        IF c_id_find%found THEN
        apex_util.set_session_state(apex_item.G_F01,'CHECKED');
        -- ** This is where I'm getting mixed up...this is basically trying to say, "if the record for this checkbox already exists for this person, then show this checkbox as selected."
        -- ** I just don't know how I am supposed to do that.  Maybe something similar, but more along the lines of: UPDATE apex_application.g_f01(p_checked_values => 'CHECKED')
        ELSIF c_id_find%notfound THEN
        exit;
        END IF;
        END LOOP;
        CLOSE c_id_find;
        END;
    END LOOP;
    END;I guess I just really don't know how to do this, and it's "Grinding my gears."
    Any help is much appreciated.
    Thank you all,
    Eric
    *** NOTE *** This is my first post ever in the oracle forums. I noticed that even when I include spaces and indentation in my code/post text, it doesn't display in the actual thread itself. Anyone know the markup to insert such things...or like an &nbsp?
    Edited by: user11685190 on Sep 28, 2009 2:09 PM
    Edited by: user11685190 on Sep 29, 2009 6:32 AM

    Gus,
    1. Yeah...I tend to get carried away sometimes. This one's been killing me though b/c I've got a deadline of four weeks left to do this thing and I still have three somewhat "beastly" pages to write before it's completely ready to be tested and considered for production. On top of that, I'm pretty much learning a lot of this stuff as I go.
    2. The first two loops I showed you (Query for the checkbox report, On-Submit process to read checkboxes and insert table data) are fully functional. The problem is, I've worked with "checkbox items" but not so much with the apex API for Report Checkboxes "apex_item.checkbox(p_id, p_val, etc.)). I don't know "how" I could write a pl sql process that queries the table when the page loads to check the checkboxes....addionally, I don't know what commands to use to fill these boxes b/c I've found somewhat unrelated information by conducting web research. Code-wise, my problem is I don't know whether to use:
    UPDATE apex_application.g_f01(p_checked_values => 'CHECKED') ** OR ** if you'd instead use something like 'set available flag = 'Y'' The real problem is I just don't know how I'd do it.
    ...but, on second hand, I do find light in what you said about the "before header" process. If you look at the plsql block, the cursor I'm using to "see if that person already has subscribed to the service
    represented by a checkbox," I'm referencing the page item :P4_SUB_ID. Since this is a before header process...it is running (i think) before the :p4_sub_id item loads...so the cursor is most likely returning as 'not found,' therefore it
    does nothing. However, the source for the :P4_SUB_ID item says to use the source only when the value in session state is null. Because of this, I don't know if my above thoughts are correct.
    Thank you for your thoughts and posting that link...I'll look into it a bit further.
    Oh yeah...and thanks for the [/*code] tip...that looks a ton better.
    Eric                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • JSF: Problem with checkboxes using Tomcat

    Hello,
    I m using Java Sun Creator and I�ve noticed a very strange behavior of checkboxes while running my project with Tomcat (I tried 5.5 and 6.0).
    On my JSP I have a tabSet component with 3 tabs. the second tab (the first tab in order is selected per default ) displays some boolean values using checkboxes. I set these values using SessionBean properties in an action method that navigates me to the page with the tabSet component. When deploying the application with JSC the values are correct after loading the page and when I select the second tab after that.
    When I start the application with Tomcat, the values are correct after loading the page (I�ve checked it displaying the values in a messageGroup), but when I select the second tab, which should show me these selected checkboxes, all of them and even the session bean properties have the value "false" (I see the result in the messageGroup too)?! I had to include my code to the prerender method of the tabSet-page to get the correct values but that has another bad side-effects!
    Does anybody have an explanation for this issue?

    More info,
    we add all drivers we use for the different databases we support, in this case we use classes12.jar and postgresql-8.2-504.jdbc3.jar
    I just let u know that becouse maybe exists conflicts between these two libraries. Could it be?
    thanks

  • LOV value changes to first in list when using valueChangeListener

    All,
    I'm having a problem using a valueChangeListener with an af:inputListOfValues. The listener is firing properly but unless
    I use the search popup to select the value it is changing the value back to the first row in the list.
    If I try to type in a value it's just going to be changed back to the first row in the list.
    I'm sure there's something simple that I'm missing. Any ideas? Thanks.
    I am using JDev 11.1.2.2.0
    Below is how the list is defined and the Java behind the listener:
    <af:inputListOfValues id="workCenterEntryId"
                             popupTitle="Search and Select: #{bindings.WorkCenterEntry.hints.label}"
                             value="#{bindings.WorkCenterEntry.inputValue}"
                             label="#{bindings.WorkCenterEntry.hints.label}"
                             model="#{bindings.WorkCenterEntry.listOfValuesModel}"
                             required="#{bindings.WorkCenterEntry.hints.mandatory}"
                             columns="#{bindings.WorkCenterEntry.hints.displayWidth}"
                             shortDesc="#{bindings.WorkCenterEntry.hints.tooltip}"
                             binding="#{pageFlowScope.PalletBuildBackingBean.workCenterEntryId}" editable="always"
                             simple="false"
                             valueChangeListener="#{pageFlowScope.PalletBuildBackingBean.changeWorkCenter}" autoComplete="on" autoSubmit="true">
    <f:validator binding="#{bindings.WorkCenterEntry.validator}"/>
    <af:autoSuggestBehavior suggestedItems="#{bindings.WorkCenterEntry.suggestedItems}"/>
    </af:inputListOfValues>
    public void changeWorkCenter(ValueChangeEvent valueChangeEvent) {
         FacesContext facesContext = FacesContext.getCurrentInstance();
         valueChangeEvent.getComponent().processUpdates(facesContext.getCurrentInstance());
         //More code to do other stuff
    }

    Thanks for your response.
    Here's what I tried:
    1) I removed the value change listener and the problem still occurred.
    2) I set AutoSubmit to false and the problem stopped.

  • Multiple CHECKBOX Using Select Query in htmldb.item API

    Hi,
    I have a requirement where I need to create a Record using HTMLDB_APPLICATION.CHECKBOX ..but having multiple values(around 8) using the Select statement.
    I tried the STATIC thing, but it shows only 2 values.
    Is this possible ?
    How ?
    Thanks
    Sandeep

    hey sandeep--
    i'm not sure at all what you're asking here. if this is still an issue for you, please restate it much more clearly.
    thanks,
    raj
    ps-there is no htmldb_application.checkbox.

  • How to uncheck a checkbox using Screen Variants?

    Hi Masters!
    Anybody knows how to uncheck a checkbox that is already checked by default?
    I'm trying to do this using screen variants. I uncheck the checkbox and save the value (I also tried filling other values there like 'a', space, etc. and it didn't work), but at runtime it always shows the checkbox checked.
    At the same transaction there is a unchecked checkbox by default witch I can check it with a screen variant, but somehow I can't do the other way around...
    Any suggestions?
    Many thanks in advance,
    José Omar

    I checked the code and found something interesting. The
    variable I'm trying to uncheck is GV_WITH_CONTACT_PERSON.
    It's declaration:
    DATA: GV_WITH_CONTACT_PERSON TYPE XFELD VALUE 'X'.
    At the initialization of the program (at the first screen module):
    PROCESS BEFORE OUTPUT.
    MODULE INITIAL_STATE.
    And inside the MODULE INITIAL_STATE there is also:
    MOVE 'X' TO GV_WITH_CONTACT_PERSON.
    So there are places in the code that the checkbox is checked.
    Now we get another problem. I don't now when the values set at a screen variant are inserted in the screen. Is it possible that the code itself is overwriting the value set with a screen variant? Or is this not possible at this point in the code?
    Many Thanks,
    José Omar

  • HANDLING CHECKBOXES USING JSP AND EJB

    HI SDN MEMBERS,I AM LEARNING HOW TO CODE IN J2EE.I DISPLAY A FORM WITH CHECKBOXES AND SOME ITEMS BY THE SIDES.NOW THESE ITEMS CAME FROM THE DATABASE BUT ON DISPLAY THE USER SHLD CHECK HIS CHOICE CHECKBOXES THEN SUBMIT.PLS HOW DO I GO ABOUT THIS?

    You need to put the checkboxes and submit button in a <form> tag.
    However, I suggest you read a book on JSP (or read a free comprehensive on-line tutorial) since there is a lot to learn that having a few questions answered in these forums can't begin to cover.
    Also, why are you using EJB? That's an advanced topic and I suggest you use something simpler such as JSP and servlets.

  • Displaying checkbox using Class interface

    Hi,
    Is it possible to display a checkbox in top-of-page for an ALV report using the class interface "cl_dd_document"?
    Note: I have already tried the method "add_icon" but it doesnt seem to be working. So the procedure along with sample coding would be more helpful.

    To get the configuration for one particular service from ConfigurationService:
    String PID_MQTT_DATA_TRANSPORT = "org.eclipse.kura.core.data.transport.mqtt.MqttDataTransport";
    ComponentConfiguration mqttConfiguration = m_configurationService.getComponentConfiguration(PID_MQTT_DATA_TRANSPORT);
    Map<String,Object> mqttConfigurationProperties = mqttConfiguration.getConfigurationProperties();
    This will get the MqttDataTransportService configuration, you can ask the configuration of any service registered providing its PID.
    This means you need the ConfigurationService available in your service. Just ask OSGi to inject it.
    public class YourService implements ConfigurableComponent {
    private ConfigurationService m_configurationService;
    public void setConfigurationService(ConfigurationService configurationService) {
    m_configurationService = configurationService;
    public void unsetConfigurationService(ConfigurationService configurationService) {
    m_configurationService = null;
    // Your methods here ...
    In your OSGI-INF/yourservice.xml
    <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
    name="your.Service"
    activate="activate"
    deactivate="deactivate"
    enabled="true"
    immediate="true"
    configuration-policy="ignore">
    <implementation class="your.ServiceImpl"/>
    <property name="service.pid" type="String" value="your.Service"/>
    <service>
    <provide interface="your.Service"/>
    </service>
    <reference name="ConfigurationService"
    policy="static"
    bind="setConfigurationService"
    unbind="unsetConfigurationService"
    cardinality="1..1"
    interface="org.eclipse.kura.configuration.ConfigurationService"/>
    </scr:component>
    Hope this small example will be helpful.

  • Toggle checkbox using the keyboard

    Is there any way to toggle a checkbox on/off in System Preferences -> Keyboard & Mouse -> Keyboard Shortcuts using the keyboard? It's the one that has the column title "on" for all the keyboard shortcuts. Without touching the mouse try to check/uncheck the "Save picture of screen as a file" option.
    I've tried just about every key combination I can think of so unless I've inadvertently remapped the key I'm assuming you can't.
    If indeed it's not possible, I'm sure the irony will not escape you! Hahahah.
    Thanks,
    Oz
    MacBook Pro   Mac OS X (10.4.9)  

    Uninstall the Ask toolbar and it should work again. There is a compatibility issue with the Ask toolbar and Firefox that prevents new tabs from being opened.
    There are a couple of places to check for the Ask toolbar:
    * Check the Windows Control panel for the Ask Toolbar - http://about.ask.com/apn/toolbar/docs/default/faq/en/ff/index.html#na4
    * Also check your list of extensions, you may be able to uninstall it from there - https://support.mozilla.com/kb/Uninstalling+add-ons

  • Referencing checkboxes using strings of their IDs

    I'm sure this is a really easy one (im a beginner)...
    I'm creating checkboxes at runtime and assigning IDs in the format "checkBox_1", "checkBox_2" etc.
    I'm also pushing these strings to an array, so I have a list of all the checkboxes I have made (across multiple NavigationContent containers)
    I need to loop through the array and convert the string into a valid checkbox reference and grab the label of that checkbox.
    What I'm struggling with is that the following throws an error
    var myCheckBox:CheckBox;
    myCheckBox = CheckBox("checkBox_1");
    trace(myCheckBox.label);
    and myCheckBox = "checkBox_1" as CheckBox; doesnt work
    I'm missing something really basic here

    hi,
    Pushing the object onto the array is the better option but you can also reference the object by name, either way you need to typecast any operations on the checkbox , If you decide to use the checkbox's name you need to retreive the displayobject first then you can use it as per the call to set the selected value shown below.
    David.
    protected function application1_creationCompleteHandler(event:FlexEvent):void
    for (var i:int=1; i < 11;i++)
    var cb:CheckBox = new CheckBox();
    cb.x=10;
    cb.y=25*i+10;
    cb.selected = false;
    cb.label = "Check no:"+String(i);
    cbCanvas.addChild(cb);
    arr.push(cb.name);
    //arr.push(cb);
    private function setCheckBoxes(): void
    var tmpCB:DisplayObject;
    for (var i:int=0; i <arr.length;i++)
    tmpCB = cbCanvas.getChildByName(arr[i]);
    (tmpCB as CheckBox).selected=true;
    //(arr[i] as CheckBox).selected=true;

Maybe you are looking for