Problem regarding multiple itemrender in same column.

<?xml version="1.0"?>
<!-- itemRenderers\inline\CBInlineCellEditor.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            [Bindable]               
            private var myDP:ArrayCollection = new ArrayCollection([
                {label1:"Order #2314", contact:"John Doe",
                    quant:3, solddate:new Date(2005, 0, 1), Sent:true, CompInd : 0},
                {label1:"Order #2315", contact:"Jane Doe",
                    quant:3, solddate:new Date(2005, 0, 5), Sent:false, CompInd : 1}
        ]]>
    </mx:Script>
    <mx:DataGrid id="myDG"
            dataProvider="{myDP}"
            variableRowHeight="true"
            width="600" height="250"
            editable="true">
        <mx:columns>
            <mx:DataGridColumn dataField="label1"
                headerText="Order #"
                editable="false"/>
            <mx:DataGridColumn dataField="quant"
                headerText="Quantity"
                itemEditor="mx.controls.NumericStepper" 
                editorDataField="value"/>
            <mx:DataGridColumn dataField="solddate" headerText="Date"  itemRenderer="mx.controls.DateField" rendererIsEditor="true" editorDataField="selectedDate"/>
            <mx:DataGridColumn dataField="Sent" editable="false" >
            <mx:itemRenderer>
                    <mx:Component>
                    <mx:HBox>
                         <mx:Script>
                             <![CDATA[
                                 private function fun1():void
                                     if(data.Sent == true)
                                         data.Sent = false;
                                     else
                                         data.Sent = true;
                                     outerDocument.myDG.dataProvider.refresh();
                             ]]>
                         </mx:Script>
                         <mx:CheckBox change="fun1();" />
                    </mx:HBox>
                    </mx:Component>
                    </mx:itemRenderer>
            </mx:DataGridColumn>
            <mx:DataGridColumn dataField="solddate1" headerText="Col1" width="200" >
                <mx:itemRenderer>
                    <mx:Component>
                        <mx:ViewStack selectedIndex="{data.Sent == true ? 0 : 1}" >
                            <mx:HBox>
                                <mx:DateField selectedDate="{data.solddate}"/>
                            </mx:HBox>   
                            <mx:HBox>
                                <mx:TextInput text="{data.solddate.toString()}" width="150"/>
                            </mx:HBox>
                        </mx:ViewStack>
                    </mx:Component>
                </mx:itemRenderer>
            </mx:DataGridColumn>
        </mx:columns >
    </mx:DataGrid> 
</mx:Application>
Problem ::
In above example, I am showing datagrid where column "Col1" having multiple item renderers. On change of checkbox from "Sent" column, I am dynamically displaying either of the item renderers. i.e., if checkbox is false then datefield else textinput field.
But when I type in text in textinput, then after outfocus still it displays that textinput in the datagrid cell. I want it to display only label in that cell.i want Same behaviour just like editable column when chkbox is select. and default show renderer in datagrid.
Thanks,
Amol

If you want to show a label, add a label to the renderer or convert your
renderer to an itemEditor

