Skip to Content
author's profile photo Former Member
Former Member

Create component usage dynamically

Hi,

I need to embed an unknown number of WD components of a known type in

viewContainerUiElemets .

I want to know if it is possible to create component usages dynamically and then create viewContainerUiElemets

dynamically and embed the usages in the UI elements.

many thanks in advance,

Amir

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Sep 28, 2004 at 03:47 PM

    Hello Amir,

    you have to declare one component usage for each expected type. Then you can call IWDComponentUsage.createComponentUsageOfSameType().

    Regards, Uwe

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi valery,

      Thanks a lot for your help.

      When I try to fill the viewContainer with viewContainerUiElement.setViewContainer( name )

      I get teh following exception:

      Any idea?

      Thanks in advance,

      Amir

      java.lang.NullPointerException

      at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.ViewContainerUIElementAdapter.getContent(ViewContainerUIElementAdapter.java:102)

      at com.sap.ur.renderer.ie6.ViewContainerRenderer.render(ViewContainerRenderer.java:32)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:273)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:99)

      at com.sap.ur.renderer.ie6.FlowLayoutRenderer.renderFlowLayoutItemFragment(FlowLayoutRenderer.java:176)

      at com.sap.ur.renderer.ie6.FlowLayoutRenderer.renderFlowLayoutFragment(FlowLayoutRenderer.java:147)

      at com.sap.ur.renderer.ie6.FlowLayoutRenderer.render(FlowLayoutRenderer.java:32)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:273)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:99)

      at com.sap.ur.renderer.ie6.ScrollContainerRenderer.renderScrollContainerFragment(ScrollContainerRenderer.java:343)

      at com.sap.ur.renderer.ie6.ScrollContainerRenderer.render(ScrollContainerRenderer.java:40)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:273)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:99)

      at com.sap.ur.renderer.ie6.FlowLayoutRenderer.renderFlowLayoutItemFragment(FlowLayoutRenderer.java:176)

      at com.sap.ur.renderer.ie6.FlowLayoutRenderer.renderFlowLayoutFragment(FlowLayoutRenderer.java:147)

      at com.sap.ur.renderer.ie6.FlowLayoutRenderer.render(FlowLayoutRenderer.java:32)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:273)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:99)

      at com.sap.ur.renderer.ie6.ScrollContainerRenderer.renderScrollContainerFragment(ScrollContainerRenderer.java:343)

      at com.sap.ur.renderer.ie6.ScrollContainerRenderer.render(ScrollContainerRenderer.java:40)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:273)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:99)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.UiWindowRenderer.render(UiWindowRenderer.java:45)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:273)

      at com.sap.tc.webdynpro.clientimpl.html.renderer.uielements.base.AbstractRenderManager.render(AbstractRenderManager.java:99)

      at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendHtml(HtmlClient.java:431)

      at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.fillDynamicTemplateContext(HtmlClient.java:377)

      at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.sendResponse(HtmlClient.java:232)

      at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.retrieveData(HtmlClient.java:146)

      at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:388)

      at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:609)

      at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:58)

      at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:197)

      at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:153)

      at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)

      at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:48)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

      at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)

      at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)

      at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:340)

      at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:318)

      at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:821)

      at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:239)

      at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)

      at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)

      at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)

      at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)

      at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

      at java.security.AccessController.doPrivileged(Native Method)

      at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)

      at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)

  • author's profile photo Former Member
    Former Member
    Posted on Sep 09, 2005 at 01:16 PM

    Hi Amir,

    could you finally resolve this topic? I need to do the

    same that you. I don't understand where to put

    Valery's code and how to complete it.

    Basically my problem is: how to get an instance of a "component interface view" to embed in a

    ViewContainerUIElement already created at design time.

    I'll appreciate any response,

    Best regards,

    Diego.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 07, 2005 at 02:03 PM

    Hi Amir,

    I've been able to solve the same problem you have creating an outbound plug at runtime as it's specified in this topic:

    Is it possible to add/change a ViewContainerUIElement during runtime?

    I hope it helps you too!

    Best regards,

    Juan José

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.