Heirarchical filter item with checkboxes

Hi
We have a Bex query with a heirarchical charecterisitic filter.
Can we have checkboxes for the same in VC.
Please suggest
Regards
Lavanya

Not answered

Similar Messages

  • Web Application Designer 3.5 and Filter-Item with Structure

    Hello,
    I have the filter-item in a web application which is based on a query with a structure in the rows. Now I want to disable the visibility of the structure in the filter-element. Is that possible?
    Edited by: Gerrit Lober on Jun 9, 2008 2:15 PM

    Hi,
    is the structure in the rows the structure of the key figures? or did you create your own structure for the characteristics?
    don't think it's possible...
    ciao
    Joke

  • Filter report with checkbox

    I have a report (select A, B, C from TABLE1) on PAGE1
    I also added a little form on PAGE1. this form contains a list of checkbox generated dynamically with another query.
    I would like to filter my report with the values of the checked items in the form (so we get something like that : select A, B, C from TABLE1 where A in (checkbox1, checkbox4))
    Im using Apex 4
    Any idea how to achieve this ?
    thanks

    Hello quiqui42,
    You haven't given enough specific information about your situation, so I'll have to make some assumptions.
    I'm assuming that by "this form contains a list of checkbox generated dynamically with another query", you mean that you have a checkbox item that is based on a dynamic LOV. If this is the case, let's pretend that if checkbox 1 and checkbox 4 are checked, the value of the checkbox item (let's call it P1_FILTER) is "1:4".
    Now, there's probably lots of ways to do what you need to do, but I'll give you two. One is very easy, but could come at the cost of performance; the other is a little more involved but will execute much better on a large table, as long as what you're filtering on is indexed.
    Easy but potentially slow one:
    SELECT   a, b, c
      FROM   table1
    WHERE   INSTR(':' || :P1_FILTER || ':', ':' || a || ':') > 0;This could be a performance dog because it will not matter if column "a" is indexed - since you're running it thru a function the database will not use the index. Depending on the size of this table, this may or may not be a concern.
    Here is the more involved but better-performing one:
    1) Create a type:
    CREATE TYPE filter_vals AS TABLE OF VARCHAR2(10);      // replace varchar2(10) based on the size/type of your filter values2) Create a function:
    CREATE FUNCTION get_filter_vals(vals IN VARCHAR2)
       RETURN filter_vals
       PIPELINED
    IS
       arr  apex_application_global.vc_arr2 := apex_util.string_to_table(vals);
    BEGIN
       FOR i IN 1 .. arr.COUNT LOOP
          PIPE ROW (arr(i));
       END LOOP;
       RETURN;
    END get_filter_vals;3) Put this in the SQL for your report:
    SELECT   a, b, c
      FROM   table1
    WHERE   a IN (SELECT   COLUMN_VALUE FROM table(get_filter_vals(:P1_FILTER)));Step 1 creates a table type that is used by the function created in step 2. Step 2 is a pipelined function that turns a colon-delimited string (such as what is typically held in a list of checkboxes based on an LOV) into something that can be select-ed on just like a table. Finally, step 3 shows the query that uses the function in a way that allows a where-in clause, which will take advantage of an index on column "a" in a large table.
    Hope this helps,
    John

  • Report with Checkbox

    I am trying to follow the example shown at the below link but it is not working. I am modifying some of the code since I am using version 1.6. Any ideas as to what I may be doing wrong. The checkbox appears and I can select and deselect items but I cannot get P6_HOLDER to hold any of the values of the selected items. Thanks!
    http://apex-smb.blogspot.com/2009/01/apex-report-with-checkboxes-advanced.html
    First I created a page item called P6_HOLDER.
    Next I created a report region (sequence 40) with the below code.
    select htmldb_item.checkbox (1, dev_obj_id, 'onchange="spCheckChange(this);"',
    :P6_HOLDER, ':') checkbox, dev_id, dev_obj_desc from edm_dev_obj where
    dev_id = :P6_TEMP_DEV_ID
    **I then created a html region (sequence 1) with the below code**
    <SCRIPT src="http://www.google.com/jsapi"></SCRIPT>
    <SCRIPT>
    // Load jQuery
    google.load("jquery", "1.2.6", {uncompressed:true});
    function spCheckChange(pThis){
    var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=CHECKBOX_CHANGE',$v('pFlowStepId'));
    get.addParam('f01',pThis.value); //Value that was checked
    get.addParam('f02',pThis.checked ? 'Y':'N'); // Checked Flag
    gReturn = get.get();
    $f('checkListDisp').innerHTML=gReturn;
    </SCRIPT>
    CHECKBOX List:
    <DIV id=checkListDisp>&P6_HOLDER.</DIV>
    I then created an application process on Demand called CHECKBOX_CHANGE with the below code
    DECLARE
    v_item_val NUMBER := htmldb_application.g_f01;
    v_checked_flag VARCHAR2 (1) := htmldb_application.g_f02;
    BEGIN
    IF v_checked_flag = 'Y' THEN
    -- Add to the list
    IF :P6_HOLDER IS NULL THEN
    :P6_HOLDER := ':' || v_item_val || ':';
    ELSE
    :P6_HOLDER := :P6_HOLDER || v_item_val || ':';
    END IF;
    ELSE
    -- Remove from the list
    :P6_HOLDER := REPLACE (:P6_HOLDER, ':' || v_item_val || ':', ':');
    END IF;
    -- Just for testing
    HTP.p (:P6_HOLDER);
    END;

    Hi
    Create a page level validation (fucntion returning boolean) and write code similar to following
    DECLARE
    v_count NUMBER := 0;
    BEGIN
    FOR i IN 1..APEX_APPLICATION.G_F01.COUNT LOOP
    IF APEX_APPLICATION.G_F01(i) IS NOT NULL THEN
    v_count := v_count + 1;
    END IF;
    END LOOP;
    IF v_count = 0 THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    END;I take it your report query is similar to following
    select apex_item.checkbox(1,"PK_CLMN") Tick, col2, col3 FROM tbl_nameCheers,
    Hari

  • Open dialog box window with checkboxes for each child record - Please Help

    Hello Everybody
    I have a 10g form with master record and 20 child records. In the child record form, currently there is a “Notes” Editor, which pops up when user click the “Edit” button. In the “Notes” editor, user enters remarks if anything is missing. For example, typical remarks will be: Statement is missing, LOC paper is missing etc.
    Now, I would like to replace “Notes” editor with a dialog box. In the dialog box , I would like to add checkboxes with values “Statement is missing” and “LOC paper is missing” etc. along with “Notes” field. The user can select checkboxes. The value of the checkboxes should go in the “Notes” field with the ability to edit it. This way, user doesn’t need to type the most common notes every time.
    I have created a “NewNotes” dialog box with checkboxes and multiline text Item. It is pops up when I click on the button. I have also created to WHEN_CHECKBOC_CHANGED trigger for each checkboxes so that the its value will go in a multiline text item.
    But, I am not sure how I can link “NewNotes” dialog box to the each record in child record block. I would really appreciate it if anybody could give me some idea.
    Thanks,

    if i understand correctly you have a note item (based on table) on every child record? when you open the dialog box: how do you put data from notes to dialog box? in the same way as you can write it back ...

  • Trying to compare item with number in PL/SQL report

    Hi,
    I'm using for my report SQL Query (PL/SQL Function body returning SQL Query). And I found that I can't to write:
    if v('ITEM_NAME')=1 then ..., because it is 'missing expression' error.
    I can only
    if v('ITEM_NAME') IS NULL then ...
    or
    if v('ITEM_NAME') IS NOT NULL then ...
    Why I can't to compare item value, for example, with number?
    Thanks!
    Karina.

    Hi,
    I'm using my own htmldb installation. The reports' code is:
    DECLARE
    q varchar2(10000);
    v_lesst_str varchar(255);
    v_lesst_stmt_2 VARCHAR2(100):='select lesst_id from lesson_types';
    v_meas_str varchar(255);
    v_meas_stmt_2 VARCHAR2(100):='SELECT meas_id FROM project_measures';
    BEGIN
    if v('P16_LESSONS_TYPE') is null THEN v_lesst_str:=v_lesst_stmt_2;
    ELSE v_lesst_str:=v('P16_LESSONS_TYPE');
    END IF;
    if v('P16_PRO_MEASURE') is null THEN v_meas_str:=v_meas_stmt_2;
    ELSE v_meas_str:=v('P16_PRO_MEASURE');
    END IF;
    q:='SELECT distinct ul.title, ul.summary, ul.details, ul.less_id
    FROM user_lessons ul
    WHERE ul.lesst_lesst_id IN ('||v_lesst_str||')
    AND ul.meas_meas_id IN ('||v_meas_str||')';
    return q;
    END;
    The error is occurred when I'm trying to compare item with number, for example, v('P16_LESSONS_TYPE')=1 in if condition.
    And the errors' text is next:
    "#1 error has occurred
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00936: missing expression"
    Karina.

  • Problem with checkbox on table component

    Hello i am having a problem with checkbox in table component
    i am developing something like a shopping cart app and i have a checkbox in my table component , i want users to select items from the checkbox to add to thier cart, They can select the items from cartegory combobox , my problem is when they select the items from the checkbox if they select another category the alread selected once do not display in my collection opbject please how can i maintain the state of the already selected items in my collection object

    Hi,
    Please go through the tutorial "Understanding scope and managed beans". This is available at:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/scopes.html
    The details of the selected items need to be stored in an object that is in session scope.
    Hope this helps
    Cheers
    Girish

  • Problem with checkbox and process

    Hallo,
    I have a checkbox on my page and now I want to create a process that runs when the checkbox is checked.
    What I want to do is: to ckeck wheather the checkbox is check and if this is then to set values.
    I don't know if it is right how I check the status of the checkbox. What I also don't really know how I can decide
    that all field I go through in the loop get the same value from the XYZ-collection. The value should be the last from
    the XYZ-collection.
    Thanks, Jade
    declare
    check integer:=0;
    change integer:=0;
    begin
    check:=:Px_Check;
    if (check <> 0) then change:=1; end if;
    if change = 1 then
    for i in 1..htmldb_application.g_f04.count
    loop
    htmldb_collection.update_member_attribute(p_collection_name=>'XYZ',
    p_seq=>i,
    p_attr_number=>5,
    p_attr_value=>???);
    end loop;
    end if;
    end;

    Hi,
    Taking the two issues separately....
    1 - When dealing with checkboxes, you have to bear in mind that the submit process will only return the values of those checkboxes that have been ticked into the f04 collection (assuming f04 is the column containing your checkboxes). In order to determine which ones they are, you need to get the value (which should be a row number if you've created the checkboxes by using the Row Selector option) and then use that to get to the values on the actual rows. Something like:
    DECLARE
    vITEM NUMBER;
    BEGIN
    FOR i IN 1..HTMLDB_APPLICATION.G_F04.COUNT
    LOOP
      vITEM := HTMLDB_APPLICATION.G_F04(i);
    END LOOP;
    END;Then, within the loop, you can use vITEM as the row number. So, if the user ticked items 1, 4 and 6. G_F04(1) would contain 1, G_F04(2) would contain 4 and G_F04(3) would contain 6. Therefore, for you update statement, you can use vITEM for the sequence number of the item to update.
    2 - When dealing with collections, if you want to get to the last item in the collection, you can get the member count and use that to get to the member:
    DECLARE
    vCOUNT NUMBER;
    vDATA NUMBER;
    BEGIN
    vCOUNT := HTMLDB_COLLECTION.COLLECTION_MEMBER_COUNT ('XYZ');
    SELECT c005 INTO vDATA FROM HTMLDB_COLLECTIONS WHERE COLLECTION_NAME = 'XYZ';
    END;That should get the c005 value for the last item and store it in vDATA. You can then update the ticked items with this value.
    Andy

  • How to handle multiple selection in the Spark List control with checkbox as itemrenderer?

    Hi All,
    I am using checkbox as an ItemRenderer in spark list.
    I have a query.
    how to handle multiple selection in the Spark List control with checkbox as itemrenderer?
    how to retrieve the selected item label?
    Thank you in advance.

    Hi there, I'll tweak your code a little bit to something like this:
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                    layout="vertical">
        <mx:Script>
            <![CDATA[
                 import mx.events.ListEvent;
                 import mx.controls.CheckBox;
               [Bindable]
               private var mySelectedIndexes:ArrayCollection=new ArrayCollection();
                private function onChange(e:ListEvent):void
                   if(CheckBox(e.itemRenderer).selected){
                             mySelectedIndexes.addItem(e.rowIndex);
                   }else{
                                  mySelectedIndexes.removeItemAt(mySelectedIndexes.getItemIndex(e.rowIndex));     
                   chkList.selectedIndices=mySelectedIndexes.toArray();
            ]]>
        </mx:Script>
    <mx:ArrayCollection id="collection">
            <mx:Object label="Test A"/>
            <mx:Object label="Test B"/>
            <mx:Object label="Test C"/>
            <mx:Object label="Test D"/>
            <mx:Object label="Test E"/>
            <mx:Object label="Test F"/>
            <mx:Object label="Test G"/>
        </mx:ArrayCollection>
    <mx:List id="chkList" dataProvider="{collection}" itemRenderer="mx.controls.CheckBox"  itemClick="onChange(event);" allowMultipleSelection="true"/>
    </mx:Application>

  • Report with checkboxes

    Hi all,
    I have a report with checkboxes getting the empno in return
    I have
    select apex_item.checkbox(1, empno) cbox,a.empno, a.ename,a.mgr,a.deptno from emp a
    in the report....
    I do have a dummy hidden field(P2_EMPNOS) which stores the empno's into it with comma concatenated(for which i wrote a page process)
    DECLARE
    vRow BINARY_INTEGER;
    BEGIN
    :P2_EMPNOS := NULL;
    :P2_EMPNOS :=apex_application.g_f01(1);
    FOR i IN 2 .. apex_application.g_f01.COUNT
    LOOP
    :P2_EMPNUMS :=
    :P2_EMPNOS
    || ','
    || apex_application.g_f01(i);
    END LOOP;
    END;
    in my next page I want the records that I have selected like this
    select a.empno, a.ename,a.mgr,a.deptno
    from emp a
    where empno in :P2_EMPNOS
    I did tried (:P2_EMPNOS),':P2_EMPNOS'
    The problem is if I select one checkbox, then in the next page I'm getting that one record....
    but If I select multiple, then starts trouble...it says "no data found"...but still the values can be viewed in the next page with comma separated
    Can some body help me in this please.
    Thanks in advance.
    Gora

    Hello Varad,
    Thankyou for the quick response.
    The problem here is....my item is getting the selected values as a string(i guess ;) )
    i think we have to figure out how we could break it and send those as single values.
    Any more guesses please...
    Regards,
    Gora

  • SSRS 2012 (SP Integrated) report on SP 2013 PerformancePoint Dashboard: when too many filter items selected together report does not update anymore!

    I am having a situation with SSRS 2012 (SP-integrated) report rendered on SP 2013 PerformancePoint Dashboard using linked PerformancePoint (PP) filters.
    The report works fine as long as too many PP filter items are not selected at the same time. When gradually selecting more items from the filter, the report updates itself until more than a sepecific numer of filter items are selected - the report simply
    does not update itself anymore. This "specific number of filter items", when hit, generates the following error in ULS:
    An exception  occurred while rendering a Web control. The following diagnostic information might help to determine the cause of this problem:  System.UriFormatException: Invalid URI: The hostname could not be parsed.    
     at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)    
     at System.UriBuilder..ctor(String uri)    
     at Microsoft.PerformancePoint.Scorecards.ServerRendering.ReportViewControl.ReportUrl(SqlReportViewData sqlReportViewData)    
     at Microsoft.PerformancePoint.Scorecards.ServerRendering.ReportViewControl.RenderSqlReport(TextWriter writer, ReportView sqlReportView)    
     at Microsoft.PerformancePoint.Scorecards.ServerRendering.ReportViewControl.RenderReportViewControl(HtmlTextWriter writer, ReportView rv)  PerformancePoint Services error code 20700.
    I already know that the cause of the issue is in the length of the query (perhapse RDL or MDX) that the browser is supposed to pass on to the instance of SSAS.
    Some people had suggested a workaround that was suitable for older versions or non-integrated SSRS (see here: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/cb6ede72-6ed1-4379-9d3c-847c11b75b32/report-manager-operation-cannot-run-due-to-current-state-of-the-object).
    Knowing this, have already done the changes suggested (adding the lines suggested to SP's web.config for Reporting and the web.config of the site on which report is rendred) at no avail, just to make sure.
    I have rednered the same report on the same dashboard using SSRS filters and there is no problem; it just works fine. This has to be a bug in PP that is causing this.
    Has anyone had the same problem with SSRS 2012 (SP-integrated) report rendered on SP 2013 PP dashboard using PP filter? Any fixes or workarounds?
    thnx!

    Hello everybody.
    I confirm the issue in Service Pack 1 Release 2.
    Poor workaround is to remove the repeated infromation from the member keys (in SSAS they can be really long).
    The issue seems to be specific to SSRS: Excel Services works well with the same filter.
    Sergey Vdovin

  • Filter items are not set via Redirect to a javascript function

    Hi,
    i have a page with a few filter items and a button which redirects to a javascript function. The problem is that the filter items are NULL in the called javascript function. If i do a submit via another button before then it works.
    Here the details:
    URL Target of the button: javascript:callReport('f?p=&APP_ID.:1:&SESSION.','bir.bir_api.printReportBi?pSessionId=&SESSION.&pBu=&P250_FILTER_BU.&pSupplyTeam=&P250_FILTER_SUPPLY_TEAM.&pMaxBiEff=&P250_FILTER_BI_EFF_MAX.&pGroup=&P250_FILTER_GROUP.');
    Called javascript function:
    function callReport(p_href,p_url)
      var url;
      url = document.getElementById(p_url).value;
      w = open(url,"winRep","Scrollbars=1,resizable=1,width=1100,height=800");
      if (w.opener == null)
        w.opener = self;
        w.focus();
      // wait 5 seconds before reloading
      setTimeout("waitSome()",100);
    Many thanks in advance.
    Regards,
    Martin

    Hi Martin,
    In my example I do a refresh of the report region using  adynamic action. In the report source I've set my filter item as "Page item to submit".
    To open the link for the pdf report I use a dynamic action that fires after refresh of the report region.
    That's it.
    If you want to use your callReport function and need to submit your filter items first, you could try using a ajax post to send the filter values to the database. There's a nice explanation on ajax post in this blog:
    http://apextips.blogspot.nl/2012/09/apex-ajax-basics.html
    Good luck,
    Vincent

  • How to find control,  jListBox with checkBoxs

    Hello Everyone
    Using Jclient/Swing application i want to use listbox with
    checkBoxs.
    Suppose listbox display list of items along with
    these checkboxs.And these checkbox varies according the
    items aviable in listbox.
    whether this type control available in jDeveloper or not.

    Thanks for reply !
    i found swing code for jListBox containing checkboxs.
    So how to use this class in Jdeveloper for using as
    a control.
    Please tell me suggetion?
    public class CheckBoxList extends JFrame
         protected JList m_list;
         //protected JLabel m_total;
         public CheckBoxList()
              super("Swing List [Check boxes]");
              setSize(360, 340);
              getContentPane().setLayout(new FlowLayout());
              InstallData[] options = {
              new InstallData("Program executable", 118),
              new InstallData("Help files", 52),
              new InstallData("Tools and converters", 83),
              new InstallData("Source code", 133),
              new InstallData("Project",147),
    new InstallData("Search",188),
    new InstallData("Edit",189),
    new InstallData("Girdher",3445)
              m_list = new JList(options);
              CheckListCellRenderer renderer = new CheckListCellRenderer();
              m_list.setCellRenderer(renderer);
              m_list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
              CheckListener lst = new CheckListener(this);
              m_list.addMouseListener(lst);
              m_list.addKeyListener(lst);
              JScrollPane ps = new JScrollPane();
              ps.getViewport().add(m_list);
    //          m_total = new JLabel("Space required: 0K");
              JPanel p = new JPanel();
              p.setLayout(new BorderLayout());
              p.add(ps, BorderLayout.CENTER);
         //p.add(m_total, BorderLayout.SOUTH);
              p.setBorder(new TitledBorder(new EtchedBorder(),
                   "Please select options:") );
              getContentPane().add(p);
              WindowListener wndCloser = new WindowAdapter()
                   public void windowClosing(WindowEvent e)
                        System.exit(0);
              addWindowListener(wndCloser);
              setVisible(true);
         //     recalcTotal();
    /*public void recalcTotal()
              ListModel model = m_list.getModel();
              int total = 0;
              for (int k=0; k < model.getSize(); k++)
                   InstallData data = (InstallData)model.getElementAt(k);
                   if (data.isSelected())
                        total += data.getSize();
              m_total.setText("Space required: "+total+"K");
         public static void main(String argv[])
              new CheckBoxList();
    class CheckListCellRenderer extends JCheckBox implements ListCellRenderer
         protected static Border m_noFocusBorder =
              new EmptyBorder(1, 1, 1, 1);
         public CheckListCellRenderer()
         super();
         setOpaque(true);
         setBorder(m_noFocusBorder);
         public Component getListCellRendererComponent(JList list,
              Object value, int index, boolean isSelected, boolean cellHasFocus)
              setText(value.toString());
              setBackground(isSelected ? list.getSelectionBackground() :
              list.getBackground());
              setForeground(isSelected ? list.getSelectionForeground() :
              list.getForeground());
              InstallData data = (InstallData)value;
              setSelected(data.isSelected());
              setFont(list.getFont());
              setBorder((cellHasFocus) ?
                   UIManager.getBorder("List.focusCellHighlightBorder")
                   : m_noFocusBorder);
              return this;
    class CheckListener implements MouseListener, KeyListener
         protected CheckBoxList m_parent;
         protected JList m_list;
         public CheckListener(CheckBoxList parent)
              m_parent = parent;
              m_list = parent.m_list;
         public void mouseClicked(MouseEvent e)
              if (e.getX() < 20)
                   doCheck();
         public void mousePressed(MouseEvent e) {}
         public void mouseReleased(MouseEvent e) {}
         public void mouseEntered(MouseEvent e) {}
         public void mouseExited(MouseEvent e) {}
         public void keyPressed(KeyEvent e)
              if (e.getKeyChar() == ' ')
                   doCheck();
         public void keyTyped(KeyEvent e) {}
         public void keyReleased(KeyEvent e) {}
         protected void doCheck()
              int index = m_list.getSelectedIndex();
              if (index < 0)
                   return;
              InstallData data = (InstallData)m_list.getModel().
                   getElementAt(index);
                   data.invertSelected();
                   m_list.repaint();
              //     m_parent.recalcTotal();
    class InstallData
    protected String m_name;
    protected int m_size;
    protected boolean m_selected;
    public InstallData(String name, int size)
         m_name = name;
         m_size = size;
         m_selected = false;
    public String getName() { return m_name; }
    public int getSize() { return m_size; }
    public void setSelected(boolean selected) { m_selected = selected;}
    public void invertSelected() { m_selected = !m_selected; }
    public boolean isSelected() { return m_selected; }
    public String toString() { return m_name+" ("+m_size+" K)"; }

  • TreeView with checkboxes

    Hi,
    I was wondering if anyone had a simple solution on using a TreeView control with checkboxes.
    The only required functionality would be:
    Clicking on the CheckBox beside an item that has children will result in all children also becoming selected/unselected.
    Clicking on the CheckBox beside an item that has a parent will result in the parent also becoming selected.
    Currently I'm just adding a checkbox and some other stuff to a hbox that goes into .setGraphic() in the cellfactory of the tree and then trying to code everthing that needs to be done in the action event of the added checkbox. This is problematic in many ways :)
    I just know there is a clean solution for this out there!
    Cheers,
    Nuwanda

    I implemented this a while ago using a custom TreeCell and also by extending TreeItem to have selected and indeterminate properties. This means you have to build the TreeView using CheckBoxTreeItem instances, and with the custom cell factory, but once you do that it works as expected. I've put up a screenshot at [1], and will have a download at [2] next week during my JavaOne talk.
    [1] http://www.javafxdata.org/screenshots/CheckBoxCell-TreeView.PNG
    [2] http://www.javafxdata.org
    -- Jonathan

  • Accessing Node Labels - TreeControl with CheckBoxes

    Hello,
    I have a Tree component that is loaded with CheckBoxes.  Each node has a label associated with it, and I need to be able to collect the labels and display them on the right of the component - probably using a Label or Text control.
    I can't seem to figure out how to access the names of the items that are checked.  I'm including a complete, and simplified, mxml file.  If anyone would like to take a look at it, I would appreciate it.
    Thanks.
    OH - And I am using the Tree CheckBox component from this site:  http://www.sephiroth.it/file_detail.php?id=151
    Sorry, but the forum will not allow me to upload the files directly.
    You will probably need to add those classes to see the Tree CheckBox.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:controls1="it.sephiroth.controls.*">
        <mx:Script>
            <![CDATA[
                import mx.events.DataGridEvent;
                import mx.controls.dataGridClasses.DataGridColumn;
                import mx.effects.easing.Bounce;
                import mx.effects.easing.Elastic;
                import components.MyPanel;
                import mx.effects.easing.Bounce;
                import mx.effects.easing.Elastic;
                import mx.events.MenuEvent;
                import mx.controls.Alert;
                import mx.controls.Menu;
                import mx.events.CloseEvent;
                import mx.controls.*;
                import mx.events.ListEvent;
                import mx.events.TreeEvent;
                import it.sephiroth.renderers.TreecheckboxItemRenderer;
                //*******************************  TREE CONTROL CHECKBOX ******************************************
                 * Called on checkbox click
                 * check and update for both parents and child nodes
                 * according to the checkbox status
                private function onItemCheck( event: TreeEvent ): void
                    updateParents( event.item as XML, ( event.itemRenderer as TreecheckboxItemRenderer ).checkBox.checkState );
                    updateChilds( event.item as XML, ( event.itemRenderer as TreecheckboxItemRenderer ).checkBox.checkState );
                 * @see it.sephiroth.controls.CheckBoxExtended#checkState
                private function updateChilds( item:XML, value: uint ):void
                    var middle: Boolean = ( value & 2 << 1 ) == ( 2 << 1 );
                    var selected: Boolean = ( value & 1 << 1 ) == ( 1 << 1 );
                    if( item.children( ).length( ) > 0 && !middle )
                        for each(var x: XML in item.node )
                            x.@checked = value == ( 1 << 1 | 2 << 1 ) ? "2" : value == ( 1 << 1 ) ? "1" : "0";
                            updateChilds( x, value );
                private function updateParents( item: XML, value: uint ): void
                    var checkValue: String = ( value == ( 1 << 1 | 2 << 1 ) ? "2" : value == ( 1 << 1 ) ? "1" : "0" );
                    var parentNode: XML = item.parent( );
                    if( parentNode )
                        for each(var x: XML in parentNode.node )
                            if( x.@checked != checkValue )
                                checkValue = "2"
                        parentNode.@checked = checkValue;
                        updateParents( parentNode, value );
            ]]>
        </mx:Script>
        <!--*********************  CHOOSE FUNCTIONAL AREAS/CAPABILITIES FOR SCENARIO TREE DATA ******************-->
        <!--
            Example of the xml used as dataprovider
            for the treecheckbox component.
            @label used for the item label
            @checked used for the checked status:
                0 = un-checked
                1 = selected
                2 = 3rd status selected
                otherwise you can use the set the "checkField" attributes of the
                treecheckbox component to specify which xml attribute to use for the
                checked status
        -->
            <mx:XML xmlns="" id="treeSource">
                <node label="home" checked="">
                    <node label="First Responder" checked="">
                        <node label="1RSP First Responder - Medical" checked=""/>
                    </node>
                    <node label="Battalion Aid Station/Sick Call" checked="">
                        <node label="Battalion Aid Station" checked=""/>
                        <node label="BAS - NBC" checked=""/>
                        <node label="Evac" checked=""/>
                    </node>
                    <node label="Forward Resuscitative Surgery (FRSS)" checked="">
                        <node label="Pre-Op" checked=""/>
                        <node label="Operating Room" checked=""/>
                        <node label="Post-Op" checked=""/>
                        <node label="Evac" checked=""/>
                    </node>
                    <node label="Surgical Company" checked="">
                        <node label="Triage/SST" checked=""/>
                        <node label="Triage Evac" checked=""/>
                        <node label="Operating Room" checked=""/>
                        <node label="OR Evac" checked=""/>
                        <node label="OR Evac" checked=""/>
                        <node label="Ward" checked=""/>
                        <node label="X-Ray" checked=""/>
                        <node label="Laboratory" checked=""/>
                        <node label="Pharmacy" checked=""/>
                        <node label="NBC Unit" checked=""/>
                        <node label="Dental" checked=""/>
                        <node label="PMO/EHO/PMT" checked=""/>
                        <node label="PM Entomology" checked=""/>
                        <node label="Occupational and Environmental Healty Sur" checked=""/>
                    </node>
                </node>
            </mx:XML>
            <controls1:TreeCheckBox id="mytree"
                showRoot="false"
                width="345"
                height="100%"
                dataProvider="{treeSource}"
                openItems="{treeSource..node}"
                labelField="@label"
                checkField="@checked"
                itemCheck="onItemCheck( event )"
            />
            <mx:Label x="455" y="48" text="Label" fontSize="16" color="#FFFFFF" id="tree_label1"/>
    </mx:Application>

    Natasha,
    Thanks for your reply.
    I attempted the code:
    public function get labelText():String 
     if (this.label != null) 
    return this.label.text 
    else
     return ""; 
    return "";
    But when I try to access the code in the application I get the error "Call to possibley undefined method labelText."
    I'm not sure I understand exactly how to implement this change within the application itself.  Could you explain?  Thanks.

Maybe you are looking for

  • How to call workflow api in procedure?

    I created a process in workflow,i call CreateProcess to starting from my procedure.But when i call the procedure in sqlplus i got a error message.That is ,ORA-20002: 3114: activity 'XTes/tes1' is not a process. Is there something wrong when i call Cr

  • Podcast is not showing up in iTunes podcast section

    Hi I've got a podcast that use to show up in iTunes but now it doesn't. I'm not sure but I think it has to do with how my content is produced. If you want to check it out the URL is http://www.archiveclassicmovies.com/acm.rss. Thanks, Scott

  • Dcnm install with red hat X11

    Hello I would like to know if i can install dcnm for red hat with X11 forwarding , X11 is working , but I can't lauch .bin here the result: sh dcnm-installer-x64-linux.6.3.2.bin Preparing to install... Extracting the JRE from the installer archive...

  • Session tracking help please

    Hi everyone ! I had an application working under Websphere 3.5.4 and JDK 1.2.2. This application used many session variables. I have stopped working on it, and now that I want to use again, I get this stupid usual : Unhandled error! You might want to

  • Create generic HTTPService class

    I am trying to create a generic HTTPService class. I am using this code as my starting point: import mx.controls.Alert; import mx.rpc.http.HTTPService; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; private var service:HTTPService