Similar Messages

  • Problem using multiple contexts in same thread

    Hello,
    I am having problem using multiple contexts in the same thread. Here is the scenario:
    front-end is calling a ejb1 with a user1 and password. Ejb1 is then calling ejb2
    using user2 and password. I am getting security exception when calling ejb2 with
    the message user1 is not authorized. Looking at the documentation, context 2 should
    be pushed on stack on top of context 1 and context 2 should then be used until
    context.close() is called. It looks like this is not the case in this scenario?
    Regards,
    Jeba Bhaskaran

    I have the GTX670. So pretty much the same.
    When I go to  Edit>Preferences>Playback I see:
    When I select the monitor I am not currently using for Premiere Pro, the Program Monitor shows up full size at 1920X1080 in that monitor.
    While that may not help you, at least you know a similar card can do the job and you know that it should work.. What happens if you drop down to two monitors? Will it work then?
    Also, have you performed the hack that allows Premiere Pro to use the card since that card is not in the file? I have no idea if that is relevant at all, by the way. It is just an attempt at getting our systems to work the same way.

  • Multiple values from same column in diffetent columns in same row??

    Hi all,
    I am wondering how you can display different values from the same column into different columns on same row. For example using a CASE statement I can:
    CASE WHEN CODE IN ('1', '3') THEN COUNT( ID) END as "Y"
    CASE WHEN CODE NOT IN ('1', 'M') THEN COUNT( ID) END as "N"
    Yes this will produce two columns needed but will also produce two separate records and null values for the empty's.
    Any ideas?
    Thanks

    It's not clear what you want.
    Can you post some examples as described in the FAQ: {message:id=9360002}
    As my first guess, I would think you're looking for something like...
    SQL> select * from emp;
         EMPNO ENAME      JOB              MGR HIREDATE                    SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-1980 00:00:00        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-1981 00:00:00       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-1981 00:00:00       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-1981 00:00:00       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-1981 00:00:00       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-1981 00:00:00       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-1981 00:00:00       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-1987 00:00:00       3000                    20
          7839 KING       PRESIDENT            17-NOV-1981 00:00:00       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-1981 00:00:00       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-1987 00:00:00       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-1981 00:00:00        950                    30
          7902 FORD       ANALYST         7566 03-DEC-1981 00:00:00       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-1982 00:00:00       1300                    10
    14 rows selected.
    SQL> select count(case when deptno in (10,20) then deptno end) as deptno_10_20
      2        ,count(case when deptno > 20 then deptno end) as deptno_30plus
      3  from emp;
    DEPTNO_10_20 DEPTNO_30PLUS
               8             6

  • Multiple indexes using same columns on one table - is this doable?

    Hi
    I have a table like MyTab(a int, b int), and I am required to create a primary key index and a non-unique index on this table using columns (a,b) in a specific table space.
    The back end database is Oracle 10g.
    Here's what I have tried so far, needless to say, unsuccessfully.
    Alter Table MyTab
    Add Constraint c_1 primary key (a, b)
    Using Index (Create index mytab_idx on MyTab(a, b))
    Using index tablespace results_index
    So my question are:
    1. is this is possible? if so, what is the correct syntax.
    2. assuming it is possible, has anyone used this sort of construct before? it appears to be conflicting and inconsistent to me.
    Many thanks, and kind regards,
    Naran

    Naran H wrote:
    Hi
    I have a table like MyTab(a int, b int), and I am required to create a primary key index and a non-unique index on this table using columns (a,b) in a specific table space.
    The back end database is Oracle 10g.
    Here's what I have tried so far, needless to say, unsuccessfully.
    Alter Table MyTab
    Add Constraint c_1 primary key (a, b)
    Using Index (Create index mytab_idx on MyTab(a, b))
    Using index tablespace results_index
    You can't have the unique and non-unique indexes in place at the same time, but you can have the non-unique index supporting the unique (PK) constraint.
    I guess your problem is that you don't want to have an interval of time where you have dropped the existing unique index while you create the replacement.
    The only current way I can think of for getting from:
    unique index(a,b)
    to
    non-unique index(a,b) with PK constraint (a,b)
    without having a point in time where bad data can appear, and with minimal locking is:
    create unique index (b,a) online;
    drop index (a,b);
    create non-unique index(a,b) online;
    add primary key using index (a,b) enabled, novalidate
    validate primary key
    drop index (b,a)Regards
    Jonathan Lewis

  • Ethernet Problem with Multiple users on same Mac

    Hi, sorry i advance for my english. I am writing from italy.
    I have an imAc with 2 users profiles on it. one profile is administratoe, and the oter a standard user.
    I also have a time capsule configured to connect to my network with the ethernet cable. the cable is plugged in the wan pot, the configuration is "bridged" and i use as a router a linksys wifi router.
    well. suppsung that i am logging in with one of my users and access to time capsule wirelessly, it shows me the disk content.
    i then swith to the other user without logging off the first one and then access time capsule where i see the same folfder and i can access it. so everything works fine.
    in the case i connect my mac with ethernet (disabling airort) to my linksys router, ifuser 1mounts time capsule, user 2 can't access it if user 1 does not unmount.
    why so?
    i need to switch from user 1 to user 2 without logging off, and i don't understand why it works wirless and not with ethernet..
    thak you
    paolo

    In fact, all my page beans are in REQUEST scope...
    The only bean in Application scope is the standard applicationBean created by Creator itself.
    We use one Bean in session scope which contains another class.
    I will try to explain our common process:
    - when logging into the app, the session Bean stores user data (rights for using app,...);
    - when navigating in the app, the user can search data, modify them and create one (if he has the right to do it);
    - to define the screen, we use a lot the beforeRenderResponse();
    - when viewing a data, the user can choose to modify it, so depending on the action, the page is in "CONSULT" mode or "MODIFY" mode. In the second one, he can display new gridPanel (as a subform) to populate datatable.
    The problem is obvious while using this grid: my grid can disappear if someone else has validated his form before me and if my page goes trough the beforeRender of my page.
    It is not really clear. If needed, i can give access to our application to show the problem (and msn adress too to talk about it).
    Thank you

  • Urgent - problem with multiple users on same page

    Hi all,
    I have got an big problem with my app:
    when several users are using the same page, the action launched by USER_A affects the page displayed and used for USER_B.
    If there is only one user using the page, there is no problem at all.
    The webapp is deployed on Tomcat or JBoss and the problem remains the same on both.
    Thank you for your help.
    PS: I am not accurate because I don't know what to paste here.

    In fact, all my page beans are in REQUEST scope...
    The only bean in Application scope is the standard applicationBean created by Creator itself.
    We use one Bean in session scope which contains another class.
    I will try to explain our common process:
    - when logging into the app, the session Bean stores user data (rights for using app,...);
    - when navigating in the app, the user can search data, modify them and create one (if he has the right to do it);
    - to define the screen, we use a lot the beforeRenderResponse();
    - when viewing a data, the user can choose to modify it, so depending on the action, the page is in "CONSULT" mode or "MODIFY" mode. In the second one, he can display new gridPanel (as a subform) to populate datatable.
    The problem is obvious while using this grid: my grid can disappear if someone else has validated his form before me and if my page goes trough the beforeRender of my page.
    It is not really clear. If needed, i can give access to our application to show the problem (and msn adress too to talk about it).
    Thank you

  • Problems with multiple devices using same apple ID

    I have a Macbook, iPad and iPhone. After doing an IOS update now my devices keep saying I cannot use that same appleid because it's already taken. I cannot find away around this and want to know experience of others

    That warning occurs only if you try to create a new Apple ID using an email address already in use. An existing Apple ID can be used with mutiple devices. 
    What exactly did you do when you got that message?

  • Problem with multiple instances of same module

    I want to call the same module in several different
    viewstates. Based on a variable for each viewstate the module
    returns different results. Here is a shortened version of my code:
    private var lm:linkModule;
    private function moduleHandler(promotion:String):void
    lm = linkModule(lm1.child);
    lm.initHandler(promotion);
    <mx:ViewStack id="estonishViewStack" width="100%"
    height="100%">
    <mx:Canvas x="0" y="0" width="100%" height="100%"
    id="saleView" label="Sales">
    <mx:ModuleLoader id="lm1" url="modules/linkModule.swf"
    ready="moduleHandler('sale');" />
    </mx:Canvas>
    <mx:Canvas x="0" y="0" width="100%" height="100%"
    id="seasonalView" label="Seasonal">
    <mx:ModuleLoader id="lm1" url="modules/linkModule.swf"
    ready="moduleHandler('seasonal');" />
    </mx:Canvas>
    </mx:ViewStack>
    Is there a more elegant (shorter) way to code the
    actionscript function other than a number of "if" statements based
    upon the variable or module id?

    Thanks for the comment. I purposely used the same id in the
    example. I need to call the same module in about 10 different
    viewstates. I was wondering is there a way around 10 different "if"
    statements in my moduleHandler function with lm1.child, lm2.child,
    etc.
    Possibly some way to write the function with lm(i).child?
    Then I give each component a different component name.

  • Problem with running multiple servlet in same webapplication with tomcat 3

    Hi all,
    I am using Tomcat 3.0 as webserver with jdk1.3, Servlet 2.0,
    Templates for html file and oracle 8i on UNIX platform.
    I have problem with multiple servlet running same webapplication.
    There are two servlet used in my application. 1) GenServlet.class
                   and 2) ServletForPrinting.class
    All of my pages go through GenServlet.class which reads some property files
    and add header and footer in all pages.
    I want reports without header & footer that is not possible through GenServlet in my application.
    So I have used another servlet called ServletForPrinting --- just for reading html file.
    It is as follow:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ServletForPrinting extends HttpServlet {
    public void service (HttpServletRequest request,
    HttpServletResponse response) throws ServletException, IOException
    // set content-type header before accessing the Writer
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    File f1 = null;
    String report = null;
    String path = request.getPathInfo();
    try{
    String p = "/var/home/latif/proj/webapps/WEB-INF/classes" + path;
    System.out.println(p);
    f1 = new File(p);
    p = null;
    if (f1.exists()) {
    FileReader fr = new FileReader(f1);
    BufferedReader br = new BufferedReader(fr);
    report = new String();
    while ((report = br.readLine()) != null) {
    out.println(report);
    }catch(Exception e) {
    out.close();
    report = null;
    path = null;
    f1 = null;
    } // end class
    It works fine and display report properly.
    But now Problem is that if report is refreshed many times subsequently,
    WebServer will not take any new change in any of java file used in web-application.
    It works with the previous class only and not with updated one.
    Then I need to touch it. As soon as I touch it, webserver will take updated class file.
    Anybody has any idea regarding these situation?
    Is there any bug in my ServletForPrinting.java ?
    Any solution ????? Please suggest me.
    Suggestion from all are invited. That will help me a lot.
    Thanks in advance
    Deepalee.

    Llisas wrote:
    I solved the problem, I just had to wire the blocks in a sequential way (I still don't know why, but it works).
    Feel free to delete this topic.
    I would strongly suggest at least reading this tutorial to give you an idea of why your fix worked (or maybe only appeared to work).  Myself, I never just throw up my hands and say, "Whatever," and wash my hands of the situation without trying my best to understand just what fixed it.  Guranteed you'll run into the same/similar problem and this time your fix won't work.
    Please do yourself a favor and try to understand why it is working now, and save yourself (or more likely, the next poor dev to work on this project) some heartache.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Problem with multiple Toplink/JPA apps in same server

    Anyone have experence of running serveral Toplink/ EJB-3 Web apps in the same server (OC4J, alas)?
    We seem to get a problem with the second app failing to initialise toplink, with an entity not found message. Each app runs OK on it's own.

    Yes, they access the same datasource and most of the tables overlap.
    We're thinking it might help to have common entity classes and put them in a shared library, but I don't know if this is relevant (setting up shared libraries complicates testing and tends to snowball, I reckon we need about 15 jars all told).
    I''ve had some funnies on OC4J before which I think may be to do with it's use of ClassLoaders, for example I initially put persistence.xml in the libary jar with the data model, but for some reason I get the entity not found error that way. It only seems to work if it's in the classes folder.
    For the moment we're getting arround the problem with multiple OC4J instances in the server.

  • Finding same column name from multiple database tables

    I am needing to find all tables in a database that contain the same column. ie: which tables in database A have col_a in it.
    Is it possible to do a sql code to qry all of this?
    Thanks

    No, Ignacio did not, at least, not really. ;)
    The usage of ALL_TAB_COLUMNS only has info for tables which the actual user has access to.
    If you need to be sure that you search each and every table, you have to use DBA_TAB_COLUMNS (or the connected user must be a super hero...).
    Just wanted to point that out.
    Regards,
    Guido

  • Multiple component renderer in the advanced datagrid in the same column

    Hi
    All I want is to render multiple Components in the same column based on the rowIndex value.
    Let me know if it is possible. Right now I am able to render the same components in the multiple rows in the same column.
    Example for further clarification:
    all in [] needs to be rendered as a compoennt
    Name  Component-to-be-renedered  Chart-component
    xyz       [ Combobox ]                        [piechart based on values]
    abc       [List]                                    [Column Chart based on value]
    Many Thanks,
    Piyush

    <mx:states>
      <mx:State name="firstComponentsSet">
       <mx:AddChild position="lastChild">
        <mx:Button />
       </mx:AddChild>
      </mx:State>
      <mx:State name="secondComponentsSet">
       <mx:AddChild position="lastChild">
        <mx:TextInput />
       </mx:AddChild>
      </mx:State>
             </mx:states>
    <mx:Script>
      <![CDATA[
      override public function set data(value:*):void {
       super.data = value;
       currentState = '';
       // if data requires firstComponetns set
       currentState = 'firstComponentsSet';
       // else
       currentState = 'secondComponentsSet';
      ]]>
    </mx:Script>

  • Datagrid scrolling problem when different items are in the same column

    I have a datagrid which I am populating with different items (LinkButtons, Images, Labels). However when there are different types of items in the same column and when i try to scroll everything gets messed up (Images get overlapped with each other or the labels get overlapped with images).
    I am overloading the "IDropInListItemRenderer" to create different types of items in each cell and I am overloding the "updateDisplayList" function
    Any ideas as to why the items get messed up during scrolling? Is there some other preperty of IDropInListItemRenderer that should be overloaded?

    Hi Subeesh Arakkan,
    Thanks. This is the exact problem that I have. Althought my overloaded functions are a little different and Im trying to resolve it. But htis is a good lead.
    Thanks,
    Prashanth

  • Problem in Adding two buttons under same column header (in JTable)

    Hi,
    I have a JTable and to a particular column i want to add two buttons.
    Here the two buttons should be under the same column header and i need to add listners to these.
    Any idea how to do this?
    Thanks & regards
    Neel

    Of course as your header is drawn by a renderer, the buttons don't actually work, but you can listen for mouse clicks within the area of the header and see which button the mouse position was over.
    See the Java Table Sorter Demo code for how to add a mouse listener to the header...
    http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#TableSorterDemo
    ....and from there you should be able to determine where in the component the click occured by using the getX() and getY() methods of the MouseEvent to determine which button in the renderer component was clicked. Use something like Rectangle.contains() to match the click location against the buttons.

  • Deleting from multiple tables where few tables have same column name

    Hi,
    I am new to PL/SQL and need some help. I need to delete data older then X years from some 35 odd tables in my schema and out of those tables 25 tables have same column name on which i can have my "where" clause and rest 10 table have different table names. I am doing something like this :
    declare
    table_list UTL_FILE.FILE_TYPE;
    string_line VARCHAR2(1000);
    tables_count number:=0;
    table_name VARCHAR2(400);
    column_name VARCHAR2(400);
    BEGIN
    table_list := UTL_FILE.FOPEN('ORALOAD','test7.txt','R');
    DBMS_OUTPUT.PUT_LINE(table_list);
    LOOP
    UTL_FILE.GET_LINE(table_list,string_line);
    table_name := substr(string_line,1, instr(string_line,'|')-1);
    column_name := substr(string_line, instr(string_line,'|')+1);
    DBMS_OUTPUT.PUT_LINE(table_name);
    DBMS_OUTPUT.PUT_LINE(column_name);
    IF column_name = 'SUBMISSION_TIME' THEN
    delete from :table_name where to_date(:column_name)<(sysdate-(365*7));
    ELSE
    delete from || table_name || where ( || to_date(column_name) || ) <(sysdate-(365*7));
    END IF;
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    UTL_FILE.FCLOSE(table_list);
    DBMS_OUTPUT.PUT_LINE('Number of Tables processed is : ' || tables_count);
    UTL_FILE.FCLOSE(table_list);
    END;
    WHERE the text file "text7.txt" contains list of table name and column names separated by a pipe line. But when I execute the above proc it gives error "invalid table name".
    Can something like this be done or is there any other way to execute this task of deletion from 35 tables.
    Thanks.

    Thanks for replies. I don't know what I am doing wrong but still not getting this damn thing work...This is the proc i am running now :
    declare
    table_list UTL_FILE.FILE_TYPE;
    string_line VARCHAR2(1000);
    tables_count number:=0;
    table_name VARCHAR2(4000);
    column_name VARCHAR2(4000);
    code_text VARCHAR2(2000);
    BEGIN
    table_list := UTL_FILE.FOPEN('ORALOAD','test7.txt','R');
    LOOP
    UTL_FILE.GET_LINE(table_list,string_line);
    table_name := substr(string_line,1, instr(string_line,'|')-1);
    column_name := substr(string_line, instr(string_line,'|')+1);
    IF column_name = 'SUBMISSION_TIME' THEN
    DBMS_OUTPUT.PUT_LINE('do nothing');
    ELSE
    code_text:= 'begin delete from'|| (table_name) ||'where to_date' || (column_name) || '<(sysdate-(365*7))';
    Execute Immediate code_text;
    END IF;
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    UTL_FILE.FCLOSE(table_list);
    DBMS_OUTPUT.PUT_LINE('Number of Tables processed is : ' || tables_count);
    UTL_FILE.FCLOSE(table_list);
    END;
    But it gives following error :
    " ORA-06550: line 1, column 51:
    PL/SQL: ORA-00933: SQL command not properly ended
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 1, column 68:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
    ORA-06512: at line 22 "

Maybe you are looking for

  • The home button on my iPod Touch is unresponsive

    The home button on my iPod Touch is not working.  Any app that I'm in, I can't get out of because when I press the home button, nothing happens.  Is there a way to fix this?

  • Premiere Elements 12

    New installation yesterday Premiere Elements 12, created a instant movie, today I cannot open the project. Error message "unknown error occured while opening project" what is the problem?

  • Save a doc/docx file as dotx

    In C++/MFC using MS word controller (and not Open xml) how to Save a doc/docx file as dotx?? I am opening the .doc/docxx file, and saving it as .dotx. It saves, but if tried to open when double clicking it, it is says something which means, incorrect

  • Uploaded custom, theme not showing in repository

    I have copied a existed theme_4 from images/themes/theme_4 to them_200. when i am trying to export the same from repository, that is not showing in the list.. I have followed the below steps to create new custom theme 1) in images/themes/theme_4 copi

  • Trouble with externally moving files in LR v2.3

    Hi All,   Newbie here, so sorry if this is a stupid question. I finally got a computer that is powerful enough to make LR useful, so I have been playing around with it the last few days and I really love it.  My library is woefully disorganized so Iv