Set variable in main mxml based on check box selection in another mxml

I have a two mxml, In one of my mxml I have a checkbox, on checkbox_click event I want to pass some value to my main.mxml.
Using this value I want to toggle the visibility of map layer in main.mxml.
So far I have declared a bindable boolean variable in my main application mxml.
And written a function to set the value of this boolean variable depending on some other variable in the second mxml. This second boolean variable is set depending on the checkbox selection in second mxml. now I do not understand from where should I call this function so that everytime checkbox is checked or unchecked value of my bindable boolean variable (declared in main app) changes.
Is there any other way of doing this?
Thanks in Advance

This makes it even easier:
-------------- MyComp.mxml ----------------
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:Script>
    <![CDATA[
      import mx.collections.ArrayCollection;
      import mx.events.ListEvent;
      [Bindable] public var compBool:Boolean = false;
      private function toggleVisibility(evt:ListEvent):void{
        if(cmbx.selectedLabel == "show"){
          compBool = true;
        }else{
          compBool = false;
    ]]>
  </mx:Script>
  <mx:ComboBox id="cmbx" dataProvider="{new ArrayCollection(['hide', 'show'])}"
    change="toggleVisibility(event)"/>
</mx:VBox>
-------------- mainapp.mxml -------------
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  xmlns:comp="*">
  <comp:MyComp id="compObj"/>
  <mx:Label text="Map Component" visible="{compObj.compBool}" includeInLayout="{compObj.compBool}"/>
</mx:Application>
If this post answers your question or helps, please mark it as such. Thanks!
http://www.stardustsystems.com
Adobe Flex Development and Support Services

Similar Messages

  • Need to change the LOV field based on checked box selection in OAF page

    Dear ALL,
    I have a requirement as below:
    I have a custom OAF page having a lov  field which is mandatory, a check box and a two text fields.
    So based on LOV value selection i am defaulting two text field value automatically.
    So my requirement is when user selects the check box automatically the LOV field should be non mandatory and user can insert in values to the lov field and text field and submit it.
    SO basically based on check box field selection i need to make the lov field in such a way it should accept all the values what user enters instead of check the query added in VO behind the LOV.
    Please suggest me some pointers to achieve this requirement.
    Thanks
    Deb

    hi,
    in PFR use:
    if ("checkevent".equals(pageContext.getParameter(EVENT_PARAM))) 
                     HashMap hashMap = new HashMap();
                     String checkboxval=pageContext.getParameter("item2");
                  hashMap.put("checkboxval",checkboxval);
                    pageContext.setForwardURLToCurrentPage(hashMap ,
                    true, // retain the AM
                    OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
                    OAWebBeanConstants.IGNORE_MESSAGES);
    and in PR use:
    if((pageContext.getParameter("checkboxval'))!=null)
    OAMessageLovInputBean lovInputBean=(OAMessageLovInputBean)webBean.findIndexedChildRecursive("item3");
          lovInputBean.setRequired("false");
    try it
    Regards
    Mahesh

  • Populate drop-down lists based on check box selections

    Hi. I'm creating a Service Work Order form. At the top, there are several check boxes for the various services we provide, under that , more text fields, drop downs and checkboxes to elaborate on those services, and then at the bottom, fields for pricing.
    I'd like the top half of the form to drive the pricing info that is available or that auto-populates at the bottom.
    Ideally, I'd like to make the pricing specific based on 3 things:
    the service checkbox
    the client
    and the details on that service
    For example:
    If Client XYZ wants Service A that includes subservice B
    $123 should show up on the bottom half in the field for that service
    If Client ABC wants Service B that includes subservice C
    $456 should show up on the bottom half in the field for that service
    Does that make sense?
    I've been unable to get code to work in either the calculate and pre-Open options
    I first tried calculate and used this code (which was just a guess on my part)
    if (CheckBox1 == 1) and if (CheckBox9 == 1) then
    $.rawValue = 50
    elseif
    (CheckBox2 == 1) and if (CheckBox9 == 1) then
    $.rawValue = 50
    elseif
    (CheckBox5 == 1) and if (CheckBox9 == 1) then
    $.rawValue = 55
    elseif
    (CheckBox6 == 1) and if (CheckBox9 == 1) then
    $.rawValue = 55
    elseif
    (CheckBox7 == 1) and if (CheckBox9 == 1) then
    $.rawValue = 50
    elseif
    (CheckBox8 == 1) and if (CheckBox9 == 1) then
    $.rawValue = 50
    else
    $.rawValue = 0
    endif
    That didn't do anything but give me an error about "and"
    So I tried putting code in pre-Open:
    // clear the dropdown displayed value and items
    this.rawValue = null;
    this.clearItems();
    // repopulate the items based on the checkboxes
    if(offshore.rawValue == 1)
        this.addItem("$40.00", "offshore_001");
        this.addItem("$45.00", "offshore_002");
        this.addItem("$50.00", "offshore_003");
    if(inland.rawValue == 1)
        this.addItem("$40.00", "inland_001");
        this.addItem("$45.00", "inland_002");
        this.addItem("$50.00", "inland_003");
    I got no error but nothing populated and the drop-down was, in effect, disabled.
    Any help would be appreciated.
    Thanks!

    Gavin,
    This sounds like an issue that is not related to JHeadstart. To simplify the test case, you could create a simple drag-and-drop ADF application without JHeadstart and see if the same problem occurs there.
    Your suggestion that it is related to the where clause seems likely. Please find out what kind of object USER_ENV is, and how it is initialized. Maybe this initialization is skipped when bouncing the application.
    What happens if you perform the query in SQL*Plus, without doing anything about the USER_ENV?
    Maybe you should ask the Oracle Applications discussion forum...
    kind regards,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Query based on check box selection

    Hi,
    Can anyone tell me how to write query or what is the way for the following problem
    i have 2 regions in my report 1st region is the html one which has multiselect depending upon selection from the multiselect when user clicks submit
    another region that is the interactive report that is displayed.
    can anyone tell me how to query for ir for the same and what other things i need to do?
    Thanks and Regards,

    keny_01 wrote:
    Hi,
    Can anyone tell me how to write query or what is the way for the following problem
    i have 2 regions in my report 1st region is the html one which has multiselect depending upon selection from the multiselect when user clicks submit
    another region that is the interactive report that is displayed.
    can anyone tell me how to query for ir for the same and what other things i need to do?
    Thanks and Regards,Not sure I quite understand... when you say multiselect - is that the checkbox?

  • Accessing variable in main mxml from component

    I have the following problem, i have a main mxml and
    component mxml which i import in my main file. I need to access
    variable in main mxml file from that component but i don't know how
    to reference my main mxml from component? Can someone please help
    me with this?
    thanks in advance

    Try this
    this.parentApplication.main_mxml.variableID = 34;
    Rgds
    JFB
    "msabljic" <[email protected]> wrote in
    message
    news:fd2u5k$a17$[email protected]..
    >I have the following problem, i have a main mxml and
    component mxml which i
    > import in my main file. I need to access variable in
    main mxml file from
    > that
    > component but i don't know how to reference my main mxml
    from component?
    > Can
    > someone please help me with this?
    >
    > thanks in advance
    >

  • GR Based IV check box

    Hi. I need help in controlling the GR Based IV check box in creating the PO.
    We normally set this in the vendor master. But then, How can I set the GR BASED IV checkbox base on the PO document type that will be used?
    Let say I want all sap standard types of PO to be GR Based and some Z type PO to be not a  GR based IV PO.  Is this possible?
    Is there a User-Exit for this?

    HI,
    Since you want to set the GR based IV to set for all Standard Purchase order- at doc type level.
    So the first thing is the vendor master setting which you are already doing.
    Second you can also do it by the info record .by creating info record for all vendor and material /Material Group ..we can control the GR IV indicator
    Third  thing is Controlling it by the screen layout.
    SPRO-Material Mangement-Purchasing- Purchase order-Define doc types
    here in the definition of Doc type ,attach a screen layout.
    SPRO-Material Mangement-Purchasing- Purchase order- Define screen Layout at doc type level.
    in this Screen layout in the tab --GRIR control. make the GR based invoice as mandatory,so that it cant be skipped while created or change of PO and user will check it even if it is missed out.
    hope so it helps
    Regards
    Anjanna

  • Default settings for gr based ir check box for asset PO

    dear experts,
                  in vendor master record in purchasing data tab i have checked gr based iv check box, and hence whenever i am creating a Po with X vendor for material system is automatically  checking the check box in po for gr based iv but with the same vendor X if i am creating a PO for Asset itis not checking the gr based iv check box by default.
           can you pls tell me where the default setting for gr based  iv lies for the asset procurement.
    thanks
    ujwal

    HI Ujjwala,
    The setting in spro in Acct assigment,  u are talking about is GR Receipt or Invoice Receipts.
    These are not GR Based Invoice Verification.
    GR based Invoice Verification comes from either ur inforecords or vender master.
    if u check or uncheck these in spro in acct assigment, then it will comes ur Deliver Tab not ur invoice Verification Tab.
    one thing more, if u make it mutiple Acct assigment, then it will be Non Valuated G/R Based IV.
    Hope Clear U !
    REgards,
    Pardeep Malik

  • Check box selection based on name inside a field

    I have a fillable PDF form
    the form has 2 check box selections.  M  or F   (male or female)
    i can get a field to populate with M or F or Male or Female but how can I get a check box to select M or F based on
    what comes into a field ?

    You can use the text-field's custom validation script to edit the check-box, for example:
    if (event.value=="Male") this.getField("CheckBoxMale").checkThisBox(0, true);
    else if (event.value=="Female") this.getField("CheckBoxFemale").checkThisBox(0, true);

  • GR based IV check box suppressed - Extended Classic Scenario

    Hello Folks,
    How are you doing today ?
    We are working in SRM 5.0 Extended Classic scenario.
    When created the Local PO in SRM with GR Based IV Check box active, the
    follow-on back-end Purchase order is generated without this flag. In
    other terms, system is creating the follow-on ECC PO without GR Based
    IV check box active. As a result, we are unable to run the ERS cycle.
    Back-end system in above scenario is ECC 6.0. And vendor settings are
    maintained with GR based IV flag on in both ECC and SRM.
    Kindly advice.
    Thank you for your assistance !

    Hi Ravi and Yann,
    Thank you for your inputs. OSS note-956083 can not be applied in my case due to the hight system version (patch level 550).
    I have already raised this issue to SAP, but in the lack of proper infrastrucure SAP can not access the system. (BASIS guys are still struggling with it)
    Well...let me give you recap-
    We have not activated nor implemented any BAdi so far (Vanila SRM 5.0 EC scenario) PO creation for goods is working fine and as desired. But when it come across with PO with limit item or services, system throws an error as -
    "PO 5100000263: Service-based invoice verif. requires GR "NO" or G R-based invoice verif."
    Would deeply appreciate if you guys can share insight on this issue.
    Thank you for your assistance!

  • Check box selection

    Hi
    I have a problem with check box selection.I query from the database and based on the output from the query i prepopulate the check box with a tick mark.But when the user goes again and deselects one of the check box that was ticked and submits the form , it also includes the unchecked box.the following is the code I have.
    <%
    if (itemStr == 00 ){
    %>
    <td align="center">
    <input type="checkbox" name="build">
    </td>
    <% }
    else{ %>
    <td align="center">
    <input type="checkbox" name="build1" checked >
    </td>
    Then in my form I do
    String[] ar = request.getParameterValues("build1");
    how do i ensure if the user unselects from build1 , it doesnt add that item.
    Help Needed
    Arn

    Notice that this line
    request.getParameterValues("build1");
    is getting the value of the check box. The "checked" attribute is not the value, just the attribute.
    Oddly enough, I just wrote some code to do this today.
    First, add this little javascript method to your page.
    <SCRIPT language="JavaScript"> <!--  //Hide contents from older browsers
    function setHiddenTagFromCheckbox(checkbox, element) {
      if(checkbox.checked) {
        element.value="yes";  
      else {
        element.value="no";  
    // End hiding the contents -->
    </SCRIPT> 2) Add a hidden input field for each checkbox field.
    <input type="HIDDEN" name="prin2signhidden" value = "no">3) Add an onclick handler for the check box
    <input type=checkbox name="prin2sign" onclick="setHiddenTagFromCheckbox(document.formname.prin2sign, document.formname.prin2signhidden)">In your servlet check the value of prin2signhidden instead of the checkbox input.
    The forum is doing odd things to this source code. Any place you see a > you should actually have a "greater than" sign.

  • How to populate a table based on a row selection from another table.

    Hi, i just started to use ADF BC and Faces. Could some one help me or point me a solution on the following scenario .
    By using a search component , a table is being displayed as a search result. If i select any row in the resulted table , i need to populate an another table at the bottom of the same page from another view. These two tables are related by primary key . May i know how to populate a table based on a row selection from another table. Thanks
    ganesh

    I understand your requirement and the tutorial doesn't talk about Association between the views so that you can create a Master-Detail or in DB parlance, a Parent-Child relationship.
    I will assume that we are dealing with two entities here: Department and Employees where a particular Department has many Employees and hence a Parent-Child relationship.
    Firstly, you need to create an Association between the two Entities - Department and Employees. You can do that by right clicking on the model's entity and then associating the two entities with the appropriate key say, DepartmentId.
    Once you have done that, you need to link the two entities in the View section with this Association that you created. Then go to AppModule and make sure that in the Available View Objects: 'EmployeesView' appears under 'DepartmentView' as "EmployeesView via <link you created>". Shuttle the 'DepartmentView' to the right, Data Model and then shuttle
    "EmployeesView via <link you created>" to the right, Data Model under 'DepartmentView'.
    This will then be reflected in your Data Controls. After that, you simply would have to drag this View into your page as a Master-Detail form...and then when you run this page, any row selected in the Master table, would display the data in the Detail table.
    Also, refer to this link: [Master-Detail|http://baigsorcl.blogspot.com/2010/03/creating-master-detail-form-in-adf.html]
    Hope this helps.

  • Passing column values to another tab if check box selected in that row

    Hi
    I have the following requirement.
    I have a table that gets populated by a web service. Have added one more field to it which is a check box. Th requirement is that I need to pass the values of column (say id) from each row which has it's check box selected, as input parameters to a web service in another tab.
    example: table has fileds id, name, address,checkbox. If there are 5 rows and the user select 1 and 2 then I need the ids of 1 and 2 to be passed to another tab.
    Is this possible  ........
    Thanks

    Hi
    I just don't want to make multiple selection but pass the values of a column from the selected rows to another tab to be used as input parameters to a web service.
    I want to know how to pass the values(of one filed) of the selected rows across tabs/switches.
    Thanks

  • I have a new MacBook Pro with OS10.8.2 and cannot get Contacts to print a list of addresses with pictures showing.  There is a check box selecting "picture" which has been checked - but no picture.  This worked fine on OS10.7.5.  Problem??

    I have a new MacBook Pro with OS10.8.2 and cannot get Contacts to print a list of addresses with pictures showing.  There is a check box selecting "picture" which has been checked - but no picture.  This worked fine on OS10.7.5.  Problem??

    First, back up all data immediately, as your boot drive might be failing.
    There are a few other possible causes of generalized slow performance that you can rule out easily.
    Reset the System Management Controller.
    If you have many image or video files on the Desktop with preview icons, move them to another folder.
    If applicable, uncheck all boxes in the iCloud preference pane.
    Disconnect all non-essential wired peripherals and remove aftermarket expansion cards, if any.
    Check your keychains in Keychain Access for excessively duplicated items.
    If you have more than one user account, you must be logged in as an administrator to carry out this step.
    Launch the Console application in the same way you launched Activity Monitor. Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Select the 50 or so most recent entries in the log. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V). You're looking for entries at the end of the log, not at the beginning.
    When posting a log extract, be selective. Don't post more than is requested.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some personal information, such as your name, may appear in the log. Anonymize before posting. That should be easy to do if your extract is not too long.

  • Hiding text box based on check box checking

    Hello,
    I have a jsp in which based on whether the check box is checked or unchecked I want to hide or show a text box. I am including the text box in a div tag & calling a javascript function to set the style of the div to hidden or shown based on whether the check box is checked or not. although i am getting the correct values in the alerts the text box is not getting hidden.
       <td class="label"><label for="chk1"><gbms:message key="lblSearchforDeletedCustomer"/>:</label></td><td class="input">
                  <html-el:checkbox property="chk1" value="N" tabindex="3" onclick="javascript:checkboxClicked(document.forms['formCustomerOrVehicleMaintenance'])" onfocus="fnShowError(document.formCustomerOrVehicleMaintenance.chk1);"></html-el:checkbox> <gbms:message key="chek"/> 
                                 </td>
                                 <div id="delDateDiv" style:hidden>
                            <td class="label"><label for="txtDeleteDate"><gbms:message key="lblDeletedAsOf"/>:</label></td><td class="input">
                 <html-el:text property="txtDeleteDate" size="6" maxlength="40" tabindex="3" onchange="fnChanged()" onfocus="fnShowError(document.formCustomerVehicleMaintenanceDelete.txtDeleteDate);"></html-el:text> <a href="#" onclick="cal1xx.select(document.forms[0].txtDeleteDate,'anchor1xx','MMddyy'); return false;" name="anchor1xx"><img src="<%=request.getContextPath()%>/css/common/calendar.gif" border="0" style="cursor: hand"></a><gbms:help jsp="customerVehicleMaintenanceDelete" module="admin" languageCode="<%=request.getLocale().getLanguage()%>" field="DeletedAsOf"/>
                        </td></div>javascript function being called..
    function checkboxClicked(aThis)
                        var aform = document.forms['formCustomerOrVehicleMaintenance'];
                        var aDiv = document.getElementById('delDateDiv');
                        alert(aDiv.style.visibility);
                        alert(aDiv.innerHTML);
                        alert(aform.chk1.checked);
                        if(aThis.chk1.value == true)
                             aform.txtDeleteDate.value = '';
                             aform.txtDeleteDate.disabled = false;
                             aDiv.style.visibility = 'visible';
                        else
                             aform.txtDeleteDate.value = '';
                             aform.txtDeleteDate.disabled = true;
                             aDiv.style.visibility = 'hidden';
                   }

    in my javascript function the value returned is true when checkbox is checked & false when it is unchecked. visibility is also giving correct value in the alert. but still field is not hiding
              function checkboxClicked()
                        var aform = document.forms['formCustomerOrVehicleMaintenance'];
                        var aDiv = document.getElementById('delDateDiv');
                        alert(aDiv.style.visibility);
                        alert(aform.chk1.checked);
                        if(aform.chk1.checked)
                             aform.txtDeleteDate.value = '';
                             aform.txtDeleteDate.disabled = false;
                             aDiv.style.visibility = 'visible';
                             alert("inside if");
                             alert(aDiv.style.visibility);
                        else
                             aform.txtDeleteDate.value = '';
                             aform.txtDeleteDate.disabled = true;
                             aDiv.style.visibility = 'hidden';
                             alert("inside else");
                             alert(aDiv.style.visibility);
                   }

  • Multiple Inserts based on check box?

    I have an insert form that depending on if checkboxes are
    checked, inserts the data. How can I insert a record for the number
    of check boxes checked?
    Example:
    CB 1 = Checked
    CB 2 = Not Checked
    CB 3 = Checked
    So I need to insert a record for CB 1 and CB 3. How can I do
    this?
    What I'm doing is tying a sales lead to the sales man
    selected. I'm using check boxes because I figured it was easiest
    but I'm open to suggestions.

    In your example, CB 1 and CB 3 are checked. But your
    explanation states you need to insert a record for CB 1 and CB 2.
    What am I missing?
    Keep in mind that you will not see the variable FORM.CB2,
    since unchecked checkboxes to not pass their name to the action
    page. Maybe the code below will help. By naming all the check boxes
    the same, you receive a comma-delimited list of the values of only
    the checked checkboxes. You can then put this in a list loop and
    update your database.

Maybe you are looking for

  • How to force write-behind store on cache node shutdown?

    Hi, I built a small pilot project based on Coherence and now I test it for failover. I found replication issues with Distributed cache in the following scenario: - start cache node 1 (JVM instance 1); - connect Extend client to it and get 1 object fr

  • Set content type on header doesn't work on servlet filter

    I am trying the following filter: chain.doFilter(req, responseWrapper); and im trying to set the content type: response.SetHeader("Content-Type","text/plain"); But it doesn't seem to set it. I have the wrapper as: private ByteArrayOutputStream     ou

  • LR3 Getting Started questions

    I've been using Aperture since v2 and am looking to move to LR 3, but have some functionality questions before purchasing LR. Right off, this isn't meant as Aperture can, LR can't post.  It's meant as, LR has features that I like and am considering s

  • Multiple Image Uploader renaming thumbnails

    I am having a blast with the ADDT! For a php noob such as myself this stuff is great, just what I have been looking for. If only I knew how to stop ADDT's multiple image uploader FROM RENAMING THE UPLOADED THUMBNAILS. Like this: myImage.jpg is rename

  • Advice for modifying a compressed file without expanding its size?

    Hello. Fairly new to video editing, so your advice is appreciated. I've got a 720x480 WMV3 .AVI video clip which runs about 1/2 hour at a rate of 666kbps. The file size is about 75MB. In trying to adjust the brightness/contrast on the file and resave