Using the selection list to add/remove children

I have a component tileList at the top of my app that I use as a menu bar. He currently has a bit of the two options. Everything that is displayed when the first item is selected is in a container; for the second element is in a separate container. Is it possible to set up the event listener so that when the selected index == 0, reservoir 2 precipitates and Tray 1 is added, and when the selected index == 1 Tray 1 is removed and the tank 2 is added?

Here is the code I tried so far (which did not).

private function menuClick(e:ListEvent):void
        {
            if(menuBar.selectedIndex==0) hdb.addChild(hdbd) && hdb.removeChild(hdbn)
            if(menuBar.selectedIndex==1) hdb.addChild(hdbn) && hdb.removeChild(hdbd)
        }

EDIT: just saw your response tracking haha. No worries man happens all the time. IM surprised that the "&" worked. I always thought it was only good in the IF ELSE statements. u learn something new every day!

Hey jffurian,

try to change your function to this:

private function menuClick(e:ListEvent):void{    if (menuBar.selectedIndex == 0)    {        /**          * check to make sure the container you want to         * remove is infact a child, sometimes throws error         */        if (hdb.contains(hdbn))        {            hdb.removeChild(hdbn);        }

        /** add the new contaiener */

        hdb.addChild(hdbd);    }    else if (menuBar.selectedIndex == 1)    {        /**          * check to make sure the container you want to         * remove is infact a child, sometimes throws error         */

        if (hdb.contains(hdbd))        {            hdb.removeChild(hdbd)        }

        /** add the new contaiener */

        hdb.addChild(hdbn);    }

}

You had the idea of writing, but the syntax was a bit off. the "&" is only good in the logical instructions as the parenthesis of an if else statement. and usually if the IF statement has several lines, as in your case, you must use the curly braces {}. Note also instead of two if statements I have merged with it an IF ELSE IF statement.

In addition, do a check to make sure that the object you are deleting is a child object of the parent container. This isn't and he sometimes throws an error "Must be a child" so its good to have just in case control.

hope that a few things cleared up. Good luck!

Tags: BlackBerry Developers

