Skip to Content
author's profile photo
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 comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • 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 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
    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 comment
    10|10000 characters needed characters exceeded

  • 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 comment
    10|10000 characters needed characters exceeded