Check box in flex

I have a check box and a label related with it which I want to appear when the user checks the check box....
<mx:Label 
x="10" y="76" text="Information" fontWeight="bold" fontSize="11"/>
<mx:Label x="366" y="76" text="Record - New/Existing" fontWeight="bold" fontSize="11"/>  
<mx:Label x="578" y="76" text="Date Recorded - New" fontWeight="bold" fontSize="11"/>  
<mx:Label x="10" y="105" text="New Record Description" fontSize="11" fontWeight="bold"/> 
<mx:CheckBox 
x="10" y="495" label="New Record" fontSize="11"/>
//// This is the part which I want it to appear if user check the box...
//From here
<mx:Label x="10" y="200" text="List Records " fontWeight="bold" fontSize="11"/>  
<mx:Label x="10" y="227" text="Access Code Procedures" fontSize="11" fontWeight="bold"/>
<mx:TextInput 
x="0" y="215" width="53" fontSize="11"/> 
<mx:TextInput x="0" y="245" width="53" fontSize="11"/> 
//Till here
<mx:Label x="366" y="76" text="Record - New/Existing" fontWeight="bold" fontSize="11"/>   
<mx:Label x="578" y="76" text="Date Recorded - Existing" fontWeight="bold" fontSize="11"/>  
<mx:Label x="10" y="105" text="Existing Record Description" fontSize="11" fontWeight="bold"/> 

The following is the quick and dirty way.  You might want to use states instead.
<mx:CheckBox id="cb"
x="10" y="495" label="New Record" fontSize="11"/>
//// This is the part which I want it to appear if user check the box...
//From here
<mx:Label x="10" y="200" text="List Records " fontWeight="bold" fontSize="11" visible="{cb.selected}" includeInLayout="{cb.selected"}/> 
<mx:Label x="10" y="227" text="Access Code Procedures" fontSize="11" fontWeight="bold" visible="{cb.selected}" includeInLayout="{cb.selected"}/>
<mx:TextInput
x="0" y="215" width="53" fontSize="11" visible="{cb.selected}" includeInLayout="{cb.selected"}/>
<mx:TextInput x="0" y="245" width="53" fontSize="11" visible="{cb.selected}" includeInLayout="{cb.selected"}/>
//Till here
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

