Component with Generic Properties

I am looking for a way to create a component with facelets that can take any generic properties. For instance, if the namespace of my taglib is "myns", I would like to be able to put the following in my xhtml pages:
<myns:general a="foo" b="bar" somethingCompletelyDifferent="#{helloWorld}" />I would like to reference the property in a template file as follows:
<h:outputText value="#{generalInstance.a}" />#{generalInstance} evaluates to a ComponentRef instance, so I get a PropertyNotFoundException.
All the component needs to do is store the properties as it would any normal attribute. Is this possible?
Thanks,
David
Edited by: dgreenbean83 on Sep 2, 2008 8:27 PM
Edited by: dgreenbean83 on Sep 2, 2008 8:29 PM

I've not really following where "generalInstance" came from in your example.
If you make a Facelets tag handler based on a file, it will accept any attribute and make it available via EL within the definition file. See the proper section in the [Facelets developer documentation|https://facelets.dev.java.net/nonav/docs/dev/docbook.html#taglib-create-source] for more details.

Similar Messages

  • How to create a text Component With Certain Properties

    I need to create a text component with the following properties:
    Has Capability to be italic, right/left aligned, have different background / foreground colors, and most importantly, the ability to have a fixed width and a height that is set by the amount of text in it (ie line wrapping expands the field vertically).
    It should be a simple exercise, but I cannot seem to figure out how to do it.

    Here is the correct syntax :
    private static JEditorPane constructPane(String text, int normWidth, int normHeight, boolean rightAlign, boolean italic,boolean isWhite) {
              JEditorPane pane = new JEditorPane();
              pane.setEditable(false);
              pane.setContentType("text/html");
              pane.setText(
                   "<html><head></head><body>"
                   + (italic?"<i>":"")
                   + "<table><COLGROUP><COL width=\""+normWidth+"\"><THREAD><tr><td valign=\"top\" align="+(rightAlign?"\"right\"":"\"left\"")+">"
                   + text+"</td></tr></table>"
                   + (italic?"</i>":"")
                   + "</body></html>");
              pane.setSize(normWidth,normHeight);
              if(isWhite)
                   pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1,0,1,0,Color.WHITE),BorderFactory.createEmptyBorder(0,1,0,1)));
                   pane.setForeground(Color.WHITE);
              else {
                   pane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(1,0,1,0,Color.BLACK),BorderFactory.createEmptyBorder(0,1,0,1)));
                   pane.setForeground(Color.BLACK);
              return pane;
         }

  • Cfc component with readonly properties and web services

    I want to transfer a cfc component across coldfusion web
    services as a data transfer object. This cfc component is received
    when calling a load web service, and then supplied to an update web
    service. Some properties within the cfc need to be readonly since
    the update web service would ignore them.
    In java I would have my data transfer object with only public
    set methods for those properties which are not readonly. How can I
    achieve this in coldfusion?

    Hi,
    Please check note 1004108.
    Methods of Application and/or Entity Services (Business Objects) of CAF of SAP NetWeaver CE 7.1 cannot be exposed in document style, only RPC/literal is possible. Sorry.
    It's a restriction that is planned to be solved in one of the next releases.
    Regards,
       Jan

  • Import from database an internal table with generic Type : Web Dynpro ABAP

    Hi everyone,
    i have a requirement in which i'm asked to transfer data flow between two frameworks, from WD Component to another. The problem is that i have to transfer internal tables with generic types. i used the import/ export from database approache but in that way i get an error message saying "Object references and data references not yet supported".
    Here is my code to extract a generic internal table from memory.
        DATA l_table_f4 TYPE TABLE OF REF TO data.
      FIELD-SYMBOLS: <l_table_f4> TYPE STANDARD TABLE.
      DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .
      DATA: ls_indx TYPE indx.
      lo_componentcontroller =   wd_this->get_componentcontroller_ctr( ).
      lo_componentcontroller->fire_vh_search_action_evt( ).
      ASSIGN l_table_f4 TO <l_table_f4>.
    *-- Import table for Help F4
      IMPORT l_table_f4 TO <l_table_f4> FROM DATABASE indx(v1) TO ls_indx ID 'table_help_f4_ID'.
    The error message is desplayed when last instruction is executed " IMPORT l_table_f4...".
    I saw another post facing the same problem but never solved "Generic Type for import Database".
    Please can anyone help ?
    Thanks & Kind regards.

    hi KIan,
    go:
    general type
    TYPE : BEGIN OF ty_itab,
               field1 TYPE ztab-field1,
               field2 TYPE ztab-field2,
    *your own fields here:
               field TYPE i,
               field(30) TYPE c,
               END OF ty_itab.
    work area
    DATA : gw_itab TYPE ty_itab.
    internal table
    DATA : gt_itab TYPE TABLE OF ty_itab.
    hope this helps
    ec

  • Converting enumerations to lists with generics

    hello...
    i want to list off system properties and sort them.
    how can you convert enumerations to lists with generics?
    i tried the following in eclipse, but it fails...
         Properties properties = System.getProperties( ) ;
         Enumeration<?> enumeration = properties.propertyNames( ) ;
         ArrayList<String> arrayListEnum = Collections.list( enumeration ) ;
         Collections.sort( arrayListEnum ) ;

    Because the type parameter of Enumeration (<?>) is not compatible with the type parameter of ArrayList (<String>).
    You'll have to do some manual casting yourself.
    Unfortunately, there's nothing to guarantee that system property keys or values are strings (hence why Enumeration<?> and no Enumeration<String>) so you'll need to cope if you find one that isn't.

  • Retrieving the COM class factory for component with CLSID {85DE1C45-2C66-101B-B02E-04021C009402} fai

    I get the following error when i try and access a site I'm working on through internet explorer, but it works fine when i run it in the visual studio 2005 environment.<br /><br />(I'm trying to complete a pdf with form fields)<br /><br />======<br /><br />Retrieving the COM class factory for component with CLSID {85DE1C45-2C66-101B-B02E-04021C009402} failed due to the following error: 80070005. <br />Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br /><br />Exception Details: System.UnauthorizedAccessException: Retrieving the COM class factory for component with CLSID {85DE1C45-2C66-101B-B02E-04021C009402} failed due to the following error: 80070005. <br /><br />ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. <br /><br />To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.<br /><br />======<br /><br />       // Initialize Acrobat by creating App object.<br />        CAcroApp acroApp = new AcroAppClass();      //<- Break happens here  <br /><br />       // Create an AVDoc object<br />        CAcroAVDoc avDoc = new AcroAVDocClass();<br /><br />Does anyone know of a way to solve this? I'm trying to swap over from iTextSharp to the actual adobe sdk, as I've had some bugs with iText.

    A lot to try and cover here.
    >I saw that the one pdf was created in Adobe Designer 7.1 and the other in Amgraf OneForm Designer Plus.
    Ok, we can only say anything about the first one. But you must find
    out what kind of form it is if you want to work with it
    programmatically: they are utterly unlike each other.
    You cannot use FDF format with an a form made with Designer (also
    called an XFA form or XML form). But you can import an XML file in
    Acrobat.
    >
    >Based on the second part of your reply i'm assuming the way i'm currently passing the data to the pdf is the reason i get the following message
    >
    >"This document enabled extended features in Adobe Reader. The document has been changed since it was created and use of extended features is no longer available"
    No, completely different issue. This file has been prepared specially
    so it can be saved in Adobe Reader. Any change to the file will break
    this. The only exception is Acrobat, which you cannot use.
    No third party product can repair this, but Adobe's server product
    LiveCycle Reader Extensions can put back the rights. You might use
    this in conjunction with LiveCycle Forms.
    Aandi Inston

  • "Retrieve the COM class factory from component with CLSID {623F456-...etc}

    When i try to run on Window server 2008 R2 it gives following error
    "Retrieve the COM class factory from component with CLSID {623F456-...etc} failed due to the followi
    i developed application in xp  it run fine

    Hi
    When you make an ard select the target CPU x86 rather then any CPU in advanced compile options(Properties-> Compile-> Advance Compile Options)
    hope it helps
    Regards
    Rupinder

  • Personalizing iView with Custom properties / display attributes

    Hello Friends,
    I need the help on folllowing requirement
    All users should be displayed an iView displaying different time e.g. India, USA, Nepal, Srilanka, etc.
    Now when user clicks on personalize option present on the iView he should be be able to select his preferred time zone i.e. User 1 selects India and USA , User 2 selects India and Sri Lanka  and so on.
    I have already created an webdynpro application displaying different time zone, now i need to do the personalizaion part.
    Any idea how can i achieve this?
    Similarly, other requirement is to display news to all users and each user should be able to personalize the news category
    For. e.g
    Finance
    Sports
    Entertainment
    Business
    ........ etc
    On sap service site i can see something similar the have provided personalized option for slecting news on location (Country) basis.
    Thanks in advance.
    <b>Points assured for helpful answers</b>
    Anshul

    There are quite a few examples in SDN of creating portal components that allow for personalization. When you make a portal component with NWDS, one of the files created is called portalapp.xml. In there you can add properties. These properties can be retrieved under program conotrol, and if you setup the properties correctly, then a user can use the iView personalization to store their own values.
    The following code:
         public void doContent(
              IPortalComponentRequest request,
              IPortalComponentResponse response) {
              IPortalComponentProfile profile;
              profile = request.getComponentContext().getProfile();
              String caching = profile.getProperty("caching");
              String rows = profile.getProperty("rows");
              String timescale = profile.getProperty("timescale");
    returns the value of the properties.
    The portalapp.xml fragment looks like this:
            <property name="caching" value="false">
            <property name="personalization" value="dialog"/>
            <property name="plainDescription" value="Cache contents"/>
            <property name="type" value="select[true,false]"/>
            </property>
            <property name="rows" value="50">
            <property name="personalization" value="dialog"/>
            <property name="plainDescription" value="Number of rows to display"/>
            <property name="type" value="numeric"/>
            </property>
            <property name="timescale" value="1 h">
            <property name="personalization" value="dialog"/>
            <property name="plainDescription" value="Timescale for calendar"/>
            <property name="type" value="select[1/2 h,1 h,2 h]"/>
            </property>

  • Component with Live Preview

    There seems to be very little information on developing a
    custom component with live preview.
    So far i've created a swf whose application class extends
    UIComponent.
    I've also created a custom component.
    Then I've added the Live Preview field in the custom
    component's Component Definition.
    What I would like to do now is reposition elements within the
    preview swf when the user resizes the component.
    To do this i need to know two things - 1 what event to listen
    for when the user resizes the component, and 2 the current
    dimensions of the resized component.
    1. My only success was that ComponentEvent.SHOW seems to
    dispatch when the user resizes the component. (i had no luck with
    any of the RESIZE events - Event.RESIZE etc)
    2. However the width/height properties don't seem to change
    on resize, they stay at the original dimensions of the component.
    Any ideas?

    Hey Craig :)
    now I'm not certain about this under 3, but when developing
    with under 2 with a live preview one needs to include a 'magical'
    MC named 'xch' (instance name as well) that basically contains
    'nothing' - it's a empty mc on the preview files timeline. there
    are 'other' things as well however, in the live preview file one
    must create a method named 'onUpdate' and assign a property of the
    xch named 'instance' to 'this' (ref the timeline of the preview
    file... previous to the method declaration) then within the
    onUpdate method 'all' properties of the component and statements
    within the method refer to xch.prop = blah blah, xch.otherprop =
    blah blah
    it's quite complicated and doesn't really make a lot of
    sense, but that seems to be the way in which the working file
    relates to the live preview file - ie. 'through' the xch clip which
    triggers the onUpdate method
    from what i remember, it's this mc that 'helps' the resize
    event 'make' the connection between the event and the preview file,
    seems to me that there was something else involved as well but i
    cant seem to remember atm - I found this information in an article
    on building components, however the page is no longer valid and i
    couldn't track it down for you (it was a good tut too) sorry wish i
    had more info for you.

  • Text-input component with auto-complete functionality for mobile

    Hey guys,
    I wonder if there is a text-input component with auto-complete functionality optimized for mobile development with AIR like the one that Android provides natively as you can see here http://developer.android.com/reference/android/widget/AutoCompleteTextView.html and here http://developer.android.com/resources/tutorials/views/hello-autocomplete.html.
    At least I didn't find it in the latest SDK and I think such a component is pretty standard nowadays. Or did I simply overlook it?
    Thank you guys for any advice.
    Regards,
    Thilo

    Hi relaxtraja,
    thanks for your reply!
    I knew that there are a lot of auto-complete scripts on the web. What I was hoping was, that Adobe provides an officially supported auto-complete component optimized for mobile as part of the SDK (like in the Android SDK as I pointed out), but that doesn't seem to be the case. It's sad, because it's an essential part of modern UIs in mobile applications.
    I've already created an auto-complete component by myself based on Spark components and I will end up using it. But I will have to optimize it for mobile applications beforehands. I just think something this essential should be provided by the SDK.
    However, thanks for posting!
    Regards,
    Thilo

  • How to configure oracle 6i report server run time component with application server

    we got oracle 6i report server for developing the web based reports for our undergoing product. we r succesed in developing the web based reports using oracle 6i report server.But we r facing problems while deploying the product with oracle reports at clients place,why because the client does not have the oracle 6i report server. To solve this problem we have to configure the oracle 6i report server run time component with application server at client side , but we are unable to configure this component(that is CGI handler).

    You can run multiple instances of Reports Server in 6i.
    In tnsnames.ora, for each server, have a different name and each listening to different port.
    For example,
    server1.world = (ADDRESS = (PROTOCOL = TCP)(Host = myhost.mydomain.com)(Port = 1949))
    server2.world = (ADDRESS = (PROTOCOL = TCP)(Host = myhost.mydomain.com)(Port = 1950))
    Also, if you want to know about Reports Server Clustering, you may refer to "Publishing Reports" document on OTN:
    http://otn.oracle.com/docs/products/reports/pdf/A73173_01.pdf

  • How can I select an item from a list component with a seperate button

    This is a repost, I decided it'd probably be better here than
    in the general discussion board. I will try to delete the other
    one.
    Hello Everyone,
    This is my first post here. I am trying to figure out how to
    select an item within a list component with a button. This button
    is calling a function. I have searched for the past 3 hours online
    and I can't find anything about it. I thought perhaps I could set
    the selectedItem parameter, but that is read only, and I believe it
    returns an object reference rather than something like a number so
    even if i could set it, it would be pointless. I also found a get
    focus button, thought that may lead me somewhere, but I think that
    is for setting which component has focus currently as far as typing
    in and things like that. I am lost.
    Basically I am looking for a way to type this
    myList.setSelected(5); where 5 is the 5th item in the list.
    Any help would be much appreciated.

    Never mind found it. It is the property called selectedIndex
    and it is writable

  • Software component with Key ID does not exist

    Hi Friends,
               Here I am in need of your help. I got involved in an upgrade from XI 3.0 to PI 7.1. The Basis has imported all the SWC & Business systems from XI 3.0. When I am trying to activate the objects imported from IR of XI3.0 then It is triggering an error as
    data retrieving failed from Adapter Metadata  | RFC http://sap.com/xi/XI/System. /// ROA_MOA_NOTCOMPLETED.
                Because of this I am unable to activate the imported objects in ID by showing the message as Software component with key ID XXXXXXXXXXXXXXXXXXXXX  does not exist.
                when I went there to ESR then under a software component I found a message under underlying components  like             " XXXXXXXXXXXXXXXXXXXXX not exist"  but I am not aware of the object related to that Key ID.
    Please help me out in this . Thanking you in Advance.
    Regards,
    Sridhar

    Hi Neeetesh,
             I got the alternative solution for my problem. All credit goes to you. I recreated the communication channels instead of using the same ones after Upgrad. Any way we need to change the communication channels after importing the channels but the system is giving the above error message as   "Adapter Software component with Key ID XXXXXXXX......  does not exist".
             But its allowing me to create a new channel. Then based on the neetesh suggestion, I went through and create the new comm channels instead of wasting so much time on the same issue.
            Thanks a lot Neetesh.     
             I am really sorry for not giving your  points.  I am assigning points  now with great pleasure. Here you go.
    Regards,
    Dasari.

  • Batch Input : Adding component with C002

    Hi all
    I try to add component on a production ordrer with C0O2 but i have problem with the item category 'R' (Variable-size item). In fact, SAP ask me to fill variable-size item data but i can't run this step with batch input.
    For example with the batch input recorder, i obtain :
    SAPLCOKO1 0110 X
         BDC_OKCODE                         /00
         CAUFVD-AUFNR          10001280
    SAPLCOKO1 0115 X
         BDC_OKCODE          =KPU2
    SAPLCOMK 0120 X
         BDC_CURSOR          RESBD-LGORT(23)
         BDC_OKCODE          /00
         FILTER_BOX          NO_FIL
         SORT_BOX          ST_STA
         RESBD-MATNR(23)      SAM6506P00055
         RESBD-MENGE(23)          2
         RESBD-EINHEIT(23)     M
         RESBD-POSTP(23)          R
         RESBD-VORNR(23)          0040
         RCOLS-APLFL(23)          23
         RESBD-WERKS(23)          0200
         RESBD-LGORT(23)          0010
         BDC_SUBSCR          SAPLCOKO1                               0800ORD_HEADER
         BDC_SUBSCR          SAPLCOMK                                0050BUTTONS
         BDC_SUBSCR          SAPLCOMD                                0160SUBSCR_0100
         BDC_CURSOR          RESBD-ROMEI
         RESBD-MATNR          SAM6506P00055
         RESBD-ROMS1          1000
         RESBD-ROMEI          MM
         RESBD-ROKME          M
    Is there other way to fill variable-size item ? Have you got ideas to simulate this step ?
    I don't use FM because i have to fill the field RESBD-VORNR.
    Thanks in advance for your response.
    Patrick.

    In fact the choice that i have made was wrong.
    Adding component with CO02 is possible with ls_params-nobinpt = ''.

  • RegionRenderer encodeAll The region component with id: pt1:r1 has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance.

    Hi,
    I am using JDEV 11.1.2.1.0
    I am getting the following error :-
    <RegionRenderer> <encodeAll> The region component with id: pt1:r1 has detected a page fragment with multiple root components. Fragments with more than one root component may not display correctly in a region and may have a negative impact on performance. It is recommended that you restructure the page fragment to have a single root component.
    Piece of code is for region is:-
       <f:facet name="second">
                                                <af:panelStretchLayout id="pa1"
                                                                       binding="#{backingBeanScope.Assign.pa1}">
                                                    <f:facet name="center">
                                                        <af:region value="#{bindings.tfdAssignGraph1.regionModel}" id="r1"
                                                                   binding="#{backingBeanScope.Assign.r1}"/>
                                                    </f:facet>
                                                </af:panelStretchLayout>
                                            </f:facet>
    How do I resolve it ?
    Thanks,

    Hi,
    I see at least 3 errors
    1. <RegionRenderer> <encodeAll> The region component with id: pt1:r1 has detected a page fragment with multiple root components.
    the page fragment should only have a single component under the jsp:root tag. If you see more than one, wrap them in e.g. an af:panelGroupLayout or af:group component
    2. SAPFunction.jspx/.xml" has an invalid character ".".
    check the document (you can open it in JDeveloper if the customization was a seeded one. Seems that editing this file smething has gone bad
    3. The expression "#{bindings..regionModel}" (that was specified for the RegionModel "value" attribute of the region component with id "pePanel") evaluated to null.
    "pageeditorpanel" does seem to be missing in the PageDef file of the page holding the region
    Frank

Maybe you are looking for

  • Multiple devices with one iTunes account

    Want to use my Desk Mac as the repository of ALL iTunes items. Have a MacBook Pro & MacBook Air (to use on the go). Everything is fully backed-up. When I try to clean up my MacBooks and I delete an iTunes movie from them, will it be removed forever f

  • Regarding : Material document data and PO data do not match (Plant)

    Hi Gurus, Please go through this BAPI program. While uploading it is giving an error ' Material document data and PO data do not match (Plant) '. Please help regarding this issue.For all Other moment types it is working fine except this 351 moment ty

  • What type of questions can i expect for master data?

    hi, am preparing for the interview. pls... let me know those questions for master data. thanks to all

  • Call SAP TCODE in a view

    Hi, I want to call a TCODE CS03  and skip first screen in a view based on a linkto action??? I have done this..But a new  window/browser is opened for CS03....But I want to call in view itself..... Is it Possible? Thanks, Ganga

  • How to use Constants in Switch statements?

    Hello all, The following code snippet gives error, please give me guidance. ======== static Object tokenize(StreamTokenizer st) throws NumberFormatException, IOException { Object token = null; try { if (st.nextToken() == st.TT_EOF) { throw new EOFExc