JSF 1.1 Custom ViewHandler to add Components dynamically

Hi,
I need to add UIComponents dynamically on each JSF view.
Using JSF 1.2, i can write a custom ViewHandler and override createView, like :
    public UIViewRoot createView(FacesContext facesContext, String viewName) {
        UIViewRoot viewRoot = baseViewHandler.createView(facesContext, viewName);
        UIComponent component = facesContext.getApplication().createComponent( HtmlInputText.COMPONENT_TYPE );
        HtmlInputText hidden = ( HtmlInputText ) component;
        hidden.setId("myID");
        hidden.setValue("myValue");
        viewRoot.getChildren().add( component );
        DebugUtil.printTree( viewRoot, System.out );
        return viewRoot;
    }But with JSF 1.1, and deploying the webapp on OC4J 10.1.3.3.0, my dynamic component (the hidden field) is not rendered..
NB : the dynamically added component is not rendered but it is listed by DebugUtil.printTree( )
The printTree output looks like :
08/11/25 19:47:47 id:null
value= null
  id:eventlist
  value= WWFWhy is the ViewHandler's behavior different between JSF 1.1 and 1.2 ?
How can i achieve dynamic component addition (for all pages) with JSF *1.1* ?
Thank you for your answers.
Edited by: ju_l_ien on Nov 25, 2008 11:58 AM

Hi All,
We don't want to use BOM options.
I have also checked "No. of packages'` at header level but my requirement is at item level.So we are also exploring the option of  APPEND  standard table and add this field.
Kindly let me know  if we can do it without Appending standard table.
Regards,
Field to add to enter number of items which are  shipped to customer 

