How to create generically styled itemrenderer?

G'day,
This is my first dabble with Flex 4, after we have been using Flex 3 for the past two years.
I want to style an ItemRenderer for a list. That is all cool, and the new state syntax makes it really easy for me to create transitions between states, as well as different styles for different states.
My problem:
If the item renderer is used in two different locations in the app, I want the controls within that item renderer to be different, but the styles to be the same. E.g. In a document management system, the list items will want to display an icon, a filename, filesize, and version number, whereas in the Project Management system, I may want to have just the project name and a progress bar depicting how far completed the project is. Both these lists will have the same styles (same background shape, same transitions between states, same padding, etc) but they will house different controls.
I have read a whole bunch of articles about skinning via google, and a lot of them are starting to blur into one. I am starting to get mixed up about when to use a skin, style, or itemrenderer for a particular rendering task, and which part is responsible for different parts of rendering.
What I thought the solution would be:
public class MyRenderer extends SkinnableComponent implements IItemRenderer { ... }
I set the skinClass of the renderer to the appropriate skin and in that skin, place a 'DataGroup id="contentGroup"', and then a bunch of components inside the renderer. Both modules have their own renderer, but use the same skin. This works in as far as the normal state is rendered in the skin, and the content group is correctly populated with the children of MyRenderer. It does not work in as far as I lose all of the state handling code found inside the ItemRenderer component, so the 'selected' and 'hovered' state are not rendered in the skin. It just sticks with the default state.
Any help would be greatly appreciated, and I am more than happy to attach some example code if my convoluted explanation is no good : )
cheers.
Edit:
Re: My confusion about skins/styles - I understand that the skin should take care of the components and all aspects of rendering, but I am asking the itemrender to deal with the components and the skin to do the styles. I also realise that this would normally be a job for styling rather than skinning, but the styles I want to share amongst modules are more than what CSS provides (such as transitions between the normal and hovered state).
Message was edited by: serwylo

Ok, I have figured out an ugly hack which works. After reading the response to this post: http://forums.adobe.com/message/2370902#2370902, it became clear that ItemRenderers are intentionally not SkinnableComponents. The rational is that the majority of use cases will not need to separate the skin from the component when dealing with item renderers.
This is fair enough, but to achieve what I want, I needed a skinnable ItemRenderer. I did the unthinkable, and copied the ItemRenderer code. The only change was to extend SkinnableContainer instead of DataRenderer. I then mirrored the componentState with the skinState as per this blog: http://saturnboy.com/2009/09/flex4-component-states-skin-states/ calling invalidateSkinState in a handler for StateChangeEvent.CURRENT_STATE_CHANGE.
cheers.