Similar Messages

  • Check boxes in Data grid

    Hi,
    I have check boxes in data grid, using action script how do i get the values of check boxes that were selected ?
    Can anybody guide me here.
    <mx:DataGrid id="targetBaseAdd" width="100%" height="100%" dataProvider="
    {Application.application.ccModel.initializeBusinessUnitData.initializeBusinessUnit.baseArra y}">
     <mx:columns>
     <mx:DataGridColumn headerText="" width="20">
     <mx:itemRenderer>
     <mx:Component>
     <mx:HBox width="100%">
                    <mx:CheckBox horizontalCenter="0"/>  </mx:HBox>
     </mx:Component>
     </mx:itemRenderer>
     </mx:DataGridColumn>
     <mx:DataGridColumn headerText="Base" labelFunction="baseTargetList"/>
     </mx:columns>  
    </mx:DataGrid>
    Thank You,
    Anu.
    </mx:HBox>
     </mx:Component>
     </mx:itemRenderer>
     </mx:DataGridColumn>
     <mx:DataGridColumn headerText="Base" labelFunction="baseTargetList"/>
     </mx:columns>  
    </mx:DataGrid>
    Thank You,
    Anu.

    refer following examples:
    http://blog.flexmonkeypatches.com/2007/11/06/datagrid-checkbox-itemeditor/
    http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/Flex/Q_23237167.ht ml

  • Need to detect when an item is clicked in a combo box in flex 3

    Hello
    I am having a check box and a combo box whenever any selection is made in combo box (current selection may be same as previous selection), I need to select the check box.
    By default the 1st item in combo box is selected and check box is unselected. Now I want that while 1st item is clicked in combo box (although it is selected) , the check box must be selected.
    I have currently used the change event of combo box to do my task. But it is not working if I click on same item as selected item in combo box.
    Also, I thought to use close event of combo box, but that event dispatches in 4 situations out of which I can distinguish only 1 situation from DropDownEvent(for close).
    Please help me regarding this.
    I am using flex sdk 3.5
    Thanks in advance.

    You can use the Close Event to distinguish it.
    To pull out which item has been selected in the combo box, you use the code (in as3)
    ComboBox(event.target).selectedItem.label
    and through the the use of an if statement
    if (ComboBox(event.target).selectedItem.label == "labelName")
    you can distinguish the single situation from the others.

  • Check Box in Datagrid

    Hi.. I want to use a Check Box inside a datagrid , for that i used the following code and then i am getting the below shown error.. Please help me for getting this error corrected...
    <mx:DataGridColumn headerText="Copy"  width="8" textAlign="center"   color="red">
    <mx:itemRenderer>
    <mx:Component>
    <mx:CheckBox/>
    </mx:Component>
    </mx:itemRenderer>
    </mx:DataGridColumn>
    </mx:columns>
    </mx:DataGrid>
    Error: Could not resolve <mx:Component> to a component implementation.
        regards...
         Syam

    Maybe use one of the examples on my blog.
    However, if you are using Flex 4, mx:Component is now fx:Component
    Alex Harui
    Flex SDK Team
    Adobe System, Inc.
    http://blogs.adobe.com/aharui

  • Line of text in two rows in a check box

    Greets
    Ive been working in a poll, and i use a check box in some part, but de question its to long to put it in
    i have the same problem with the text box, but with the command &#13; it can be possible to put a long question in two rows, but that command line doesnt work with check boxes
    there are any form to make a long question of one row, into a two row question in check box component??

    There is a multiline button example you can adapt for checkboxes on my blog.
    Alex Harui
    Flex SDK Team
    Adobe System, Inc.
    http://blogs.adobe.com/aharui

  • How to make a check box non-updatable through personalization

    Hi All,
    I have a requirement where I need to make check box read only in a case when user select some values from the drop down list box. Is it possible through personalization?
    For example if there is a list box which contains 5 values and for three valuse one check box needs to be make as read only and where as for remaining it can be checked/un-checked.
    Please let me know if this can be acheived through personalization.
    Thanks,
    Sandeep

    If there is some event (e.g. fire partial action) present on selection of any value the drop down, then you can achive this using java script.
    Create a raw text item and in the text property put java script to handle this case.
    For sample java script code refer
    How to set particular segment value of key flex field in Controller
    -Anand

  • Spark check box on FlexEvent.CHANGE

    Spark check box does not check/uncheck itself when the FlexEvent.CHANGE is fired on its own instance. Is it a bug in the flex frame work? but when the same is done on the mx;Checkbox it works properly.
    i'm using flashbuilder 4.0 standalone with with 4.0.1 SDK in it.
    eg:
    checkbox.dispatchEvent(new Event(Event.CHANGE)); // this is for spark /mx - for mx the checkbox will
                                                 //uncheck/check when this event is fired
                                                 // for spark this event is not captured

    I don't believe this should have had this behavior with the MX CheckBox.  The change event should fire after the selected property is changed, but, dispatching it should not cause the selected property to change.
    Can you describe why you would want the change event to update whether the CheckBox is selected or not?
    Joan

  • Check box label on Top

    In flex 4 whats the property to put the check box label
    above the check box

    I don't think this is possible given that the help text for Label alignment says
    Labels can be displayed above, below or to the left of the item
    "right" is conspicuously absent
    Wonder why?

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

  • How to print Check Box in smartform

    HI,
      How to print check box in smartforms. I am using Include Sap Symbol but in the print it is coming as #. Do we need to do any setting like we do for barcode?
    Thanks
    Raghavendra

    hi,
    u can print a check box in different ways.. by inserting symbols and making window as check box..
    once go through the thread u will get to k now differnt ways
    putting checkboxes in smartform?
    Please Close this thread.. when u r problem is solved. Reward all Helpful answers
    Regards
    Naresh Reddy K

  • How to select One Check Box at a time

    Dear All
    I have 10 records in details blok and also I have 10 check boxes .
    I want user can only check one check box at a time .
    For example If first record I have checked and i am trying to check the last record then the first record UNCHECKED and the last record will checked .
    Like how redio buttons work ..
    How can i do that ..?
    I have done like this :-
    1st I have declare a global variable in PRE_FORM :GLOBAL.CNT := 'N';
    Then
    WHEN-CHECKBOX-CHANGED trigger
    IF CHECKBOX_CHECKED(EMP.CHK') THEN
        IF :GLOBAL.CNT != N THEN
            :EMP.CHK := Null
       HERE what to write ???
            RAISE FORM_TRIGGER_FAILURE;
        ELSE
            :GLOBAL.CNT := Y;
        END IF;
    ELSE
        :GLOBAL.CNT := N;
    END IF;Edited by: LuKKa on Aug 29, 2012 1:12 PM
    Edited by: LuKKa on Aug 29, 2012 1:13 PM

    LuKKa,
    An easier method would be to use a Calculated Field to summarize the value of your CHECKBOX Item. For example, add a non-table item (call it SUM_CHECKED) to your detail block and do not assign it to canvas - so it will not be displayed. Then set the following properties of the SIM_CHECKED item:
    Database Item = No
    Calculation Mode = Summary
    Summary Function = Sum
    Summarized Block = <YOUR DETAIL BLOCK>
    Summarized Item = <YOUR CHECKBOX ITEM>
    Next, you will need to change your Detail Block property Query All Records to YES (this is required for the Calulated Item).
    Now, make sure your checkbox is data type NUMBER and has the following minimum properties set:
    Data Type = Number
    Maximum Length = 1
    Initial Value = 0
    Value when Checked = 1
    Value when Unchecked = 0
    Check Box Mapping of Other Values = Not Allowed or Unchecked
    Now, in your Checkbox Item's When-Checkbox-Changed trigger add code similar to this:
    IF ( CHECKBOX_CHECKED('YOUR_DETAIL_BLOCK.YOUR_CHECKBOX_ITEM') ) THEN
       IF ( :YOUR_DETAIL_BLOCK.SUM_CHECKED > 1 ) THEN
       --Reset the checkbox
       :YOUR_DETAIL_BLOCK.YOUR_CHECKBOX_ITEM := NULL;
       MESSAGE('You can only check one item.');
       Message(' ');
       RAISE Form_Trigger_Failure;
       END IF;
    END IF;I have confirmed this method works and it is more efficient than looping through your records to see if other checkboxes are checked.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Preventing disabling of check box - item okay in MIGO

    Dear all,
    In the MIGO transaction - during goods receipt for subcontractor material, when the item (incoming) is checked as item okay - automatically the child material (Material sent to subcontractor) is also activated thereby to enable 543 movement.
    Unfortunately some of the users are disabling the check box (for the material sent to the subcontractor). This prevents depletion of stock from the subcontractor but inflates the stock of the incoming material.
    Is there any way - either by authorisation check to prevent users disabling the check box or other methods?
    Experts suggestion is required in this regard.
    Thanks in advance.
    Regards,
    M.M

    Hi Magesh,
    it is possible. use Badi enhancement
    MB_MIGO_BADI goto
    IF_EX_MB_MIGO_BADI~POST_DOCUMENT
    tell your abaper to put the logic like
    parent ID and subcomponent ID need to select
    if either of two is not selected
    then error message will prompt not to save the GR doc since subcomponent is unselected.
    reference field EKPO check PSTYP
    hope this help you.
    regards,
    Maia
    Edited by: Maia on Apr 18, 2008 3:07 PM

  • Free Goods check box in PO, for Services

    Hello,
    Is there any way to activate the Free goods checkbox for Services (item category 'D') in Purchase Order.
    This field seems not to be available in the screen layout.
    Your support is highly appreciated.
    Regards,
    Vijay.

    Hi,
    Per SAP Note 0000634395, activation of Free Goods Check box for services in not possible.
    Though there is an option to make the services unaccountable, by marking the service as contingency item in the service details from the services tab.
    The subitem total is the aggregate of the subitem net values. This subitem total excludes subitems marked as contingency or alternate lines.
    Please refer to the link provided;
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/8d/7638d98f3f11d2b47f006094b93006/frameset.htm
    Regards,
    Sekhar.

  • Return Item and Free goods check box in purchase order

    Hi Guru:
    I just got the question regarding the return item and free goods check box,my question is that if I check the free good check box,then the price of the matieral will be charged to zero,however,if I want to issue the return purchase order to the vendor,does I need to check the return box first and then issue the return order to the vendor? Then go to MIGO transaction to select the movement type 122 to return the goods,what's the whole precedure for returning the goods to the vendor,can anybody tell me,very appriated!

    Hi,
    Retun to vendor through have two types....
    One is you have Po created, vendor send the item in that few items have rejected so you need to return the item to vendor......
    here in MIGo chose returrn to vendor selce the PO numbere.... system automaticaly take the movent type 122....
    sencond type is Retun PO..... In Po while creting the PO tick the return indication..
    If you do the GR system will pick 161mopvent type.. ( GR returns)...
    REgards
    anand

  • Unable to see other writer's checked check boxes in comments of shared review

    I'm using Acrobat 3D Version 8 in a Windows XP environment.  We are using SharePoint for shared reviews.
    We are able to see developer's comments, and we can respond back to the comments with a reply.  However, when we use the checkbox to indicate that a comment has been addressed, each writer can only see the checkmarks that she makes.  We cannot see checkmarks made by other writers.
    We have tried selecting the check box, and we have also used the check box icon to select the check box.  We then publish and the the action is accepted as a comment and is published.  But we are unable to see each other's check boxes.
    Why?
    Thanks!

    Solved on my own.
    Simply close BEx Analyzer and restart it again. If still it doesn't work then restart your computer and then run BEx Analyzer again, it will definitely work.
    TR.

Maybe you are looking for

  • Jco error

    Hi Friends, Itu2019s a support issue. Messages have failed in integration engine and inbound queues I am getting different errors in different areas of xiu2014 In Integration engine Problem while determining receivers using interface mapping u201CCo

  • Reformat media card

    trying to use my new, upgraded sd media card on my Curve 9300. Message comes up that card has errors and cannot be repaired.  How do I reformat the media card? Solved! Go to Solution.

  • Music Player no longer supports lyrics on Belle Re...

    When the refresh update came out , I updated it directly through my phone avoiding nokia suite it gave me new goodies and seemed like a minor + point.. Its only after updating my phone through nokia care just to boost up my memory it I started notici

  • MIRO equivalent of MIGO exit_saplmbmb_001 (or MB_DOCUMENT_BADI)

    In the MIGO update task, you can do custom stuff using the exit "exit_saplmbmb_001" (FG XMBC, Include ZXMBCO01) or the BAdI "MB_DOCUMENT_BADI". Does anyone know "right-off" the MIRO equivalent of this exit and/or the MIRO equivalent of this BAdI?

  • Password expires problem

    We have recently built two separate labs. The first lab consists of all 27 inch imacs. Everything works okay in this lab. The second lab, however, has some 24 inch imacs...and they are experiencing issues. Primarily, the 3 24 inch imacs always prompt