Similar Messages

  • Adding a custom field in IW32 Components tab

    Hi,
    I had a requirement to add a custom field in the "components" tab of IW32 transaction.
    I tried to find out an exit for this transaction but I haven't found any exit that fullfills this requirement.
    Please provide me some information whether there is an Exit, BAdI or any enhancement spots available to add a custom field.
    Thanks in Advance.

    Hi,
    you can add a custom tab in IW32 tcode via the function group XWOC.

  • Can you add components to an existing OAS installation?

    Hi All,
    I've not installed multiple components on OAS but let's say you have an existing environment with Oracle Portal...Can you add the Oracle Reports and Forms Services to this installation? Is this transparent?
    Thanks.

    Yes you can add components, but personally I wouldn't do this in a production situation. The main reason is that I don't know what will happen to your custom made settings (e.g. httpd.conf etc.).
    I should admit that I have no hands on experience adding forms and reports afterwards (portal I did and this did work, after some reconfiguring of apache).

  • "Add components to your existing installation" disabled in SQL Server 2000 clustered installation.

    When I try to add the
    fulltext service to a named instance in
    SQLServer 2000, I see the option "Add components to your existing installation"
    in gray.
    I launched
    the installer both ways, with the services stoped and started,
    and always the same result.

    Please check the below link and try..
    http://technet.microsoft.com/en-us/library/aa197936%28v=sql.80%29.aspx
    http://www.databasejournal.com/features/mssql/article.php/3441981/Full-Text-Search-on-SQL-2000-Part-1.htm
    Raju Rasagounder Sr MSSQL DBA

  • BUG? - Unable to configure custom viewhandler

    Hi.
    I'm experiencing difficulties with my attempt to configure a custom viewhandler, i.e. by sub-classing the ViewHandlerImp class.
    My plan was to use the viewhandler to switch render kit IDs, based on the URL mapping.
    It is possible to do this when using MyFaces but it seems that with ADF Faces there is no ViewHandler that can be subclassed, i.e. ADF faces has it's own ViewHandler implementation.
    I attempted to subclass the org.apache.myfaces.application.jsp.JspViewHandlerImpl class, overriding the CalculateRenderKitId() method to return "oracle.adf.core" as the kit id.
    This is all that is needed with MyFaces, i.e. returning "HTML_BASIC" when loading a MyFaces jsp page, with the correct mappings, works OK.
    There then should be no need to specify the default kit id, i.e. via:
    <default-render-kit-id>
    oracle.adf.core
    </default-render-kit-id>
    in the faces-config.xml file, i.e. you can then switch render kits at will in order to plug in rendering for different output formats based on the file extension mapping *.jspx, *.jspw, to switch, for example between HTML, WML, SVG output formats.
    I also tried to subclass the oracle.adfinternal.view.faces.application.ViewHandlerImpl class but this doesn't seem possible since it doesn't have a parameterless base constructor and there is no documentation.
    Is there any way of doing this or is there a fix for this in the pipeline?
    I am using Apache MyFaces with EA19.
    Thnks..

    I got different setting advise from verizon store, verizon online and from charter.  all said something different.  I eventually got it to work using the regular pop.charter.net for incoming and smtp.charterinternet.com for outgoing.  No secure connection...  no verification certificate...  and the port is 25.  I have a droidX also.

  • How to avoid extra div tags, when we add components using cq:include

    I tried using the below code in my component jsp from forums to remove those extra div tags when we try to add components using <cq:include tags.
    <%
       if (WCMMode.fromRequest(request) != WCMMode.EDIT && WCMMode.fromRequest(request) != WCMMode.DESIGN) {
           IncludeOptions.getOptions(request, true).forceSameContext(Boolean.TRUE);
    %>
    But this code helped to remove most of the extra div tags , but still adds this extra div tag to the first component I add using  <cq:include tag.
    its a basic and very critical necessity to maintain our markup design,But due to this  dynamically added extra div tag will hinder the html and css behaviour of the page.
    Appreciate your help to resolve this issue.
    Thanks

    Hi,
    Can you try below if you really dont want to include anything during include.
    <%
    IncludeOptions opts=null;
       if (WCMMode.fromRequest(request) != WCMMode.EDIT && WCMMode.fromRequest(request) != WCMMode.DESIGN) {
    opts= IncludeOptions.getOptions(request, true);     
    opts.forceSameContext(Boolean.TRUE);
    opts.setDecorationTagName("");
    %>
    Thanks,
    Pawan

  • BAPI_REQUISITION_CREATE-way to add components

    I am trying to create a purchase requsition by BAPI_REQUISITION_CREATE
    but need to find a way to add components to the new purchase requisition.

    Hi,
    I've seen this code in some sites. See it might help you.
    LOOP AT it_requisiton_items INTO wa_requisiton_items.
    READ TABLE it_vbap
    INTO wa_vbap
    WITH KEY posnr = wa_requisiton_items-bnfpo.
    v_matnr = wa_vbap-matnr18.
    v_bamei = wa_requisiton_items-meins.
    Build table for call to BAPI
    wa_requisition_items_bapi-doc_type = eban_s-bsart.
    wa_requisition_items_bapi-purch_org = v_ekorg.
    wa_requisition_items_bapi-deliv_date = wa_requisiton_items-lfdat.
    wa_requisition_items_bapi-preq_item = wa_requisiton_items-bnfpo.
    wa_requisition_items_bapi-quantity = wa_requisiton_items-menge.
    wa_requisition_items_bapi-unit = wa_requisiton_items-meins.
    wa_requisition_items_bapi-material = v_matnr.
    wa_requisition_items_bapi-item_cat = wa_requisiton_items-pstyp.
    wa_requisition_items_bapi-acctasscat = wa_requisiton_items-knttp.
    wa_requisition_items_bapi-des_vendor = wa_requisiton_items-lifnr.
    wa_requisition_items_bapi-fixed_vend = wa_requisiton_items-flief.
    wa_requisition_items_bapi-plant = wa_requisiton_items-werks.
    wa_requisition_items_bapi-store_loc = wa_requisiton_items-lgort.
    wa_requisition_items_bapi-c_amt_bapi = wa_requisiton_items-preis.
    wa_requisition_items_bapi-price_unit = wa_requisiton_items-peinh.
    wa_requisition_items_bapi-purch_org = wa_requisiton_items-ekgrp.
    wa_requisition_items_bapi-mat_grp = wa_requisiton_items-matkl.
    IF wa_requisition_items_bapi-deliv_date IS INITIAL.
    wa_requisition_items_bapi-deliv_date = wa_vbap-erdat.
    ENDIF. "wa_requisition_items_bapi-deliv_date
    APPEND wa_requisition_items_bapi TO it_requisition_items_bapi.
    CLEAR wa_requisition_items_bapi.
    ENDLOOP. "it_requisiton_items into wa_requisiton_items
    CALL FUNCTION 'BAPI_REQUISITION_CREATE'
    EXPORTING
    SKIP_ITEMS_WITH_ERROR =
    IMPORTING
    number = preq_no
    TABLES
    requisition_items = it_requisition_items_bapi
    requisition_account_assignment = it_requisition_assignment
    REQUISITION_ITEM_TEXT =
    REQUISITION_LIMITS =
    REQUISITION_CONTRACT_LIMITS =
    REQUISITION_SERVICES =
    REQUISITION_SRV_ACCASS_VALUES =
    return = it_return
    REQUISITION_SERVICES_TEXT =
    REQUISITION_ADDRDELIVERY =
    EXTENSIONIN =
    COMMIT WORK.

  • How can we add components to JPanel so that they can be resizeable

    Is it possible to add components to JPanel so that we can resize them or drag them.

    You could try searching the forums, but I'll save you the trouble. tjacobs has oft posted code which does what you want, both dragging and resizing.
    You can find an example here or here.

  • How to add components to a subcontract PR using BAPI_PR_CREATE

    I am trying to use BAPI_PR_CREATE in SAP ECC 6.0 to create a Purchase Requisition with Item Category "L" (subcontracting) to be subcontracted to a vendor for repair.  Normally, in ME51N, we would add components to the PR before creating it, but I can't see any way to do that with this BAPI, and the documentation doesn't say.
    The result is an error with the following messages:
    T ID                   NUM MESSAGE
    E BAPI                 001 No instance of object type PurchaseRequisition has been created. External reference: # 1
    E ME                   154 Not possible to determine any components
    E ME                   642 Subcontracting only possible with vendor
    The error 154 (Not possible to determine any components) is the same message that would appear in ME51N if the components were not added for the repair.
    The error 642 (Subcontracting only possible with vendor) is confusing because a valid vendor number is being supplied to the FIXED_VEND field in PRITEM and the equivalent field in PRITEMX is marked with X.
    Any help would be greatly appreciated.

    Very late reply - but hoping it might help somebody in the future:
    SAP Note 1489799 - ME 154: Creating subcontracting purchase requisition w/o BOM

  • MIGO : add components for consumption (mvt.543) during goods receipt po

    Dear guru.
    Can I add components for consumption with movement 543 during the goods receipt of a purchase order (mvt.101) ?
    Thanks.

    Pl add child components in bill of material of parent item,then explode bom in purchase order.

  • Custom ViewHandler

    is this enough and right way to create custom ViewHandler -
    public class CustomLocaleViewHandler extends ViewHandlerWrapper {
    protected ViewHandler getWrapped() {
    return new CustomLocaleViewHandler();
    i don't get any compilation error.
    however it gives stack over flow error at run time -
    java.lang.StackOverflowError
         at javax.faces.application.ViewHandler.(ViewHandler.java:70)
         at javax.faces.application.ViewHandlerWrapper.(ViewHandlerWrapper.java:62)
         at com.lr.bos.lifecycle.CustomLocaleViewHandler.(CustomLocaleViewHandler.java:17)
         at com.lr.bos.lifecycle.CustomLocaleViewHandler.getWrapped(CustomLocaleViewHandler.java:20)
         at javax.faces.application.ViewHandlerWrapper.calculateRenderKitId(ViewHandlerWrapper.java:117)
         at javax.faces.application.ViewHandlerWrapper.calculateRenderKitId(ViewHandlerWrapper.java:117)
         at javax.faces.application.ViewHandlerWrapper.calculateRenderKitId(ViewHandlerWrapper.java:117)
    what other methods i should override?
    thanks.

    To extend WebCenter Portal View Handler you have to:
    1) Create a class extending oracle.webcenter.portalframework.sitestructure.handler.CustomViewHandler
    public class ApplicationViewHandler extends CustomViewHandler {
         * Constructor
         * @param viewHandler
        public ApplicationViewHandler(ViewHandler viewHandler) {
            super(viewHandler);
    }2) Register it in faces-config as follow:
    <application>
        <default-render-kit-id>oracle.adf.rich</default-render-kit-id>
        <view-handler>com.merchan.portal.util.ApplicationViewHandler</view-handler>
    </application>3) You can override all the methods that you want: Sample:
        * Extend to address issue with bug 11076967 involving login
        @Override
        public String getActionURL(FacesContext fctx, String viewId) {
            String urlStr = viewId;
            if (Beans.isDesignTime()) {
                return this.m_baseHandler.getActionURL(fctx, urlStr);
            // Only perform the pretty url lookup if the request was from our
            // navigation processAction
            if (isRequestDrivenByNavigation(fctx)) {
                SiteStructure model =
                    SiteStructureContext.getInstance().getCurrentModel();
                if (model != null) {
                    SiteStructureResource resource = model.getCurrentSelection();
                    if (resource != null) {
                        String resourceViewId = findTargetViewId(fctx, resource);
                        if (resourceViewId != null &&
                            resourceViewId.equals(viewId))
                            urlStr = "/" + SiteStructureUtils.encodeUrl(resource.getPrettyUrl());
            String ret = this.m_baseHandler.getActionURL(fctx, urlStr);
            return ret;
        }Regards.

  • Customer service warranty for components in an equipment

    Hi Friends
    Pl guide me how to configure the warranty for an equipment where only few components only will be replaced free of charge to the customer during warranty few components are charged during warranty, how to bill for the components that will be charged during warranty.
    Thanx and regards
    syed.

    I, too, had to followup via telephone with Tech. support in the Philippines.
    They dropped the ball, but quickly regrouped and the process is back on track to attain a fix.
    Apparentely, there is a "Service Depot" in San Jose, TX (SAT).
    I did not experience "hold times, " so only can advise to telephone back, take names and notes.
    Ask to speak with a supervisor, if at all possible, try and remain somewhat calm.  

  • How can I create UI components dynamically based on the result of WebService/HttpService call?

    I would like to create child components of the component
    based on a XML which is retrieved by WebService/HttpService call.
    createChildren() is the one to be used to create components
    dynamically. But if I use createChildren() and call a
    WS/HttpService request in createChildren method, I can not get the
    result of WS/HttpService request in createChildren().
    It seems that the result event is processed later after
    createChildren() is completed.
    How can I implement my requirement?
    I would appreciate any pointer or suggestion.
    Best regards
    Masa

    1) Use a List, with a custom itemRenderer
    2) Use a Repeater (Probably easiest)
    3) use Actionscript to addChild() components.
    Tracy

  • Add Subform dynamically,on click of Button, in Interactive form generated by Adobe Document Services

    HI,
    I have an XDP file designed by Adobe Designer 7.1 with the following hierarchy of elements:
    -form1(root)
    --Button
    --tmpForm (subform - Repeat subform for each data entry )
    ---ST (Text)
    Now, this XDP file generates an Interactive PDF form with Reader Rights enabled by the Adobe Document Services.
    On click of button, the following javascript is executed on client side:
    var df = _tmpForm.addInstance(1);
    df.ST.rawValue = "HI" ;
    xfa.host.messageBox( "Instances" + tmpForm.all.length ) ;
    On clicking the button, i get the length of the instances of the subform and the size increases on each click, but no element is added "visibly" to the pdf.
    But when i try to do the same by saving the XDP file as Dynamic PDF form for Acrobat 8.0,and open it using Adobe Acrobat PRO 8.0, it works fine.
    My question is,I s it not possible to add subforms dynamically in PDF's generated by Adobe Document Services with Reader Rights enabled?
    Or, is there something that i am missing?
    Please guide.
    Thanks.
    Regards,
    Siddhartha

    Hi,
    you can't change the behavior of the save button in the browser nor in Reader/Acrobat.
    You can add a custom button within your form which calls a custom script from a folder level script using the browserForDoc method.
    The browseForDoc methos is the only one whcih can change the name in the saveAs dialog.
    Here's an example., you can run from Acrobat console.
    You need to combine it with the solution from the other thread to make it work with your form.
    http://forums.adobe.com/message/2266799#2266799%232266799
    var oRetn = app.browseForDoc({
        bSave: true,
        cFilenameInit: "MyForm.pdf",
        cFSInit: "",
    if (typeof oRetn !== "undefined") {
        this.saveAs({
            cFS: oRetn.cFS,
            cPath: oRetn.cPath,
            bPromptToOverwrite: false

  • Add Subform dynamically,in Interactive form in WebDynpro

    HI,
    I an using NW2004s SP9  and have an Interactive form designed by Adobe Designer 7.1 from within the NetWeaver Developer Studio, with the following hierarchy of elements:
    -form1(root)
    --Button
    --tmpForm (subform - Repeat subform for each data entry )
    ---ST (Text)
    The Webdynpro application displays the Interactive PDF form with Reader Rights enabled by the Adobe Document Services.
    On click of button, the following javascript is executed on client side:
    var df = _tmpForm.addInstance(1);
    df.ST.rawValue = "HI"  ;
    xfa.host.messageBox( "Instances" +  tmpForm.all.length ) ;
    On clicking the button, i get the number of the instances of the subform and the size increases on each click, but no element is added "visibly" to the pdf.
    But when i try to do the same by saving the XDP file as Dynamic PDF form for Acrobat 8.0, and open it using Adobe Acrobat PRO 8.0, it works fine.
    My question is,I s it not possible to add subforms dynamically in PDF's generated by Adobe Document Services with Reader Rights enabled?
    Or, is there something that i am missing?
    Please guide.
    Thanks.
    Regards,
    Siddhartha

    HI Dezpo,
    Thanks a lot for replying.
    I had checked the updated <b>SAP Note 834573</b> -Interactive Forms based on Adobe software: Acrobat/Reader version, which states that:
    For SAP Interactive Forms by Adobe, you require the following:
    Adobe Acrobat as of Version 7.0.9
    Adobe Reader as of Version 7.0.9
    <b>Important:</b>
    Note that you can only have limited use of Reader 8.0 for forms that, at runtime, are integrated in a WebDynpro application through the xACF technology (Active Components Framework). In this runtime environment, Reader 8.0 currently only supports static interactive forms. If you are using <b>dynamic interactive PDF forms</b>, we recommend that you use <b>Reader 7.0.9.</b> In the application, you can use parameters, or you can call methods, to determine whether you want to create a static or dynamic PDF form.
    I tried with the reader versions - 7.0.7,  7.0.9 and 8.01, but it doesn't work for either of them.
    Regards,
    Siddhartha Jain

Maybe you are looking for

  • Iphone movie rental

    how long do you have the movie rented for? can you view the movie more than one ? when you download the movie to the iphone can you watch the movie a few times or is it a one shot deal?

  • Mail.app crashes when trying to sync with .mac

    Mail.app crashes when I try to sync my mail accounts with .mac. It currently works fine on my older PowerPC PowerBook G4, but on my new MacBook Pro it crashes every time. Any others experience this? Thanks in advance for any help. Here's the report:

  • Nokia 6021 - Switching on and off

    I have just received a brand new Nokia 6021 to replace a 6310i which was developing a fault with the on/off switch after 4 years. Well, the 6021 is just about impossible to switch on and off. My thumb is now strained after so many attempts. The only

  • ITunes 11: Pop-up windows for quick access on iTunes Store?

    Anybody know what happend or how to get back pop-up windows for quick access on iTunes 11? Please see link below for I mean: itunes-store-adds-pop-up-windows-for-quick-access-to-content-details-and-preview s Thanks.

  • Confirmation alert on application close

    I am wondering how you can create an alert to display when the application window is closed by clicking the 'X' button on the main app window (i.e. not a form window). Is this possible in Oracle forms? We currently have an alert set to display when t