Similar Questions

  • Using the selection list

    Hello:

    I have created a form where I would like to include a few select list boxes.

    When I run my form, I meet two types of questions in which I could use help in troubleshooting.

    Question No. 1:
    I have a field called SPECIALTY. This field in the database is a NUMBER.
    If my user does not select a specialty, the following error message occurs: ORA-01722: invalid number

    I checked the value that is passed to the field and the value is null %. I think that the reason for this error message is that the SPECIALTY is a numeric field and the % value % null is character.

    One, why this null value % of filling in my table? If the user does not select anything, regular null must appear in the column.
    Two, how to replace this % % null value?

    Question 2:
    I have a field called STATE. The field in this table is a VARCHAR2 (2).
    If my user does not select a status code, the following error message occurs:-12899: value too large for column 'TEST '. "ORGANIZATION '." "' SUFFIX ' (real: 6, maximum: 2).

    I checked the value that is passed to the field and the value is also null %. Well, null % is certainly 6 characters and does not fit into a column defined with a width of 2.

    What can I do to fix this problem? I do not understand why null % keeps being inserted in the DB when anyone makes a selection in the select list. Is it possible that we can replace this value and insert the value null ordinary? When I speak of 'regular null value', I mean when I have a text field and it is empty, a null value is inserted into the table, but it does not appear as null %. To place the value in the DB looks like (null).

    Can someone help me?
    Thank you.

    Hello

    Go to your list of selection-> list of values definition:

    The value 'Null return value' for example to zero.

    Based on what you expected store in your table, you can change your insert, update function for:
    for example, if you want to store the value null:
    Decode(:P22_SELECT_LIST,0,,:P22_SELECT_LIST);

    Best regards, Kostya Proskudin

  • Filter a shuttle using the selection list

    Hi all

    Apex 3.1.2 version

    I've seen a few posts on how to filter values in a shuttle and I tried a solution but I can't seem to do it all together.

    What I do is this...

    I have a shuttle service (P2_APPLY_TO_LINES) that contains a list of items, this list may be very long. Next to the shuttle users want to have a selection list (P2_MANUFACTURER_FILTER) where they can choose a manufacturer. Choose a manufacturer in particular will again fill the left side of the shuttle with only the items for the manufacturer.

    If someone got something like this works? If Yes can you please elaborate?

    For attributes of HTML selection list form elements, I have the following call, but I can't seem to get the right code

    OnChange = "f_filter_shuttle_item (this, 'P2_APPLY_TO_LINES').


    I also think I need to point to the application and the application process, but don't know what to do with the.

    Thanks for your help!

    Why you do not create a selection with mailing list and a shuttle service will be to repopulate itself to your selection list condition?

  • The pdf I want to change has all embedded fonts.  When I try to insert a comma, I get the message, "all or part of the selection has no available system fonts.» Cannot add or remove text using the selected font. "Will I still have this problem

    The pdf I want to change has all embedded fonts.  When I try to insert a comma, I get the message, "all or part of the selection has no available system fonts.» Cannot add or remove text using the selected font. "Will I still have this problem if I'm updating from Acrobat X?

    You have the fonts installed in the system. This has not changed. (Having the police is not always enough, but it is certainly necessary).

  • Refresh the report area of PL/SQL (not Page) using the value of the select list

    Hello

    I have a report region based on a "body of the PL/SQL function returning a query'which SQL is generated on the selection of a value of an element from the selection list, select action list is"Redirect and set", but this causes the entire page refresh rather than just the region report." I tried to update the report using only a dynamic action on the item list select (Action now reset to 'None'), but now the report does not appear on the choice of the list. Can someone suggest a solution that will allow me to update this report without refreshing the page? I use APEX 4.2.2 and the syntax of the statement is as follows:

    DECLARE

    v_statement VARCHAR2 (500);

    BEGIN

    SELECT query_text
    IN v_statement
    OF sql_queries
    WHERE query_id =: P2_QUERY;

    RETURN v_statement;

    END;

    where P2_QUERY is Select list item,

    Kind regards

    Kevin.

    KevinFitz wrote:

    The displayed report region is subordinate to the point P2_QUERY is NOT NULL. I guess that the region appears not is because the Action for the select list item is set to None, and so P2_QUERY is always NULL.

    No, the region does not appear because it is subordinated to the P2_QUERY being NOT NULL. This means that the region of report never exists on the page displayed in the browser, so it cannot be updated dynamically. (Dynamic updating is not to evaluate the conditions of the region, and she makes only the content of the report, not the whole region again).

    Remove the condition on the region to report, check the update works and then go back on what exactly are the requirements here. If you want to the area appear only when P2_QUERY has a value, and you want it to be regenerated without submitting and reposting of the page, the region must then be hidden rather than conditionally restored and shown via dynamic when action P2_QUERY Gets a value.

    I tried to add a further Action for the event real value DA but has been a mistake, as stated above,

    All irrelevant if Page to submit items on the region is used correctly.

  • change the results of the report with the selection list using dynamic action

    This is one of those situations where if I could understand the appropriate search terms to use, someone else must have asked this question in the past.

    I have a report with a SQL query with a condition based on a list of selection on the same page. So I have a list of selection -: P177_FISCAL_YEAR

    My request for my report is:

    Select md_id, display_name, description
    of media_tbl
    where fiscal_year =: P177_FISCAL_YEAR

    When a person makes a selection on the selection list (: P177_FISCAL_YEAR), I would like to report up-to-date without having to submit the page. I was hoping that I could do something like this using a dynamic action but have not found a way to do it.

    Thanks in advance!

    John

    Create dynamic Action:

    When
    Event: change
    Selection type: product (s)
    Article (s): P177_FISCAL_YEAR
    Condition: - unconditionally.

    Real Actions (add 2 real actions)
    -the first is to load the value in session state so that the report can see.
    Sequence: 5
    Action: execute the PL/SQL Code
    Code PL/SQL: null;
    Items to submit page: P177_FISCAL_YEAR

    -the second to refresh the report
    Sequence: 10
    Action: Discount
    Selection type: region
    Region:

  • Development of the selection list after refresh using jQuery

    Hi all

    I have an Express Application 4.1.1.00.23 application that runs on a server, Oracle 10 g R2.

    In the application, I have a page (suppose it to be Page 10) that has a drop down (let's call it P10_PARENT). Next to the dropdown menu, I have a button that when clicked opens another window popup with page 11. This 11 page is used to create many of the points listed by the P10_PARENT drop down. When enter us the data P11 and click OK, we have a javascript to call a process application that creates the object in the database. Now select the P10_PARENT list is updated to reflect this new object. So after the application process is running, the JavaScript on the Page 11 calls a function in Page 10, using window.opener.functionName. This Page 10 function performs an apex to help refresh

    $('#P10_PARENT').trigger('apexrefresh');
    

    This function returns the Page 11, the page is closed using the Window.Close ().

    It works fine up until this point. Now, there are also by default the value selected in the select list of the newly created object. We made a function for it. But he calls immediately after the outbreak of the updating of the apex does not work because he probably did not updated the list since the back end still.

    Therefore link us an apexafterrefresh event to this element and making the default here. Like this:

    $('#P10_PARENT').bind('apexafterrefresh',function(){
      setdefault('P10_PARENT',newCreatedObjVal);
      alert('Refresh completed!');
    });
    

    But this event does not seem to be triggered. I've tested in IE and Chrome. In Chrome, it started once, but never after that.

    The relevant code on page 10 looks like this. The refreshBusList function is called Page 11 with the value of the newly created object.

    function refreshBusList(pDefault)
    {
      newCreatedObjVal = pDefault;
       $('#P10_PARENT').trigger('apexrefresh');
    }
    
    $('#P10_PARENT').bind('apexafterrefresh',function(){
      setdefault('P10_PARENT',newCreatedObjVal);
      alert('Refresh completed!');
    });
    

    I would like to know what we're doing wrong. Is it still the right way to do it? I can't use dynamic actions here because the logic of javascript page is too complicated be properly implemented using the declarative logic like DAs (we tried once and had to leave after a week. has become a nightmare to manage).

    Any help would be much appreciated!

    Thank you!!

    Aalami

    What does setDefault? Have you tested this feature by running it from the console? It doesn't have the required behavior?

    Can what newCreatedObjVal value contain? What is an object? A string?

    Are you sure that the selection list is updated?

    I would also like to rewrite your refresh logic. On the one hand, you declare a variable of global scope: horrible! There is no need of it. You can also control refreshing after a little better by simply acting on it once.

    function refreshBusList(pDefault)
    {
      // not really necessary. But use "var" to declare scoped variables!
      var newCreatedObjVal = pDefault;
    
      // bind a one time afterrefresh event handler
      // then, trigger the refresh
      $('#P10_PARENT')
      .one('apexafterrefresh',function(){
        setdefault('P10_PARENT',newCreatedObjVal);
        alert('Refresh completed!');
      })
      .trigger('apexrefresh');
    }
    
  • Hello experts, I use Adobe forms in SAP. My question is, is there a any restriction for additem keyword in JavaScript? I mean, even if I use the keyword additem to add the name and value of a drop-down list, it adds up to 10000 files only. Please s

    Hello experts,

    I use Adobe Forms in SAP.

    My question is, is there a any restriction for additem keyword in JavaScript?

    I mean, even if I use the keyword additem to add the name and value of a drop-down list, it adds up to 10000 files only.

    Please sugest

    A drop-down list is the bad INTERFACE design where an element can contain more than 100 entries. It is very good in tests, but absolutely unacceptable if the form must be used by a person busy doing their work. The choice of Acrobat forms are limited, but consider a list box. Despite this, there may be limits imposed by the system or the implementation.

    Better would be

    (a) stop filling after awhile the list and add an entry saying several elements not shown, running report or use better filter

    (b) be available for all filtering of course lists

  • How to use a Select list on a second primary key column in a tabular presentation?

    Hello

    I created a tabular presentation located on the details page of the user (form), that allows to manage roles for this user.

    The shape of table contains 3 elements:
    -> a checkbox
    -> user (PK) column is hidden, and its default value is generated by a function pl/sql (to submit the time), which refers to the element to username.
    -> the role of the column is displayed as a named select list LOV: add you a line, choose a role, submit, etc..

    But my ROLES table (not created by me...) contains 2 columns: USER and GRANTED_ROLE.
    The USER is the primary key, but a user can have multiple roles (= one line per role).
    GRANTED_ROLE is the second primary key, so that we can differentiate between one line of another.

    At the moment my tabular form has only one primary key (USER), so the GRANTED_ROLE can display as a list select.
    But, for this reason, in my opinion, remove the button do not work: all the lines of the user have the same key, so when I select a few lines to remove these, all lines in the form of tables are deleted.

    I don't know how my button Delete could recognize the subkey to remove only selected rows...
    Or maybe I should use a different type of region?

    Thanks for your help!
    Fanny

    In the process of ApplyMRD, try to specify the 'secondary key' column in the section "Source: Multi line Update and Delete"to the second column key in tabular form.»

    I have not tested this with your situation, but worth it.

  • Automatic filling of multiple selection based on the selection list

    Hello

    I have a problem in filling multiple selection data in the selection list.
    I would like to take an example and explain.
    I have 3 tables: employee, Department and a link table for employee and department.
    The selection list contains employee and the Department is a multiple selection. Employee selection, all departments must be posted and belongs to the Ministry of which employee (which comes from the binding table) must be selected (high-lighted). How can I do this?

    HI 841762 :),.

    Do not use the 'style' to highlight that you would have found out by now that would make the blue text background while the font color remains black and this will make the text unreadable. Plus if there is a button on the page when you submit it to us, I doubt that it will store the State of the selected items in a multiple of P1_DEPT in session state. then try this...

    In the application process, replace, the status of 'style' that you used to highlight as you...

    ....
    If (rec.R=cnt)then
    htp.prn('');
    ELSE
      htp.prn('');
    end if;
    ...
    

    Then in the JS, use

    appendToSelect(list, l_Opt_Xml.getAttribute('value'), l_Opt_Xml.firstChild.nodeValue,l_Opt_Xml.getAttribute('selected'));
    

    and change the function "appendToSelect".

    function appendToSelect(pSelect, pValue, pContent,pIsSelected) {
    
     var l_Opt = document.createElement("option");
     l_Opt.value = pValue;
    
    if(pIsSelected)
    l_Opt.setAttribute('selected','selected');
    
    if(document.all){
      pSelect.options.add(l_Opt);
      l_Opt.innerText = pContent;
     } else {
      l_Opt.appendChild(document.createTextNode(pContent));
      pSelect.appendChild(l_Opt);
     }
    }
    
  • Microsoft SQL Server 2014 (SP1 - CU4) (KB3106660) query failed with error ORDER BY items must appear in the select list if SELECT DISTINCT is specified.

    Hello
    I use Microsoft SQL Server 2014 (SP1 - CU4) (KB3106660) Enterprise Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1)

    SELECT DISTINCT A.PI_LOOKUP_CATEGORY_ID,
    REPLACE (REPLACE (UPPER (A.LOOKUP_CATEGORY_NAME), ' ', '_'), '-', '_') AS CATEGORY_TECH_NAME,
    A.LOOKUP_CATEGORY_NAME,
    A.LOOKUP_CATEGORY_DESCR,
    COUNT (B.PI_LOOKUP_CATEGORY_ID) AS USAGE_COUNT
    FROM [PI_LOOKUP_CATEGORY] A LEFT OUTER JOIN B [PI_INSIGHT_COLUMN] WE
    A.PI_LOOKUP_CATEGORY_ID = B.PI_LOOKUP_CATEGORY_ID
    A.PI_LOOKUP_CATEGORY_ID GROUP,
    REPLACE (REPLACE (UPPER (A.LOOKUP_CATEGORY_NAME), ' ', '_'), '-', '_').
    A.LOOKUP_CATEGORY_NAME,
    A.LOOKUP_CATEGORY_DESCR
    ORDER TO REPLACE (REPLACE (UPPER (A.LOOKUP_CATEGORY_NAME), ' ', '_'), '-', '_')

    above request is failed with error ' ORDER BY items must appear in the select list if SELECT DISTINCT is specified. " Microsoft SQL Server (SP1 - CU4) 2014 (KB3106660)

    same query works fine with older versions of SQL servers like (2008R2, or 2012)

    Please let me know the resolution of this problem...

    Thank you
    Touria

    Ask here:

    MSDN - SQL Server - Microsoft forums

  • Windows will not honor "always use the selected program to open this type of file."

    When I try to open a file *.img using 'open with... '. "I get a window of"Leader Type Helper"asking what software I want to use.  I have check "open this file using a software program (sic) that (sic) is already installed."  This very unnecessarily opens another dialog box titled 'open with' * Sub * the files already browser window fill the screen while I'm not yet aware that the box is here.  Having managed to find, I choose "7-Zip File Manager" and click on the box always saying "use the selected program to open this type of file", and then click OK.  This opens the file using the selected program, as you wish.

    However next time I try to open a *.img file, I again get the window "Help file of Type" and must go through the whole process again.  (By double-clicking on the file shows "Windows Disc Image Burner".)  Why don't Windows 'always use the selected program' like I asked?  Windows is aware that I have chosen before, because it is considered to be the only 'recommended program' in the 'Open with' dialog box  Thanks for any help!

    Care to try another tool?  This small utility can help: http://izt.name/apps/types/

    You will find the file type in the list of icons (.img files, then), and then to change what he uses to open the file by clicking on the option 'open' and edit the properties.

  • inadvertently, click "always use the selected program to open this type of file" how undefault and redo icon to the icon of white empty file?

    I accidentally click "always use the selected program to open this type of file" on the srt file. How to make it undefault and again the icon to icon file empty white?

    You can do this via a registry change, but it is more appropriate for a typical user to simply use the system restore:

    System restore

    Ever wished that you can go back in time following a bad fall? With Windows, you can.

    Installation sometimes a driver or a program can make Windows run slowly or erratically. System Restore can return programs and system files from your PC to a time where everything worked, potentially prevent hours of troubleshooting of headaches. This will not affect your documents, images or other data.

    In Windows 7, you can create system restore points more and see exactly what files will be deleted or added when your PC is restored. For more information, see create a restore point.

    For more protection, use the restore system backup and restore, which is designed to help save email, photos, documents and other personal files.

    To use the system restore

    Before you start the system restore, save open files and close all programs. System Restore will restart your PC.

    1. Open system restore by clicking the start . In the search box, type restore the system and then, in the list of results, click on system restore.  If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.
    2. Follow the steps in the wizard to select a restore point and restore your computer.

      For more information, see System Restore: frequently asked questions.

    In Windows 7 system restore can prevent headaches hours after an accident.

  • Tabular returns lines based on the selection list

    Howdy-

    An element of the selection list is used to select a job title.

    The tabular presentation returns lines of documents to be considered annually by the title of the post.

    A single column in a tabular form (the number of the document) is defined as a link so that the user can open and read the document.

    It works beautifully.

    But...

    Some job titles return a row of five documents, still others return more than a hundred, so when paging is used to move to the next set of lines in tabular form, updates the selection list and the selection is lost.  I have the Page Action selection list element when the modified value to Redirect and set the value, but the Type of Source is static that may be my problem.

    How can I use pagination while maintaining the value of the selection list?

    Thanks in advance.

    Alexandra

    Request Express 4.2.2.00.11 (by the way, I don't have our network administrator do a update to this version?)

    the value of the default selection on a hidden item list. When you select from the drop-down list, set the item also hid from the selected item.

  • PLSQL code in the selection list

    My query is:

    I have a room list of table names that contain information about the rooms

    capacity seated

    name of the rooms are fetch in the select list: P1_ROOM_NAME that returns the id of the element room hidden

    : P1_ROOM_ID that is used for the third Select: P1_NO_OF_PARTICIPANTS

    I get the error message by filling: P1_NO_OF_PARTICIPANTS

    NO DATA FOUND AND I LIKE INVALID VARIABLE

    I know some people found data are due to: P1_ROOM_NAME IS NOT SELECTED first

    the loading of the page.

    Any idea for the request to: P1_NO_OF_PARTICIPANTS

    sample data and used queries

    create the table room_list

    (number of room_id,

    room_name varchar2 (100),

    sitting_capacity

    );

    insert into room_list values(1,'a',3);

    insert into room_list values(2,'a',1);

    : P1_ROOM_NAME

    SELECT ROOM_NAME, ROOM_ID AS DID R

    OF ROOM_LIST

    To select the list I used

    : P1_NO_OF_PARTICIPANTS

    Lov used cascading point P301_ROOM_ID

    DECLARE

    l_sitting_capacity varchar2 (50);

    Start

    SELECT SITTING_CAPACITY from l_sitting_capacity

    OF ROOM_LIST

    WHERE ROOM_ID =: P301_ROOM_ID;

    BECAUSE me IN 1.l_sitting_capacity

    loop

    RETURN

    "I select as view, I like back"

    the double ';

    end loop;

    end;

    Hi Reema,

    ReemaPuri wrote:

    I wanted to show the numbers in the list of values up to not passed as a parameter.

    for example

    If the capacity is 3 then lov it should show 1,2,3

    Try this example

    SELECT LEVEL AS D, LEVEL AS R
    FROM DUAL
    CONNECT BY LEVEL <= (select 3 from dual);
    

    Here, instead of Select 3 of double replace your query giving you room capacity

    Hope this helps you,

    Kind regards

    Jitendra

Maybe you are looking for