Passing a parameter to a Item Renderer

I have a dataGrid with about 12 columns. I want to render an
image in each cell based on the value of that node. Problem is: I
need the renderer to know what node to evaluate.
<mx:DataGridColumn width="20"
itemRenderer="com.apts247.www.renderers.Test" paddingLeft="0"
color="#990000"/>
<mx:DataGridColumn width="20"
itemRenderer="com.apts247.www.renderers.Test" paddingLeft="0"
color="#990000"/>
When these hit the item renderer, how can i make it know what
data to evaluate. I want to pass it, for example, "task_0", or
"task_1"

If the Itemrenderer implements the IDropInListItemRenderer
interface, you have access to the listData property which contains
information like column index and dataField.
Check out this tutorial:
http://flexgeek.wordpress.com/2007/05/30/tutorial-using-same-itemrenderer-for-multiple-col umns/
or the flex docs for more info.
Tracy

Similar Messages

  • Pass a value to an item renderer button

    I have a datagrid.  One of the columns has a value of "@recipe", with is a string that's a URL.
    I need to replace this with a link button that goes to this url.
    So I created an Item Renderer:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
         <![CDATA[
              private var linkToGoTo:String = XML(data).@recipe
              private function goRecipe(event:MouseEvent):void {
              trace("Link="+linkToGoTo);
         ]]>
    </mx:Script>
    <mx:LinkButton id="related" label="Related Recipe" click="goRecipe(event)" />
    </mx:Canvas>
    Problem is that I am not getting my XML value.   If I did this:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
         <![CDATA[
              private function goRecipe(event:MouseEvent):void {
              trace(event.currentTarget.label);
         ]]>
    </mx:Script>
    <mx:LinkButton id="related" label="{XML(data).@recipe}" click="goRecipe(event)" />
    </mx:Canvas>
    This works, but of course I do not want the label to be this long URL.  How would I do this?

    OK, I got it to work like this, not sure if it's the best way:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
         <![CDATA[
              private var relatedRecipe:String
              override public function set data(value:Object):void
            if(value != null)
               super.data = value;
               relatedRecipe = value.@recipe
               if (relatedRecipe.length>1) {
                    trace("recipe="+relatedRecipe);
                    related.visible = true;
               } else {
                    related.visible = false;
            private function goRecipe(event:MouseEvent):void {
                 var linkToGoTo:URLRequest = new URLRequest(relatedRecipe);
                 navigateToURL(linkToGoTo, "_blank");
         ]]>
    </mx:Script>
    <mx:LinkButton id="related" label="Related Recipe" click="goRecipe(event)" textDecoration="underline" fontSize="10" styleName="recipeLinkButton" />
    </mx:Canvas>

  • Item Renderer passed to legend

    Hi,
    I have written an item renderer in Action script to change
    the shape of the columns on a column chart. How can I pass this
    through to the Legend?
    I tried adding:
    legendMarkerRenderer=
    "myRenderer"
    itemRenderer="myRenderer"
    inside the column series tags of my mxml but this didn't work
    - I just got a blank screen when I tried to run the application.
    If I put
    legendMarkerRenderer=
    "mx.charts.renderers.DiamondItemRenderer" this works OK -
    but of course, it isn't what I want.
    Do I need to put something inside my action script to tell it
    to pass the info to the legend?
    Thanks in advance for any help.
    M

    Be sure to include the full classpath to your renderer in the
    reference within your MXML. For example, if the package that your
    renderer is in is com.example and the name of your renderer's class
    is MyRenderer, you would write the following:
    legendMarkerRenderer="com.example.MyRenderer". Keep in mind that
    case matters.
    If this doesn't work, there is probably something wrong with
    your ItemRenderer, so you should post that code and we can help you
    out.

  • Click event on a item renderer stops data being passed

    Hi
    I'm trying to create a item renderer based on a Canvas, this renderer is then used in a List component. I'm trying to get a click event fired when the user clicks on one of the items in the List. I'm also formatting the data being passed into the item renderer to do this I'm overriding the set data property like this:
    override public function set data(value:Object):void
    title.text = value.marketName;
    sellPrice.text = value.sellPrice;
    buyPrice.text = value.buyPrice;
    change.text = value.percentageChangeOnDay;
    var i:String = "-";
    if(String(value.percentageChangeOnDay).indexOf(i))
    change.styleName = "PositiveChange";
    else
    change.styleName = "NegativeChange";
    When I add a click event to my item renderer like this,
    <view:DisplayItem click="itemClickedEvent( event )" />
    I get a null reference error in my set data function. If I remove the click event the data is passed correctly, I've also found that if I use a rollOut event like this,
    <view:DisplayItem rollOut="rolledOverEvent( event )"/>
    the data is passed fine and the event works too, it seems that click events cause the data not to be passed.
    Why does having a click event cause this problem? How can I have a click event on the item renderer and still format my data?
    Cheers
    Stephen

    Found out that I can use the itemClick event of the List component I'm using my item renderer in, so really my item renderer does not need a click event.

  • Getting the value of a checkbox in an item renderer?

    I have a list that uses an item renderer with buttons and data.  I need to add a checkbox and get the value of this checkbox passed along with the event of the pushbutton.
    When the user clicks "add to menu: there is a click handler:
    protected function addButton_clickHandler(event:MouseEvent):void
                        doubleIt = double.selected;
                        owner.dispatchEvent(new Event("ADD_TO_MENU", true));
    Back in the main application, there is a listener for this event.  I want that handler to be able to "know" the status of that checkbox (i.e. the value of "doubleIt", defined as a public boolean).
    private function addToMenuHandler(event:Event):void {
               var i:int = event.target.selectedIndex;
               var obj:Object = new Object();
               obj = recipeListCollection.getItemAt(i);
               menuList += obj;
    I have tried various permutations of the event.target, but can't figure out how to access that variable.

    Create a custom event and stuff anything you want in there.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • How to pass dynamic parameter to a database function in OBIEE

    Hi,
    I have a requirement like this. I have to create one report in OBIEE which was in Discoverer. Now in discoverer report there are some calculated item in the worksheet based on database pkg.functions. The parameter which user gives at run time that parameters are then passed to the discoverer calculated items dynamically. But I am not able to do this in OBIEE answers.
    Can anyone tell me step by step how I can able to pass the user selected parameter values in OBIEE answer level.
    The example:
    GET_COMM_VALUE_PTD("AFE Cost & Commitment".Afe Id,:"Period Name(AFE)","AFE Cost & Commitment".Data Sel,"AFE Cost & Commitment".Org Id)
    GET_COMM_VALUE_PTD --- Function database
    ("AFE Cost & Commitment".Afe Id,:"Period Name(AFE)","AFE Cost & Commitment".Data Sel,"AFE Cost & Commitment".Org Id --- Parameters... :"Period Name(AFE)" is the dynamic parameter selected run time by user.
    Please help.
    Thanks
    Titas

    Hi,
    I already did that. But the existing discoverer re value report is showing correct value but the OBIEE report with EVALUATE function shows incorrect value.
    The requirement is to create a OBIEE Dashboard from a Discoverer existing report. Now in discoverer report theere are several calculated items in worksheet level where database custom function is used and user selected parameter value is passed run time in that function. But when that is created in OBIEE with EVALUATE function in RPD, the report shows incorrect data. Could not understand how to pass the parameter value runtime.
    Below is the discoverer 'Show SQL' query and EVALUATE function syntax which has been used.
    SELECT APPS.XXBG_PL_PROJ_ANALYSIS_AFE_PKG.GET_COMM_VALUE_PTD(XXBG_PL_PROJ_AFE_V.AFE_ID,
    :"Period Name(AFE)",
    XXBG_PL_PROJ_AFE_V.DATA_SEL,
    XXBG_PL_PROJ_AFE_V.ORG_ID),
    XXBG_PL_PROJ_AFE_V.AFE_DESC,
    XXBG_PL_PROJ_AFE_V.AFE_NUMBER,
    XXBG_PL_PROJ_AFE_V.APPROVED_AFE_AMOUNT
    FROM APPS.PA_PERIODS_ALL PA_PERIODS_ALL,
    APPS.XXBG_PL_PROJ_AFE_V XXBG_PL_PROJ_AFE_V
    WHERE ((XXBG_PL_PROJ_AFE_V.ORG_ID = PA_PERIODS_ALL.ORG_ID))
    AND (XXBG_PL_PROJ_AFE_V.DATA_SEL = :"Data Selection(AFE)")
    AND (PA_PERIODS_ALL.PERIOD_NAME = :"Period Name(AFE)")
    AND (XXBG_PL_PROJ_AFE_V.AFE_NUMBER = :"AFE Number(AFE)")
    AND (XXBG_PL_PROJ_AFE_V.OPERATING_UNIT = :"Operating Unit(AFE)")
    The EVALUATE function syntax is as below:
    EVALUATE('XXBG_PL_PROJ_ANALYSIS_AFE_PKG.GET_COMM_VALUE_PTD(%1,%2,%3,%4)' AS FLOAT , "BG PL Project Analysis Report_1"."AFE Cost & Commitment"."AFE Cost & Commitment.Afe Id", "BG PL Project Analysis Report_1"."Periods 1"."Periods 1.Period Name", "BG PL Project Analysis Report_1"."AFE Cost & Commitment"."AFE Cost & Commitment.Data Sel", "BG PL Project Analysis Report_1"."AFE Cost & Commitment"."AFE Cost & Commitment.Org Id")
    The PERIOD needs to be passed at run time which user will select.
    Please help to solve the issue.

  • Pass a parameter to Surikogiflex client

    Hello all,
    I'd like to know if it is possible to pass a parameter to Surikogiflex client, to be able to tell it to open a certain story.
    For example, I wonder if it is possible to have in an html page a link like
    <a href="localhost:8400/suribachi/clients/surikogiflex/?icml=/documents/doc1/story1.icml">Ed it story in Surikogi</a>
    and when the user clicks it have Surikogiflex client open loading the selected story, without passing from the Document browser window.
    Is something like this possible?
    Please assume that the correct <story> tags are present on the storylist.xml file in the /suribachiassets directory.
    Thanks.

    i am trying to pass the parent_id as a parameter to a portal page but am not able to... i can add it to the list of in parameters to the PL/SQL based parent id but when i add the parent id to the url then i get no result... i created a custom attribute for the parent id since there is no attribute build other then page group and page id... when I set the Parent ID attributes default value in the attribute properties of the item type based on PL/SQL it just brings back results for the default value and if i pass a different value for ithe parent id i dont get the correct result I get the result for the default parent id.
    I am using the followin url to pass the parent id
    http://localhost:7778/portal/page?_pageid=76,87832&_dad=portal&_schema=PORTAL&parentid=22223

  • Pass a parameter  to a 'portal page'

    I want to pass a parameter to a 'Portal' page. This parameter is a the title of the page. I found that in the page's properties a 'parameter' tab is there where we can add a parameter. But I don't know how the page will read the value of this parameter & display it.
    Thank you for your help.
    Jayasree

    i am trying to pass the parent_id as a parameter to a portal page but am not able to... i can add it to the list of in parameters to the PL/SQL based parent id but when i add the parent id to the url then i get no result... i created a custom attribute for the parent id since there is no attribute build other then page group and page id... when I set the Parent ID attributes default value in the attribute properties of the item type based on PL/SQL it just brings back results for the default value and if i pass a different value for ithe parent id i dont get the correct result I get the result for the default parent id.
    I am using the followin url to pass the parent id
    http://localhost:7778/portal/page?_pageid=76,87832&_dad=portal&_schema=PORTAL&parentid=22223

  • How to auto login and pass data (parameter) to ApEx at the same time

    Does anybody know how to automatically login to apex (e.g. from JSP page) and pass a parameter value at the same time? I can use wwv_flow_custom_auth_std to login, I can even choose a page but I cannot pass any data (at least I do not know how). If I use f?p URL syntax I can pass data but there is no way to pass login/password information.
    Any idea? Thanks Jaros

    Jaros -
    You could copy your login page and make the new page "public". On the new page, add a process before the login process that sets the value of application item FSP_AFTER_LOGIN_URL to the report page URL (with the arguments), e.g.,   :FSP_AFTER_LOGIN_URL := 'f?p=&APP_ID.:100:&SESSION.::NO::P100_X,P100_Y:&RPT_VALUE1.,&RPT_VALUE2.';Create application-level items RPT_VALUE1 and RPT_VALUE2 in the application.
    From your external page, POST to this new "login" page, passing values for the username, password, rpt_value1, and rpt_value2 items.
    Let us know if it works.
    Scott

  • Item Renderer in a Datagrid

    I'm struggling with how to make a check mark ( image ) show
    up or not based on the value of some data in each datagrid line
    item. I'm using an item renderer but I'm missing something. Any
    help would be greatly appreciated.
    thanks,
    STeveR

    The following is my entire itemrenderer...please excuse any
    bad style as this is a WIProgress..
    Its probably easier to quote the adobe docs on listdata...If
    a component implements the IDropInListItemRenderer interface, you
    can use its listData property to obtain information about the data
    passed to the component when you use the component in an item
    renderer or item editor..I made sure the component implements the
    interface as you can see in the code at the top of component. Then
    add the couple of required functions regarding listdata, then you
    can access the listdata in your own functions in the renderer, like
    i do in set data function.
    this.BTN_***_mark.label =
    value[DataGridListData(listData).dataField];
    this line assigns the value from my datagrid to the renderers
    button label. (this renderer is a button that the user can press)
    so i want the buttons label to show the value coming in from the
    datagrid. So listdata is just a way to
    explicitly get the column name where the current data is
    being sourced from in your datagrid.As the grid is being rendered,
    it renders row by row. In each row it goes thru your columns . SO
    initially it for row 1 it would begin rendering firstname, surname,
    mark, average...etc etc. If i put an alert in on
    value[DataGridListData(listData).dataField
    I would see these column names popping up as they are getting
    rendered in the DGrid.
    Hope this helps...
    <!-- <?xml version="1.0" encoding="utf-8"?>-->
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="init()" width="74" height="30"
    horizontalAlign="center" verticalAlign="middle"
    implements="mx.core.IFactory,mx.controls.listClasses.IDropInListItemRenderer">
    <mx:Metadata>
    </mx:Metadata>
    <mx:Script>
    <![CDATA[
    import mx.managers.PopUpManager;
    import mx.controls.DataGrid;
    import mx.utils.ArrayUtil;
    import mx.collections.ArrayCollection;
    import mx.collections.IViewCursor;
    import mx.controls.Alert;
    import mx.events.*;
    import mx.controls.dataGridClasses.DataGridListData;
    import mx.controls.listClasses.BaseListData;
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.containers.TitleWindow;
    private var panel:AssessmentMarkPopup = new
    AssessmentMarkPopup();
    var the_val = 0;
    var col_index:int;
    private var _listData:BaseListData;
    public function get listData() : BaseListData
    return _listData;
    public function set listData( value:BaseListData ) : void
    _listData = value;
    private function showLoginForm():void {
    var pop:AssessmentMarkPopup =
    AssessmentMarkPopup(PopUpManager.createPopUp(this,AssessmentMarkPopup,true));
    pop.addEventListener("closepopup",onClose);
    pop.TXT_***_mark.text = this.BTN_***_mark.label;
    var row:int =
    this.parentApplication.DG_class_students.selectedIndex;
    pop.student_name =
    this.parentApplication.DG_class_students.selectedItem.firstname + "
    " + this.parentApplication.DG_class_students.selectedItem.lastname;
    private function onClose(e:MyClosePopupEvent):void{
    this.BTN_***_mark.label = e.data.mark;
    public function newInstance():*
    return new MarkEntry();
    public override function get data():Object
    return super.data;
    override public function set data(value:Object):void {
    var dg:DataGrid = (listData) ? DataGrid(listData.owner) :
    null;
    var column:DataGridColumn = (dg) ?
    dg.columns[listData.columnIndex] as DataGridColumn : null;
    col_index = listData.columnIndex;
    var str:String = String(column.dataField);
    this.BTN_***_mark.label =
    value[DataGridListData(listData).dataField];
    ]]>
    </mx:Script>
    <mx:Button click="showLoginForm()" id="BTN_***_mark"
    width="52"/>
    </mx:VBox>

  • Passing a parameter to a LookupDispatchAction

    Hi guys. Any idea how am I gonna do that?
    I be got a LookupDispatchAction that has 3-4 methods. The method I am trying to access needs to be passed a parameter. I can get the parameter like
    <html:link page="/updateTLDThrottle.do" paramId="tldName" paramName="item" paramProperty="key">
    delete</html:link>but I want to access a specific method on the updateTLDThrottle action. And I only know how to do that with submit buttons. Any ideas?
    Cheers

    anyone guys?

  • Is it possible to pass a parameter to ON_DEMAND process?

    Hi guys.
    In AJAX, is it possible to pass a parameter to ON_DEMAND process?
    (I get value in javascript and want to pass it to on_demand process...)
    Thanks.
    Mike

    Hi Mike,
    Yes, provided you have set up an Application Item to receive the value you can use this within your PL/SQL code.
    I've detailed what needs doing here:
    http://htmldb.oracle.com/pls/otn/f?p=40042:1
    username/password: guest/guest
    Regards
    Andy

  • Pass a parameter from a report to a customization form of another report

    Hello,
    I want to pass a parameter value from a report to the customization form of another report and display it in the text field in the customization form as a default value. I have 2 variables in the customization form and in one of them, I would like to display the default value from a previous report.
    Thank you
    Jayasree

    1. go to the manage component screen of the report
    2. open the package body (pl/sql source)
    3. search for 'procedure show_parms'
    4. scroll down till you find
    -- call to parameter form rendering engine
    5. copy the procedure call below it
    a) you will have to pass <PORTAL_SCHEMA>.wwv_utlglobl.RUN_AS_NORMAL to p_mode
    b) remove the parameters p_reference_path, p_redirect_url, p_exec_mode, p_page_url ( or you can pass null to them)
    c) 'p_parm_names' will contain your 2 parameters
    d) you can pass values to 'p_parm_values' which you want to be displayed in the parameter forms.
    6. you can call this procedure from a dynamic page and link the dynamic page to your first report

  • Generic item renderer for Adv DG Columns?

    Hello,
    I'm trying to create a generic ItemRenderer for my Adv DG so that so that I can put a toolTip on the cells.
    The Adv DG Column object doesn't have a toolTip property so I'm creating my own renderer...
    As far as I'm aware I have to create an ItemRenderer that knows the fieldName that it is rendering so I can use {data.myFieldName}. I was hoping there was a property so that I can reference the value generically such as {data.text} but this obvisouly doesn't work...
    Is there anyway around this? Can I pass a paramater to the itemRenderer? I'm doing it like this...
    advancedDataGridColumn.itemRenderer = new ClassFactory(renderers.ToolTipFieldRenderer);
    Alsok, there is a toolTip property of the AdvDG but the columns, what is the AdvDG.toolTip used for? Just a general toolTip? The reason why I need a toolTip is our client has asked to be able to mouse-over the cell to see the full value where the field value is chopped because it's too long for the column...
    Hope that makes sense and hope you can help...
    Cheers,
    Nick

    The AdvancedDataGridColumn class has dataTipField and dataTipFunction
    properties and these are supported by the default item renderer
    (AdvancedDataGridItemRenderer), which is also generic. Here's an example:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
        xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="absolute">
      <mx:Script>
          <![CDATA[
             import mx.collections.ArrayCollection;
             private var dpADG:ArrayCollection = new ArrayCollection([
          ]]>
        </mx:Script>
        <mx:AdvancedDataGrid
            height="400"
            width="300"
            sortExpertMode="true"
            dataProvider="">
            <mx:columns>
                <mx:AdvancedDataGridColumn
                    dataField="Artist"
                    dataTipField="Artist"
                    showDataTips="true" />
                <mx:AdvancedDataGridColumn
                    dataField="Album"
                    dataTipField="Album"
                    showDataTips="true" />
                <mx:AdvancedDataGridColumn
                    dataField="Price"
                    dataTipField="Price"
                    showDataTips="true" />  
            </mx:columns>
       </mx:AdvancedDataGrid>      
    </mx:Application

  • Two item renderer for one datagrid column?

    hi
    i have one doubt
    can we use two item renderer for one datagrid column
    any possibilities
    why i am asking this because
    during drag and drop i need one itemrenderer and during application initialization i need another itemrenderer
    any possibilities
    karthik.k

    Hi,
    I think your requirement can be completed by using ViewStack you can pass selected index to it according to requirement.
    See:
    <itemRenederer ...
         <viewstack selectedIndex = 0 ...>
              <vBox id="vBox1" >
                        Your 1st itemrenderer will come here....
              </vBox>
              <vBox id="vBox2" >
                        Your 2nd itemrenderer will come here....
              </vBox>
         </viewStack>
    </itemRenederer>
    You have to just toggle selectedIndex.
    Thanks

Maybe you are looking for

  • Zen Vision M 30gb, used to be able to download music from I tunes, can't now, need he

    I had another computer with I tunes loaded, also used Zen vision M on it along with I Pod, new computer has both products downloaded on it, but for some reason it wont recognize the Zen or let me download music from the i tunes library like i used to

  • Advice Needed - Should I just do a Clean Install?

    I've got an older 17" iMac FP that I handed down to the kids (6 and 9). The mainly use Garageband and Pages. Since this was my original machine (before getting my new 20" iMac G5) I decided to leave my account on there, just for a backup. Lately they

  • Error in PSA after running process chain

    Hello All, I have ran a process chain, which came back with an error.  I have checked the PSA and there is one line which has an error.  How can I resolve it and reload the data into the cube succesfully?  Is there away to delete the data from the PS

  • How to download iPhoto for Mavericks?

    After a clean install of OS X 10.9 Mavericks on my Mac Mini, I went to the Mac App Store to download iPhoto. It says I can't, because iPhoto 9.6 requires OS X 10.10. Yosemite. Upgrading to Yosemite is not an option. Fine, and how do I get iPhoto for

  • How do I stop spotlight from indexing files?

    I only have 2GB of RAM and Indexing files really slows down my computer, so much that i can hardly operate the computer. Is there any way that i can stop Spotlight from indexing my files automatically or have it index every week instead of every day?