Help with Datagrid Column Creation

I'm trying to get a better understanding of how the Spark DataGrid component works so that I can create and extended version for one of my projects. One of the things that really has me stumped is how the datagrid sets up the columns based on the dataprovider when no explicit columns are defined. I've been able to debug through the datagrid initialization up to the point where the setter for dataprovider gets called. At that point my debug trace goes 'down the rabbit hole' so to speak, and when it comes back the columns are initialized but I can't figure out how. Could someone please point me to the Class/function that is actually responsible for creating the columns from the dataprovider if they are not defined explicitly?

I finally managed to track down the code I needed, it's in the commitProperties method of Grid.as (line 3555). That's the good news. The bad news is I still seem to be missing something. My understanding was, if the datagrid autogenerated the columns, those columns would be replaced if another collection of columns are defined for the datagrid at some later point. For some reason that doesn't seem to be happening for me.
The datagrid I'm working with is part of a larger component with a skin. The list of columns for the datagrid is bound to an ArrayList defined in the hostComponent of the skin. I can understand why the creation of the columns could happen before the binding from the host triggers, what I don't get is why they aren't overridden later. Any suggestions?

Similar Messages

  • Need help with complex column creation command

    Hello, all
    I need help with a complex column creation command and SQL anywhere help is not sufficient for it.
    Here is the situation:
    I need to write a generic DDL "alter table" command, which can add/modify columns without knowing in advance if they already exist in the destination table.
    Is there a command, which looks like:
    alter table "table1" add (on existing modify) column1 <datatype> <default> ?
    Thank you,
    Arcady

    Hi.
    I don't think this is supported in alter table command. But you can code that inside an if statement which queries systables & syscolumns. Your code should be something like that:
    if (select count(*) from sysobjects, syscolumns where sysobjects.id = syscolumns.id and sysobjects.name = 'some_table' and syscolumns.name = 'some_column') < 1
    begin
        alter table some_table add some_column numeric(12) not null
    end
    This is an example..
    Andreas.

  • Help with calculated column formula- combine strings and convert to date

    In my list (SharePoint Server 2013) I have:
    'Invoiced Month' column, type of choice (strings with names of months- January, February, March..., December)
    'Year' column, single line of text (e.g. 2012, 2013, 2014)
    1. I need to create a calculated column which will return combined value of the columns above, but in DATE format e.g. 'Sep-2013' or '01-Sep-2013'.
    I then use that newly created calculated column to do this: http://iwillsharemypoint.blogspot.in/2012/03/sharepoint-list-view-of-current-month.html
    I am rubbish with formulas, can I have some help with my problem please?

    Hi,
    Use the formula, I have tested by creating Months column with choice, Year column as numeric and Calculated column as DateTime returned.
    =DATE(Year,IF([Months]="January", 1,IF([Months]="February",2,IF([Months]="March",3,IF([Months]="April",4,IF([Months]="May",5,IF([Months]="June",6,IF([Months]="July",7,IF([Months]="August",8,IF([Months]="September",9,IF([Months]="October",10,IF([Months]="November",11,12))))))))))),1)
    Before applying the formula few things need to be noted.
    DATE(YEAR, MONTH,DAY) will accepts three parameters all should be type numeric(integer).
    Create the Year column of type numeric
    Create the calculated column of type "DateTime" to return as date
    Please mark it answered, if your problem resolved or helpful.

  • Help with database column

    I have a report with a column that come from table.
    This column is a number and I need change the sign if a condition is true.
    I try do this in a format trigger and in a trigger in Data Model (right clik mouse on this item Program Unit). But in both cases it say me when compile :
    Err 903. A READ-ONLY VARIABLE USED IN OUT OR IN-OUT CONTEXT.
    That mind that I cannot use this variable in this point. Also I try to change the Var and use a User Variable and change the value in the moment of read or print with similar results.
    Any help wellcome.
    Regards Everybody.

    Why do you not use a database function which will have your businesslogic and will return the changes value.
    Create function business1 (p_val in number) return number is
    begin
    <your logic here>
    return(l_modified_value);
    end;
    in your report query just use the function.
    select business1(<your_column> as "my alias" from .....
    That should work
    Marcos

  • Help with XHTML columns in IE6

    I'm having some problems with my columns in IE6. The math is
    all correct and it lays out perfectly fine in firefox as expected.
    For some reason IE6 seems to be doubling the numbers I assign as my
    margins. Can anyone give me a tip as to what's wrong here before I
    trash this whole idea and go with a old fashioned table.
    2 columns.
    15px left and right margins on the "left" column, 470px wide
    15px right margin on the "right"column, 455px wide

    Its an IE6 float/margin bug. If you add a margin in the same
    direction
    as the float IE6 will double it. Add display: inline; to the
    css styles,
    as below, to counter-act this problem.
    #left { margin: 0 15px; width: 470px; height: 100px; float:
    left;
    background: #f00; display: inline; }
    #right { margin: 0 15px 0 0; width: 455px; height: 100px;
    float: right;
    background: #666; display: inline; }
    quovadimus02 wrote:
    > I'm having some problems with my columns in IE6. The
    math is all correct and
    > it lays out perfectly fine in firefox as expected. For
    some reason IE6 seems
    > to be doubling the numbers I assign as my margins. Can
    anyone give me a tip as
    > to what's wrong here before I trash this whole idea and
    go with a old fashioned
    > table.
    >
    > 2 columns.
    > 15px left and right margins on the "left" column, 470px
    wide
    > 15px right margin on the "right"column, 455px wide
    >
    >
    >
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
    > "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    > <html xmlns="
    http://www.w3.org/1999/xhtml">
    > <head>
    > <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    > <title>Untitled Document</title>
    > <style type="text/css">
    > body { margin: 0; padding: 0; width: 970px; background:
    #e1e1e1; }
    > #wrap { padding: 10px 0; background: #fff; }
    > #left { margin: 0 15px; width: 470px; height: 100px;
    float: left; background:
    > #f00; }
    > #right { margin: 0 15px 0 0; width: 455px; height:
    100px; float: right;
    > background: #666; }
    > </style>
    > </head>
    > <body>
    > <div id="wrap">
    > <div id="right"></div>
    > <div id="left"></div>
    > <div style="clear: both;"></div>
    > </div>
    > </body>
    > </html>
    >

  • Need help with af:column and skinning

    Hallo,
    ADF Faces and skinning is in general a great opportunity to get projects done - thx for this.
    - I use a af:table with af:column with sortable="true".
    - This works great, but the customer want's to have the icon for sorting to the left side of the label.
    - I have created my own skin for this and can change the sorting icon, but I cannot place it to the left side of the label:
    af|column::sort-ascend-icon {
    content:url(/skins/espa/sort_ab_h.gif);
    Has anyone done this? Is this possible?
    Thx, Willi

    Looking at the source gives a clear picture - it can't be done.
    Now I am switching over to less comples jsf components and additional implementations.
    Thx, Willi

  • Help with CSS column display

    I have beaten my brains trying to get a third column to
    display correctly. After rereading several tutorials and helps in
    Dev Center, I am still stumped! Can you take a look at my code here
    http://www.mlundy.net/tigerswrestlingnew/lsTigersTemplate.html
    - CSS file is
    http://www.mlundy.net/tigerswrestlingnew/css/lsWrestling.css.
    The absolut wierdest thing just happened. After I uploaded it
    for you to see, it seems to display correctly! However, inside DW8,
    it still shows the sponsors div being pushed down below content.
    I'm very confused now! Can anyone give me a hand? Thanks.
    Mark

    quote:
    Originally posted by:
    mlundy
    I have beaten my brains trying to get a third column to
    display correctly. After rereading several tutorials and helps in
    Dev Center, I am still stumped! Can you take a look at my code here
    http://www.mlundy.net/tigerswrestlingnew/lsTigersTemplate.html
    - CSS file is
    http://www.mlundy.net/tigerswrestlingnew/css/lsWrestling.css
    The absolut wierdest thing just happened. After I uploaded it
    for you to see, it seems to display correctly! However, inside DW8,
    it still shows the sponsors div being pushed down below content.
    I'm very confused now! Can anyone give me a hand? Thanks.
    Mark
    Actually, it still does not work correctly. Because I have
    already applied a background image to the containing div, it
    appears correct. The sponsors div content actually still falls
    below the center, content div, instead of being top-aligned with
    the headlines and content divs.

  • Need help with custom column in BI Publisher

    Hi Guru's
    I have started working with BI Publisher Recently and need with below issue
    Can you please let me know how can i create a custom column like % based on two existing measures in the report
    I tried creating it in obiee report and used that SQL to create BI Publisher Report , but the result column in obiee is not working as expected in BI Publisher,
    can some one please help me with this
    Thanks a lot in advance.

    This column can be calculated in BIP RTF template. But if it is a column inside a FOR-loop
    then it may need to be calculated slightly different.
    Like I said, get the xml data and rtf then send it to me : [email protected]
    and will get it fixed for you.
    thanks
    Jorge

  • Help with datagrid custom item renderer

    Hi ,
    I have a datagrid in which I have a column with a checkbox and a custom Checkbox header renderer and an item renderer.
    When I try to disable the grid the checkbox column does not get disabled?
    Is there any way I can disable the entire grid along with the checkbox column?
    Thanks.

    Override updateDisplayList on the renderer and set the .enabled to match
    owner.enabled.

  • Help with report column formatting

    Hi,
    Simple question .... I have a report that has some fairly large text columns, and I want to fit the report onto one screen. Does anybody know how you can change the width of the column of a report, and get the text to wrap round within that cell ?
    thanks
    Tim

    Tim,
    You could change the display type of the longer fields to be text areas.
    You may also want to look at Carl AJAX app which has a feature which hides/shows detail data without the page being refreshed.
    http://htmldb.oracle.com/pls/otn/f?p=11933:22
    Select the HTMLDB and Javascript -> AJAX and DHTML -> AJAX -> Show Report with Detail option.
    Hope this helps
    Chris

  • Help with 2 column layout

    I can't seem to quite get the layout to work correctly on this.
    http://www.openrangeimaging.com/Test/Gravity-Test/index.html
    Problem -The Main Content column protrudes into the menu bar space and is not aligned with the top of the sidebar column. I'd like the  MainContent and Sidebar columns to have their tops aligned with each other. I need to keep the Main Content column from protruding into the menu bar.
    I inserted a spry menu bar and then modified the default styling quite a bit. It looks like it should. It is positioned where it should be. All of the css for it is stored in a separate folder that DW created when I add the spry menu. EXCEPT for one css rule, MenyBar1, that is in the other primary css folder. I don't think I added that but honestly I'm not sure. I don't know if the styling of the menu bar is responsible for the trouble. I've messed around with so much of the margin and etc on so many elements that I am now pretty confused.
    I'm hoping someone can take a look at this and help me figure out what I have done incorrectly.
    Thanks in advance for any reply.

    markf12 wrote:
    Hans thanks for your reply! Yes I want the tops of the Sidebar and Main content divs to be aligned. It's hard to tell form your screen grab but using the dashed line that's underneath the orange letter G as a reference it appears the yellow MainContent is lower than the  white Sidebar. The tops are not aligned with each other.
    I put the menu bar into a div and made sure it had 0 margin. I updated the file
    http://www.openrangeimaging.com/Test/Gravity-Test/index.html
    For some reason the Main content is allowed to move up farther than the sidebar. Also there is no top padding on the Main content but it appears the upper most heading is being held away from the top edge of the main content as if there is top padding. Something is not right here and I just can't seem to figure it out.
    I'm afraid I'm starting to get frustrated and somewhat desperate <g>
    Please Help!!!!!!!!!!
    Amend your #nav-menu css selector to as shown below:
    #nav-menu {
    width: 960px;
    overflow: hidden;
    You'll also then need to adjust the margin and padding of the <h1> tag (Main Content). So introduce another css rule for the  h1 as shown below:
    #mainContent h1 {
    padding: 15px 0 0 0;
    margin: 0;

  • Help with a column form

    Hi!!
    I have this Data model:
    http://img236.imageshack.us/img236/5250/dibujo0eq.gif
    and I want to add a formula Column with this pl/sql cod:
    function CF_1Formula return Number is
    begin
    return :correctas*100/:count_ccnfac;
    end;
    When i Tryied to do this i have this error:
    rept-1517: Column "porcent_correctas" references colum "correctas", wich has incompatible frequency.
    I know what causes this problem, but i don't know how to resolve it because the colums are in diferent querys.Please, somebody help me, I'm new in this and I need it for my work.
    Bye, and thanks to all.

    Excellent to have a reference to a picture!
    A formula column can reference fields in it's own group or the groups above it. So, put the formula column in group G_COUNT. This way you can reference both :correctas and :count_ccnfac.

  • Help with three column layout please

    Hello All
    I have been struggling with a three column layout to incorporate inserted images on the right. Please see http://www.greenpatchwebsites.com/ridgeway/index2.html
    At the moment I have resorted to a background image but I am not happy with the quality and lack of positioning in relation to the text.
    I have looked at lots of sites re faux / three columns etc but I can't make it work. As you will see from the attached css there are lot of divs because of the expanding box and I am getting in a muddle.
    Expert help here would be very gratefully received and I thank you in advance.

    Hi There,
    You can refer to 3 column fixed template (with header and footer) provided by DW itself. For reference how to make a 3 column layout use following code. Just save the whole of this as .html file and preview. Go through the structure and css classes in the head to understand the layout.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    body  {
         font: 100% Verdana, Arial, Helvetica, sans-serif;
         background: #666666;
         margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
         padding: 0;
         text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
         color: #000000;
    .thrColFixHdr #container {
         width: 780px;  /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
         background: #FFFFFF;
         margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
         border: 1px solid #000000;
         text-align: left; /* this overrides the text-align: center on the body element. */
    .thrColFixHdr #header {
         background: #DDDDDD;
         padding: 0 10px 0 20px;  /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
    .thrColFixHdr #header h1 {
         margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
         padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
    .thrColFixHdr #sidebar1 {
         float: left; /* since this element is floated, a width must be given */
         width: 150px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
         background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
         padding: 15px 10px 15px 20px; /* padding keeps the content of the div away from the edges */
    .thrColFixHdr #sidebar2 {
         float: right; /* since this element is floated, a width must be given */
         width: 160px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */
         background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */
         padding: 15px 10px 15px 20px; /* padding keeps the content of the div away from the edges */
    .thrColFixHdr #mainContent {
         margin: 0 200px; /* the right and left margins on this div element creates the two outer columns on the sides of the page. No matter how much content the sidebar divs contain, the column space will remain. You can remove this margin if you want the #mainContent div's text to fill the sidebar spaces when the content in each sidebar ends. */
         padding: 0 10px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
    .thrColFixHdr #footer {
         padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
         background:#DDDDDD;
    .thrColFixHdr #footer p {
         margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
         padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
    .fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
         float: right;
         margin-left: 8px;
    .fltlft { /* this class can be used to float an element left in your page */
         float: left;
         margin-right: 8px;
    .clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
         clear:both;
        height:0;
        font-size: 1px;
        line-height: 0px;
    -->
    </style><!--[if IE 5]>
    <style type="text/css">
    /* place css box model fixes for IE 5* in this conditional comment */
    .thrColFixHdr #sidebar1 { width: 180px; }
    .thrColFixHdr #sidebar2 { width: 190px; }
    </style>
    <![endif]--><!--[if IE]>
    <style type="text/css">
    /* place css fixes for all versions of IE in this conditional comment */
    .thrColFixHdr #sidebar2, .thrColFixHdr #sidebar1 { padding-top: 30px; }
    .thrColFixHdr #mainContent { zoom: 1; }
    /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
    </style>
    <![endif]--></head>
    <body class="thrColFixHdr">
    <div id="container">
      <div id="header">
        <h1>Header</h1>
      <!-- end #header --></div>
      <div id="sidebar1">
      <h3>Sidebar1 Content</h3>
        <p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the left side of the #mainContent div if it will always contain more content. </p>
        <p> </p>
      <!-- end #sidebar1 --></div>
      <div id="sidebar2">
        <h3>Sidebar2 Content</h3>
        <p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the right side of the #mainContent div if it will always contain more content. </p>
        <p> </p>
      <!-- end #sidebar2 --></div>
      <div id="mainContent">
        <h1> Main Content </h1>
        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at,  odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. </p>
        <h2> </h2>
        <!-- end #mainContent --></div>
         <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
      <div id="footer">
        <p>Footer</p>
      <!-- end #footer --></div>
    <!-- end #container --></div>
    </body>
    </html>
    Don't be overwhelmed as this is simple code only (much like your own page). You can then divide your background image and put one part in the center column (mainContent DIV) and the other in the right sidebar (sidebar2 DIV).
    Hope this helps.
    Regards,
    Vinay

  • Please help with dynamic menu creation needs to have 5 levels

    Hi,
    I have run into a Coldfusion problem that I was hoping you
    could help me with.
    What I am trying to solve is the dynamic creation of at least
    5 levels of categories for a menu built with Coldfusion, and if
    possible an infinite amount of levels.
    Each of these also if it is at the end of the tree will have
    to have products under it aswell the category will only show up if
    there is products under it.
    To acomplish this I have created a database table called
    "Categories" which contains the fields shown in the linked
    spreadsheet. I am using the "cat_parent" to hold the value of the
    parent of the current record. When the parent is a top level menu
    item I have assigned this a cat_parent id of "0". Using this method
    I am able to do a self join on the table (where "cat_parent" =
    "cat_id") to extract the relationship between parent and child
    records throughout the table. This works fine. And I have created
    output for 5 levels of display.
    There are 3 issues left that I could not work out.
    - Firstly my coding method loops through each node of the
    tree with one query to create each category of the menu. This means
    one query per menu category and as the client could have up to 200
    categories in the menu and I am concerned that the solution that I
    have come up with is too processor intensive.
    - Secondly the way that I have created the category menu is
    hard coding in the levels needed so there is only 5 not an infinite
    amount which would be preferable but is not essential.
    - Finally I could not work out how to not create "parents" in
    the tree if there is no products for the end child category.
    Meaning that if there is for example a category > subcategory
    > subsubcategory but there is no products associated with the
    end category - "subsubsubcategory" then it's parent and so on will
    not display until one of them has products.
    Here
    is a link to a zip file that includes: the cfc that contains
    the query function (categories.cfc), the page that is creating the
    categories menu (lefnav.cfm), a simple cfc that contains a products
    query just for testing (products.cfc) along with a spreadsheet of
    the Categories table's fields.
    I would greatly appreciate any suggestions.
    Thanks for any time and help you can give me on this

    This should at least get you started in the right direction.
    http://www.sitepoint.com/article/dynamic-menu-coldfusion
    Bryan Ashcraft (remove brain to reply)
    Web Application Developer
    Wright Medical Technologies, Inc.
    =============================
    Macromedia Certified Dreamweaver Developer
    Adobe Community Expert (DW) ::
    http://www.macromedia.com/go/team
    "shunnyboy" <[email protected]> wrote in
    message
    news:e2h9hs$kp5$[email protected]..
    > Hi,
    >
    > I have run into a Coldfusion problem that I was hoping
    you could help me
    > with.
    >
    > What I am trying to solve is the dynamic creation of at
    least 5 levels of
    > categories for a menu built with Coldfusion, and if
    possible an infinite
    > amount
    > of levels.

  • Need help with discount column

    Hi,
    I have managed to create an invoive after discovering that I had LiveCycleDesigner included with Creative Suite 3
    I only have very basic skills in this area, so please bear with me
    I'm hoping what I am after is easy enough for someone out there to help me with.
    As you can see, I have created the below columns.
    The amount column is...     Show: calculate*    Quantity * Unit Price (with unit price being the Binding name under the Object tab)
    So what I would like to do is add the discount variable in and need to know the script to enable this.
    The Binding names are Quantity, Decgription, UnitPrice, ItemDiscount and Amount.
    I got somewhere with the amount column as...       Show: calculate*    Quantity * UnitPrice * ItemDiscount / 100
    But this left me with the actual discount in the amount column rather than the amount - discount.
    I tried a few other ideas, but couldn't seem to get it right so I thought it best to get those who know to give me the right answer.
    The other question is after I open the template with Adobe Reader, and fill it out , is it possible to save the resulting document as a 'standard' PDF?
    So far I have had to export as jpg and then convert to PDF. I'm sure I must be missing something obvious....
    I'm using windows 7 and LiveCycle Designer 8
    Thanks
    Martin

    Hi,
    Thanks for your help.
    Wasn't sure how to apply the maths to the script and get it to work:)
    They both worked perfectly
    Is it possible for the Amount field to be left blank  unless data is enetered in the other columns?
    Right now the Preview PDF has a coloum of $0.00 under amount
    As for saving the PDF
    When I go to Save As in Adober Reader I get the following message
    I've had a look through both the LiveCycle and PDF documents but have been unable to find any adjustable settings that might change this.s
    I presume the Feild Display Pattern Szzz,zz9.99 is the correct way to remove the $ signs?
    Thanks again
    Martin

Maybe you are looking for