Similar Messages

  • How to create generic search help in wd abap

    Hi experts,
          How to create generic search help in wd abap.
    Regards...
    Arun.

    Hi Arun,
    Following links have step by step procedures for creating search helps and other related topics.
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/3d/e53642e2a3ab04e10000000a1550b0/content.htm">ABAP Dictionary Search Help for WD</a>
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/9b/c51c42735b5133e10000000a155106/content.htm">Input Help in WD ABAP</a>
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21ee2b446011d189700000e8322d00/content.htm">Search Helps</a>
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21ee5f446011d189700000e8322d00/content.htm">Creating Elementary Search Help</a>
    Regards,
    Neha
    <i><b>PS:Reward if helpful</b></i>

  • How to create generic master data  datasource .

    How to create generic master data  datasource which utilises ALE change pointers for extraction of master data.

    Hi,
    For any master data lets say, Material Master, for this you need to create a view
    based on your requirement by selecting one or more tables into your view and
    keeping all the required fields in the view as viewfields and go to RS02 create
    generic data source, select the view option as source and put the view, save and
    activate, at the same time set the delta pointer as to whether Numericpointer/date/timestamp..this way you can create a generic DS then transfer the stru. and at the BW side replicate the source system..and so on..
    Hope this helps..
    Assign points if useful.
    Need further info revert..
    Cheers,
    Pattan.

  • How to create generic data source in R/3

    hi experts !
    i m a beginner in BIW.
    i wan to create a generic data source in my R/3 system. since there exists a Z table which i want to use in designing an infocube in my BI system. please someone help me how should i begin with doing it ?
    thanx in advance
    akanksha

    Akanksha,
    Here am providing you with a scenario when we go for Generic Datasource and also the steps to create a Generioc DS:
    We can create datasource based on View, Table, SAP Query or ABAP Query, and Function Module.
    Scenario for Generic Datasource.
          One of the Manager who using reports wanted to have the  report which will him the list customers and sales document numbers created by them.
         In this case we can use of VIEW where kna1 and vbak tables were combined in the View definition or else u can say that “ABAPer had given the required view”.
    How to create the generic Datasource.
          Goto RS02, select the Transactional Data, it will takes us to the next screen, where we need to give application component name say SD (01), then give the name of the Datasource that u wanted, select view and give the view name. Below that field we need give 3 descriptions. Then save and activate the datasource.
        Go back to the RSA6 screen transport it to BW system. Replicate the DS.
    Hope it helps..
    Assign Points if it helps
    Regards,
    Gattu

  • How to create Generic Service in HCM Processes and Forms

    Hi Friend's,
      Can you tell me what are the steps to create Generic Service in HCM Processes and Forms and also tell me how to link Generic service with BADI.
       In SPRO, I defined one customized generic service, but i cant able to implement the generic service to BADI. Moreover it's asking for Composite Badi Implementation name.
       So tell me the steps which guide me to create that.. Waiting for your replies....

    hi ramesh,
                      use HRASR00GEN_SERVICE_BASIC  create ur own.
    Madhukar

  • How to create generic text datasource to load text data?

    met issue in generic master data load
    Hi,
    please see above link for detail infomation regarding the attribute data load. now the language and description column of the infoobject s_saled is empty. i need to create a generic text datasource to load data from R3 to BW. the table which i use to extract attribute data is VBAK, but i don't find any filed relate to language and description.
    met issue in generic master data load
    can anyone tell me how to load the text data?
    thanks very much.
    Eileen

    hi eileen,
    go to transactio rso2  in your source system ie r/3.
    there u have three three fields for transaction data
                                                    attributes.
                                                     text.
    choose text and proceed as u did for trancsaction data load.
    thank u,
    reward if helpful.

  • How to create a Generic Object Services for a standard tcode.

    Hi,
    We have a requirement where we are depreciating the assets (standard transaction ABAA) using a custom BDC program. We need to maintain a history (called audit trail) for the particular asset that has been depreciated using this program. For this audit train we have been asked to use "Generic Object Services" in transaction code ABAA.
    Unfortunately, Generic object services are not available in this transaction code. Can you please suggest me how to create "Generic Object Services" for a particular standard transaction code. Also, we have show the details of custom workflow that follows the approval process in order to depreciate the asset. how to show this workflow details using Generic Services. This is a very critical issue, any help will be very help ful.
    Please let me know should you require more information on this topic.
    Thanks,
    Ashish

    Instead of copyg the std fm to z, do the following,
    1. Go to se37 open FM VIEW_KURGV in display mode.
    2. Click on the spiral icon on the top.
    3. Then in menu go edit->enhancment options -> show implicit enhancement
    4. """""""""""""""""""""" kind of lines will appear in the cde, just rt click on the line at the place u want to insert the code and select
         enhancement implementation create.
    5. Give apropriate name for thi , it will inset a n place to write your code.
    This is an std sap methodology and is supported in upgradde also.

  • HOW TO CREATE SAP BW DATA SOURCES FOR TDS REPORT?

    Hi All,
    How to create generic data source for these fields?
    I have TDS report these names and field.
    Pls anyone guide me..
    PAN NUMBER
    J_1IPANNO
    VENDOR NAME (accont type - k)
    LIFNR
    POSTING DATE
    BUDAT
    WITHHOLDING TAX  BASE
    WT_QSSHH
    WITHHOLDING TAX  AMOUNT
    WT_QBSHH
    NAME OF WITHHOLD TAX TYPE
    WITHT

    Hi ,
    Thanks for giving info.
    How to add different tables in generic data source?
    PAN NUMBER
    J_1IPANNO
    J_1IMOVEND
    VENDOR NAME (accont type - k)
    LIFNR
    J_1IMOVEND
    POSTING DATE
    BUDAT
    RBKP
    WITHHOLDING TAX  BASE
    WT_QSSHH
    WITH_ITEM
    WITHHOLDING TAX  AMOUNT
    WT_QBSHH
    WITH_ITEM
    NAME OF WITHHOLD TAX TYPE
    WITHT
    WITH_ITEM

  • How do i create a styled spry mysql driven menu using dreamweaver cs4?

    How do i create a styled spry mysql driven menu using dreamweaver cs4?
    I have cs4. I gave up on using MS sql as a datasource. I finally got a php successfull connection in my PHP web page.
    I would like a nice video tutorial for creating a dynamic menu.
    I guess i can style it by attaching a css file to the page. Are their any already designed css files out there in some online area?
    i am not a good designer. so i would like to simply have a collection of menu_style.css files and choose what looks good.
    But first i need to build the spry menu from the mysql database.
    Any help is apprechiated.
    My first choice was to maintain the data in an MS sql server file. If i could directly attach to an ms sql datasource then that would be the best option.
    I dont think i want to have to re-generate an XML datasource each time i add or modify the menu. I would like to maintain the MS Sql or mySql file instead.
    If i could generate an XML datasource from the MS Sql database then I may even prefere that, but i have spent a lot of time trying to figure out how to do that and not had any success. So i prefere working in MS sql but would settle for mySql if i had to.
    Thanks
    Jerry

    To create a dynamic menu take a look here http://labs.adobe.com/technologies/spry/samples/menubar/MenuFromNestedData.html#
    The XML file for the above menu looks like this
    <?xml version="1.0" encoding="utf-8"?>
    <items>
         <item id="0001" type="donut">
              <name>Cake</name>
              <ppu>0.55</ppu>
              <batters>
                   <batter id="1001">Regular</batter>
                   <batter id="1002">Chocolate</batter>
                   <batter id="1003">Blueberry</batter>
                   <batter id="1003">Devil's Food</batter>
              </batters>
              <topping id="5001">None</topping>
              <topping id="5002">Glazed</topping>
              <topping id="5005">Sugar</topping>
              <topping id="5007">Powdered Sugar</topping>
              <topping id="5006">Chocolate with Sprinkles</topping>
              <topping id="5003">Chocolate</topping>
              <topping id="5004">Maple</topping>
         </item>
         <item id="0002" type="donut">
              <name>Raised</name>
              <ppu>0.55</ppu>
              <batters>
                   <batter id="1001">Regular</batter>
              </batters>
              <topping id="5001">None</topping>
              <topping id="5002">Glazed</topping>
              <topping id="5005">Sugar</topping>
              <topping id="5003">Chocolate</topping>
              <topping id="5004">Maple</topping>
         </item>
         <item id="0003" type="donut">
              <name>Buttermilk</name>
              <ppu>0.55</ppu>
              <batters>
                   <batter id="1001">Regular</batter>
                   <batter id="1002">Chocolate</batter>
              </batters>
         </item>
         <item id="0004" type="bar">
              <name>Bar</name>
              <ppu>0.75</ppu>
              <batters>
                   <batter id="1001">Regular</batter>
              </batters>
              <topping id="5003">Chocolate</topping>
              <topping id="5004">Maple</topping>
              <fillings>
                   <filling id="7001">
                        <name>None</name>
                        <addcost>0</addcost>
                   </filling>
                   <filling id="7002">
                        <name>Custard</name>
                        <addcost>0.25</addcost>
                   </filling>
                   <filling id="7003">
                        <name>Whipped Cream</name>
                        <addcost>0.25</addcost>
                   </filling>
              </fillings>
         </item>
         <item id="0005" type="twist">
              <name>Twist</name>
              <ppu>0.65</ppu>
              <batters>
                   <batter id="1001">Regular</batter>
              </batters>
              <topping id="5002">Glazed</topping>
              <topping id="5005">Sugar</topping>
         </item>
         <item id="0006" type="filled">
              <name>Filled</name>
              <ppu>0.75</ppu>
              <batters>
                   <batter id="1001">Regular</batter>
              </batters>
              <topping id="5002">Glazed</topping>
              <topping id="5007">Powdered Sugar</topping>
              <topping id="5003">Chocolate</topping>
              <topping id="5004">Maple</topping>
              <fillings>
                   <filling id="7002">
                        <name>Custard</name>
                        <addcost>0</addcost>
                   </filling>
                   <filling id="7003">
                        <name>Whipped Cream</name>
                        <addcost>0</addcost>
                   </filling>
                   <filling id="7004">
                        <name>Strawberry Jelly</name>
                        <addcost>0</addcost>
                   </filling>
                   <filling id="7005">
                        <name>Rasberry Jelly</name>
                        <addcost>0</addcost>
                   </filling>
              </fillings>
         </item>
    </items>
    Then remains the manner in which you create the XML file which can be found here http://labs.adobe.com/technologies/spry/samples/utils/query2xml.html
    One you have your menu up and running, you will be able to apply styles and effects

  • How to create a generic method?

    Hi,
      I am using a std task TS01200205 to create instance for a BOR object. There are 2 key fields. I want to pass these 2 to the ObjectKey field.
    As for as I know, we have to concatenate these two Keyfields and assign it to 'Object Key' parameter.
      How can I concatenate the 2 strings in my Workflow? Is there any std way of doing it?
    Also what is a generic method? How to create it? Can I make use of generic method to achieve this?
    Thanks,
    Sivagami

    If you want to use it in different workflows the best solution is probably to define an interface and define and implement the method there (a nice thing about BOR interfaces is that you can provide an implementation and not just the definition).
    All you then need to do is let your object type(s) implement that interface, which only requires adding the interface since the implementation has been done already.
    However, I am not saying this is a good way of approaching things, I'm just telling you how you can implement what you suggest.

  • How to create the generic extractors in sap R/3?,pabitra

    Hi,
         How to create the generic extractors in sap R/3?
    Though it comes under cross application and the types of generic extractors are functional module ,db view,infoset query etc.Do u think the g.e can be built of one of the is types.plz tell correctly
    Advance thanks
    regards
    pabitra

    Hi,
    this is for DB view ,
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed06446011d189700000e8322d00/frameset.htm
    this is for infoset query,
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/cb43b2455611d189710000e8322d00/frameset.htm
    Good day,
    regards
    Arun

  • How to create a generic method which invokes Web Service

    Hi I have a question how to create Web Service client. In design mode I can't specify static url ?WSDL and process.
    I found briliant method in apache cxf library.
    for example
    JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
    Client clientA = dcf.createClient("http://soabpm-vm:8001/soa-infra/services/default/MailSender/mailsender_client_ep?WSDL");
    Object[] resultA;
    try{
    resultA = clientA.invoke(new QName("http://xmlns.oracle.com/SynchDSBpel20/MailSender/MailSender", "process"), "@", "body", "topic");
    }catch (Exception e){}
    In my case I should create a method with params (urls ?WSDL, URI, operetion name, param1, praram2, param3)
    Is there anything like CXF in ADF library's?

    This can be very easily done using a web service proxy (Select web services from the categories and web service proxy from the items).
    In the "Create Web Service Proxy" wizard, make sure you select JAX-WS client style. JDeveloper will use the JAX-WS web service API and JAXB (Java Architecture for XML Binding) to generate all required classes and methods required to call a web services, binding Java method signatures to WSDL messages and operations.
    Regards
    Antonis

  • How to create characteristics in BW based on generic datasource fields

    hi ALL,
       Actually, i created generic datasource based on database view in SAP R/3
    Database view is created based on table LFA1.
    Replicated the the datasource in SAP BW
    Now, I have to create characteristics (master data) based
    on generic datasource fields
    Thanks in Advance.
    Best Regards
    M A Mubeen

    Hi Abdul,
        for that you just create  one  charecterstic  of  Info object (with the  same technical charecterstics of R/3 field).. and  maintain master  data..
    now create one data source in  BW side.. and  select your data source and replicate  data with your generic datasource...
    and load the data..
    regards
    @jay

  • How to create a background image for each item in a List object

    Hello.
    I am trying to create a background image that displays whenever a user posts something to a list.  For example when a user posts text it would appear in a list.  The new item in the list would contain a specific background image with the users text appearing on top of the background image.  I do not want a background image for the entire list, rather each item within the list.
    I am not sure how clear this is so I added an image below.  When a user enters text in and clicks the "post-it" button their text would appear below with the sticky note background. 
    I am not sure which list type would be best for this problem or how to create insert the image, so I am open to suggestions. 
    Thank you for your help.  Any advice or guidance will be greatly appreciated!

    Hi
    the easiest way would be with itemRenderer.
    You have to do two things:
    1. In your list declaration use a item renderer: <mx:List itemRenderer="myRenderer"/>
    2. create a flex component myRenderer that will be the single item. This can be a canvas with a background image and a text field on it.
    When you add a new item to the list, a new myRenderer item will be created and the data property will be passed to it. So you have to put "data" in your textField.
    If you need more help try looking at Tour de Flex samples, they're pretty easy.
    Andrei

  • How to create a vertical report

    I am new to Application Express. I am trying to create some basic financial reports using it (e.g. Income Statement, Balance Sheet). Typically, these reports are organized vertically where each quarter's financial data is displayed as a separate column. Can someone point me in the right direction on how to create these types of reports using Application Express?
    I did play with the "vertical report, look 1" report template. When I used this each record was oriented vertically instead of the default horizontal orientation, but the records appeared in individual tables instead of one large table with multiple columns.
    Here is an example of the type of report I am trying to create: http://finance.yahoo.com/q/is?s=ORCL
    Thanks in advance.

    Hi Jim,
    You can do this if you create a custom Row Template. I don't have your tables, so the following is based on:
    SELECT ENAME, SAL, COMM FROM EMP ORDER BY 11 - Go to Shared Components, Templates
    2 - Click Create
    3 - Select Report
    4 - Select From Scratch
    5 - Enter a name for the template, select any template class (eg, Custom 1) and select "Named Column (row template)"
    6 - Click Create
    Now edit the template and use the following settings:
    Row Template 1
    &lt;td align="right" style="width:200px;"&gt;#1#&lt;br&gt;#2#&lt;br&gt;#3#&lt;br&gt;&lt;/td&gt;Before Rows
    &lt;table&gt;
    &lt;tr&gt;
    &lt;td align="right"&gt;Name&lt;br&gt;Salary&lt;br&gt;Commission&lt;/td&gt;After Rows
    &lt;/tr&gt;
    &lt;/table&gt;The pagination settings can be copied from a report template of your choice
    Attach the new template to your report and run the page. The Before Rows html will be rendered first, then for each "row" in the report a new TD cell is created with all the data for that "row" (note that #1#, #2# and #3# refers to columns 1, 2 and 3 - so, in this example, that's ENAME, SAL and COMM respectively) and, after the maximum number of rows per the report settings has been reached, the After Rows html is added, thereby completing the row.
    Obviously, you'll have to add in your own styling and change the above to suit your specific needs, but that should give you a starting point.
    Andy

Maybe you are looking for

  • How do I find the copied itunes library on my computer?

    I'm trying to transfer my itunes library to an exteral hard drive, I followed the instructions on this page and I think I copied my library but not only do I not understand how to actually transfer it to my external hard drive but now I think I have

  • Migrating to my Mac mini, but to two accounts!

    I seem to finally have suceeded in migratingall my things, but I hade to Migrate Data and Prefrences two times. So now I have my ordinary user account fully set up, but when I got my mail working, this was done on another account. So I have mail and

  • PDF Open parameters not working on windows

    Hi, I have been trying to use the PDF open parameters but have run into some issues: 1.  http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf#search=collab& navpanes=0 The above URL should hide the left navigation pane, but it

  • Mailing PO to Vendor

    Dear All, Inspite of maintained all the details correctly to send PO via e-mail it is still going to mail request, which I need to go to T.code: SCOT to send the mail. Kindly tell where i need to configure so that as soon as I click send e-mail it sh

  • Connecting Hana with DTW using an user different to SYSTEM

    Hi experts, I have created an user in HANA with this privileges: GRANTED ROLES SYSTEM PRIVILEGES OBJECT PRIVILEGES AFLPM_CREATOR_ERASER_EXECUTE CATALOG READ SBOCOMMON CONTENT_ADMIN CREATE SCHEMA SBODEMOCL PUBLIC DATA ADMIN IMPORT I'm trying to connec