Realising dynamic "popup" Elements

Hi!
Is it possible to develop something like shown here:
http://www.sap.com/germany/services/education/schulungskatalog/service-oriented-architecture/curriculum.epx?context=[[CA_SOA]]|
but with a dynamic view?
What i mean is: First there should only a root element be visible. This should be clickable, expanding into other elements linked with an arrow.
I thought about it, but i do not see an opprtunity to realize it, i'm missing the right elements.
i'm pretty new to webdynpro for abap.
any help would be great.
ciao
Edited by: interbreeding on Mar 24, 2011 8:56 AM

Hi There,
Try by using Contextual Panel or Menu - Link to URL's according to your requirement.
Please go through this..
In this check MENU link also
http://help.sap.com/saphelp_nw70/helpdata/EN/28/fe5a42091de32ce10000000a1550b0/frameset.htm
and alo this..
http://wiki.sdn.sap.com/wiki/display/WDABAP/UsageofViewSwitchinContextualPanel+UIelement
Cheers,
Kris.

Similar Messages

  • Error when trying to create a Dynamic UI Element(DropDownByKey)

    Dear All,
    I am trying to create a Dynamic UI element(dropdownbykey) .
    I used the following code which i wrote in domodify:
    if (firstTime)
    IWDTransparentContainer thetransparent =(IWDTransparentContainer)view.getElement("AttributeDynamic_TransparentContainer");
    IWDNodeInfo node = wdContext.getNodeInfo().addChild(
      "DynamicNode",null,true,true,false,true,false,true,null,null,null);
                              IWDAttributeInfo attr1=node.addAttribute("attrib00","ddic:com.sap.dictionary.string");
    IWDAbstractDropDownByKey Sizedropdown=(IWDAbstractDropDownByKey)view.createElement(IWDAbstractDropDownByKey.class,null);
    Sizedropdown.bindSelectedKey(attr1);
    thetransparent.addChild(Sizedropdown);
    When i deployed it i got the following error:
    com.sap.tc.webdynpro.services.exceptions.CreationFailedException: Cannot create view element implementation com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractDropDownByKey
    Can anyone please help me in this regard.
    Thanks and Regards
    Nishita Salver

    Dear All,
    Thanks for ur quick reply below is the entire error chain:
    com.sap.tc.webdynpro.services.exceptions.CreationFailedException: Cannot create view element implementation com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDAbstractDropDownByIndex
         at com.sap.tc.webdynpro.progmodel.view.ViewElementFactory.createElement(ViewElementFactory.java:161)
         at com.sap.tc.webdynpro.progmodel.view.View.createElement(View.java:177)
         at com.sap.satyam.dynamic_attrapp.Dynamic_attrAppView.wdDoModifyView(Dynamic_attrAppView.java:184)
         at com.sap.satyam.dynamic_attrapp.wdp.InternalDynamic_attrAppView.wdDoModifyView(InternalDynamic_attrAppView.java:364)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doModifyView(DelegatingView.java:78)
         at com.sap.tc.webdynpro.progmodel.view.View.modifyView(View.java:337)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doModifyView(ClientComponent.java:481)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doModifyView(WindowPhaseModel.java:551)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:148)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         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:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(AccessController.java:207)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    Caused by: java.lang.NoSuchMethodException
         at java.lang.Class.getConstructorImpl(Native Method)
         at java.lang.Class.getConstructor(Class.java:554)
         at com.sap.tc.webdynpro.progmodel.view.ViewElementFactory.createElement(ViewElementFactory.java:150)
         at com.sap.tc.webdynpro.progmodel.view.View.createElement(View.java:177)
         at com.sap.satyam.dynamic_attrapp.Dynamic_attrAppView.wdDoModifyView(Dynamic_attrAppView.java:184)
    Thanks and Regards,
    Nishita

  • Dynamic layout elements determination logic for output of Pro-Forma Invoice

    This is my requirement below. Please give the suggestion    
    Business requires output to be generated in name of the client, with client logo and scenario specific data elements. To do this in Standard SAP will require to define hundreds and hundreds of layouts. By making most of the client/scenario elements on the layout we can greatly reduce the number of required layouts and reduce implementatuion effort and lead-time.
         The goal is to define a generic table that will hold most of the dynamic layout elements for different document types and countries, including logo, sender address etc.
          For this we will create Z-versions of the output types BA00 ( Order Confirmation, ZPRI (Pro-Forma Invoice) and RD00 (ZD00 Invoice).The layout text blocks will be permanently fixed.The print Program user-exit should call the Z-table that holds the dynamic layout elements and retrieve these elements and merge them with the matching layout text block.
    Message was edited by: janardhan b

    Hi Janardhan,
       Even I have faced the similar situation.but what we have done is instead of calling the dynamic text elements..Why don't we call the text elements based on the required condition ,Then u dont have to maintain all the text elements required in the table.In the table we can only have the doumnent type,client name,logo name and address.
    In the print program if u r using script layout then call the required text elements (write_text) based on the client name and document type that is fetched from the Z-table,Otherwise if u r going for smartforms then with in the layout give the condition under the conditions node of the window or the text.

  • How to create the Dynamic UI element table in web dynpro in abap

    Hi All,
    Does anybody have reference note or teach me how to create dynamic UI element table in web dynpro in abap ?
    Regards,
    Luke

    HI LukeWong ,
    for creating any UI dynamically you shoul use their runtime class that always start with cl_wd_* ui element name*
    so for the Table UI element the runtime class is CL_WD_TABLE
    now reffer the below code for creating the Table UI dynamically
    METHOD wddomodifyview.
    DATA lr_table TYPE REF TO cl_wd_table.
    DATA lr_flow_data TYPE REF TO cl_wd_flow_data.
    DATA lr_container TYPE REF TO cl_wd_uielement_container.
    DATA lr_column_name TYPE REF TO cl_wd_table_column.
    DATA lr_text_view TYPE REF TO cl_wd_text_view.
    DATA lr_table_header TYPE REF TO cl_wd_caption.
    DATA lr_column_name_header TYPE REF TO cl_wd_caption.
    IF first_time EQ abap_true.
    lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    lr_table = cl_wd_table=>new_table(
    id = 'TBL_TABLE'
    bind_data_source = 'TABLE'
    design = cl_wd_table=>e_design-alternating
    visible_row_count = 3
    lr_flow_data = cl_wd_flow_data=>new_flow_data( element =
    lr_table ).
    lr_container->add_child( lr_table ).
    lr_column_name = cl_wd_table_column=>new_table_column(
    id = 'TBL_EXAMPLE_NAME'
    lr_table_header ?= cl_wd_caption=>new_caption( text = 'Table UI elem
    ent - example').
    lr_table->add_column( the_column = lr_column_name ).
    lr_table->set_header( lr_table_header ).
    lr_text_view = cl_wd_text_view=>new_text_view(
    id = 'TXV_NAME'
    bind_text = 'TABLE.NAME'
    lr_column_name_header ?= cl_wd_caption=>new_caption( text = 'Name').
    lr_column_name->set_table_cell_editor( the_table_cell_editor = lr_text_view).
    lr_column_name->set_header( lr_column_name_header ).
    ENDIF.
    ENDMETHOD.
    Regards
    Chinnaiya P
    Edited by: chinnaiya pandiyan on Sep 17, 2010 12:01 PM

  • How to create dynamic list element in Site Studio designer?

    Hi all,
    I have installed the Site Studio Designer(10gR4).The dynamic list element that i have added in the contributor region executes a query to search and display all the files in a particular folder.In the contributor mode when i try to add/edit the dynamic list element it gives an error saying :
    Unable to perform the action due to the following reasons:
    [+] Unable to retrieve search results. Unable to retrieve search results. Unable to create result set for query 'SELECT IdcColl2.dID, dDocName, dDocTitle, dDocType, dRevisionID, dSecurityGroup, dDocAuthor, dDocAccount, dRevLabel, dFormat, dOriginalName, dExtension, dWebExtension, dInDate, dOutDate, dCreateDate, dPublishType, dRendition1, dRendition2, VaultFileSize, WebFileSize, URL, dFullTextFormat, dFullTextCharset, DocMeta.* FROM IdcColl2, DocMeta WHERE IdcColl2.dID=DocMeta.dID AND (((((( xCollectionID >= 14 AND xCollectionID <= 14 ) AND NOT ( (CONTAINS(xDontShowInListsForWebsites, '{DIPP_Sample}') > 0) )))))) ORDER BY dDocTitle desc'. ORA-20000: Oracle Text error: DRG-10599: column is not indexed
    I have enabled the full-text search on the content server and also included xWebsites and xWebsiteObjectType columns to be full indexed in the Zone Fields Configuration.Is there any other setting to be done?Please help.
    Thanks,
    nithya

    Hi
    Include the xDontShowInListsForWebsites also from the zone filed and then update it.Then test it out.
    Hope it helps
    Srinath

  • Performance will go down in case of Dynamic UI element Creation.

    Performance will go down in case of Dynamic UI element Creation

    suryar wrote:
    Performance will go down in case of Dynamic UI element Creation
    hi,
    is this an information or a question?
    Please be more specific so that your queries can be answered quickly
    Regards,
    Sahai.S

  • Creating Dynamic UI Elements in Web Dynpro ABAP

    Hi,
    I want to an application in which the context nodes and the UI Elements for the second screen get created dynamically at run time based on the input on the first screen
    First i have used this method :
    cl_wd_dynamic_tool=>create_nodeinfo_from_struct()
    to  create the dynamic context nodes.
    I have checked in debugger and the dynamic context node is getting creates successfully.
    I have saved the reference for the context node in DYN_NODE.
    Now for creating the dynamic UI Elements corresponding to the attributes of this context node, i call the method :
    cl_wd_dynamic_tool=>create_form_from_node(
    ui_parent = group_1
    node = dyn_node
    inputlength = 20 ).
    But this thing is dumping.
    This is the dump.
    The following error text was processed in the system CG7 : Adapter error in &VIEW_ELEMENT_TYPE& "BP_ICLIENT" of view "ZWD_ONLINE_FORMS.FINAL_VIEW": Context binding of property VALUE cannot be resolved: Node FINAL_VIEW.1.BP does not contain any elements
    Where BP_ICLIENT is the first attribute of the dynmaic context node BP  created..
    Please Help.
    Thanks
    Shivi

    Refer this wiki :
    https://wiki.sdn.sap.com/wiki/display/WDABAP/CreatingUIElementsDynamicallyinAbapWebdynpro+Application
    More links are available on SDN reg Dynammci UI creations :
    Have a look at the documentation for the WDDOMODIFYVIEW section of the phase model:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d2/8acd409cc4dd50e10000000a1550b0/frameset.htm
    There is also the class CL_WD_DYNAMIC_TOOL:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/67/6935425394033be10000000a1550b0/frameset.htm
    Also have a look at the example application DEMODYNAMIC.
    eLearning on the topic here as well:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/201ddd3b-b4ce-2b10-8883-880ae8147f89
    Edited by: Saurav Mago on Oct 26, 2009 12:23 PM

  • Dynamic popup does return value from popup window

    have to create a page , with dynamic Popup using query. I am using APEX_ITEM.POPUP_FROM_QUERY(). Dynamic popup is generated, i can able to open the popup, when i click the link of the generated records. It does not return the value.
    I feel that , it's like your error.
    could you please help me ou.t

    I also have similar kind of problem.
    1. How can I open new window to a particluar URL on a button click event? I know in line, we have target attribute.
    2. How can I pass the child window values to the parent
    3. How can I refresh the parent window or parent page to to show the changed values in the child window and ofcourse close the child.
    Any help on this will be appreciated.
    Thanks
    Rsaj

  • Using a Site Studio 10R4 Dynamic List Element Definition

    Hi All,
    I've created and can use a Static List Element Definition > Region Definition > Region Template with no problems based off of the 10gR4 samples.
    However, there is no example that I've found to utilise the Element Definition of a Dynamic List. I'm attempting to use the same sample code as provided for a Static List but having no luck displaying the results of the query...
    Does anyone have some sample code used in a Region Template or Sub Template to show how we use a Dynamic List Element Definition please?
    I noted from another thread in this forum that there are some iDoc calls to make which load the query defined in the Element Definition... I can't find any documentation regarding this either.
    Thanks
    Edited by: user615721 on May 4, 2009 10:08 AM
    Edited by: user615721 on May 4, 2009 10:09 AM

    Found my answer in another thread, here... Re: Using a Site Studio 10R4 Dynamic List Element Definition
    'For 10gR4 Site Studio you can get examples and even a video talking about making dyanmic lists from here:
    http://www.oracle.com/technology/products/content-management/ucm/SiteStudio10gR4Tutorials/index.html'
    Edited by: user615721 on May 4, 2009 10:25 AM
    Edited by: user615721 on May 4, 2009 10:25 AM

  • Dynamic UI Element multiple times

    Dear all.
    I am able to create one dynamic UI element, and bind to a node.
    Now the point is my node is of cardinaly 0..n.
    Based on some logic, there can be various (or 0) text edit UI element dynamically.
    How can I write this code? Any help is greatly appreciated.
    Thanks in adv!

    Hi,
    Check this code
    data: LR_CONTAINER type ref to CL_WD_UIELEMENT_CONTAINER,
    LR_BUTTON type ref to CL_WD_BUTTON,
    LR_FLOW_DATA type ref to CL_WD_FLOW_DATA.
    do 10 TIMES.
    LR_BUTTON = CL_WD_BUTTON=>NEW_BUTTON( ).
    LR_FLOW_DATA = CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_BUTTON ).
    LR_CONTAINER ?= view->GET_ELEMENT( 'ROOTUIELEMENTCONTAINER' ).
    LR_CONTAINER->ADD_CHILD( LR_BUTTON ).
    enddo.
    it is for inserting 10 buttons on the same basis you can insert number of text views......
    regards
    Pranav

  • Can't create dynamic html elements with jsp????? important

    Hi All,
    I am having problem creating dynamic html elements with jsp tags, i have tried to use EL and java scriplet, both of them don't work.
    i am trying to create dynamic menu in my "rightMenu.jspf", based on, if user has logged in or not.
    some like this!
    <jsp:if test ="${validUser == null}">
    some simple text menu here
    </jsp:if>
    but it is not working. it simply loading all and images with in statement, regardless of whether user has logged in or not. i think some how if statement is not working properly.
    "validUser" is a session bean, which is not creating at this point, it will created when user will log in successfully. and also this session bean does not exist at the page, where i am trying to check that .
    Is there any way to create dynamic values in jsp. It is really important, is there any body who help me in this matter. i would be really grateful.
    zaman

    hi jaspre,
    thanks for replying me. you know what, is it not something wrong with web.xml file. i remember once, i deleted some from there, a property with "*.jsp". i can't remember what exactly was it though.
    all if statements works on files ending with extension ".jsp" but don't work only on with extension ".jspf". there must be to do with this.
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <servlet>
    <servlet-name>ValidateServlet</servlet-name>
    <servlet-class>ValidateServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ValidateServlet</servlet-name>
    <url-pattern>/ValidateServlet</url-pattern>
    </servlet-mapping>
    <servlet>
    <servlet-name>dwr-invoker</servlet-name>
    <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
    <init-param>
    <param-name>debug</param-name>
    <param-value>true</param-value>
    </init-param>
    <init-param>
    <param-name>pollAndCometEnabled</param-name>
    <param-value>true</param-value>
    </init-param>
    </servlet>
    <servlet-mapping>
    <servlet-name>dwr-invoker</servlet-name>
    <url-pattern>/dwr/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
         <welcome-file>
    main.jsp
    </welcome-file>
    </welcome-file-list>
    </web-app>
    if any one can figure it out. i would be grateful.
    zaman

  • Dynamic Dictionary Elements

    Hello All,
         Can Anyone help me to create Dynamic Dictionary Element. Runtime, I want to create a Simple Type data element in Dictionary, which can be binded to a RadioGroup ui element. So that Enumeration data can be added Runtime for that dictionary element.
         Is there any Java Docs for WebDynpro SAP packages.
       Help !!!

    Please check the tutorial
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/value help in web dynpro applications.pdf
    Regards, Anilkumar

  • Dimension Filter - Dynamic popup size?

    Hi,
    I have a small problem.
    One of my dimension filters have a hierarchy dimension assigned. Depending on the expansion of the preferred hierarchy selection, the user cannot see the whole text.
    I know that I can change the size of the Dimension Filter with the settings Popup Width and Popup Height, but is it somehow possible to change the size dynamically depending on the expansion of the hierarchy?
    Br
    Max Rosén

    Hi Max,
    As far as I know there is really no such setting in Design Studio that would enable that.
    There is also no way how to achieve this with the available scripting methods, if there would be something it would be in theory something like this:
    In the OnChange Event of the table cell width where the hierarchy is or based upon the expand level state of the hierarchy in the filterpanel, adjust the width of the filterpanel and the width of the table cell where the hierarchy is.
    There should be a solution to do this via javascript, but for that you would need to use the sdk to include some custom javascript code into your bi app.
    Normally your requirement can be achieved with/through css, there is a method/way that causes the width of the parent container to expand/adjust automatically when the width of the child element changes. But the problem/difficulty here is, that the filterpanel is created with a lot of absolutely positioned divs (containers) here and there and thus several stacking contexts are created and thus a change in one stacking context has no effect on an element which is in a different stacking context - a change in the width of the table cells where the hierarchy is placed has no effect on some other higher/previously positioned parent container elements because they are in different stacking contexts and when a container's width isn't adjusted too, the inner child element has no way to expand and still be/remain visually nice as a whole.
    Anyway, so far I didn't help you much, so here is something you could use to make the text visible/readable without expanding the width:
    /* Make Long Text (in Hierarchy) in Dimension Filter Visible (Break Into a New Line) */
    #sap-ui-static .sapzenfilterpanel-PopupContainerDialog div.sapUiTableCnt div.sapUiTableCCnt table.sapUiTableCtrl tr.sapUiTableTr > td:nth-child(1),
    #sap-ui-static .sapzenfilterpanel-PopupContainerDialog div.sapUiTableCnt div.sapUiTableCCnt table.sapUiTableCtrl tr.sapUiTableTr > td:nth-child(1) span.sapzenfilterpanel-SelectionTableText {
      white-space: normal;
      /* Optional setting: break to newline anywhere in a word */
      /*word-wrap: break-word;*/
    (Note: you can simplify/adjust the selectors, this is not the only way how the selectors must look like, it is just an example, but working example...)
    A side note when using the setting: "Member Display: Text and Key"
    The Dimension filter has 3 columns: 1. Text , 2. Key , 3. Check(boxes)
    where the first 2 columns for text and key are the same width. But usually the key is shorter than the text and doesn't need so much space, so you could adjust the width proportions of these first 2 columns so that the text has more width than the column containing the keys:
    /* Make Text Column Wider and Key Column Narrower */
    div.sapUiTableCnt div.sapUiTableColHdrCnt div.sapUiTableColHdr > div:nth-child(1) {width: 207px !important; /* Default Popup width: 350px > 147px , 147+60=207 */}
    div.sapUiTableCnt div.sapUiTableColHdrCnt div.sapUiTableColHdr > div:nth-child(2) {width: 87px !important; /* Default Popup width: 350px > 147px , 147-60=87 */}
    div.sapUiTableCnt div.sapUiTableCCnt table.sapUiTableCtrl tr.sapUiTableCtrlCol > th:nth-child(1) {width: 207px !important; /* Default Popup width: 350px > 147px , 147+60=207 */}
    div.sapUiTableCnt div.sapUiTableCCnt table.sapUiTableCtrl tr.sapUiTableCtrlCol > th:nth-child(2) {width: 87px !important; /* Default Popup width: 350px > 147px , 147-60=87 */}
    Regards
    David

  • How to read values of dynamic UI elements in a backing bean?

    Hi, I have an ADF page where some of the UI elements (in this case, checkboxes) are dynamically rendered as such:
    <af:forEach var="row" items="#{backing_testPage.userList}">
    <af:selectBooleanCheckbox id="checkbox" value="#{row.id}"
    text="#{row.name}" selected="#{row.userSelected}"/>
    </af:forEach>
    I am wondering how can I read the values of these checkboxes in my page's backing bean. It does not seem possible to specify a distinct binding value for the selectBooleanCheckbox elements in order to tie them to a CoreSelectBooleanCheckbox variable in my backing bean (so that I could check whether the checkbox is selected or not).
    When the page gets rendered, I did see that the checkboxes get assigned distinct ids like checkbox_1, checkbox_2, checkbox_3, etc... Not sure if that would help with this.
    Would appreciate any tips on this as I've been struggling with this for awhile. Thanks!

    You probably would do better with a SelectManyCheckbox. Here's how:
    In your backing bean you need:
    private String[] usernames;
    public String[] getUsernames () {
      return usernames;
    public void setUsernames (String[] _usernames) {
      usernames = _usernames;
    }In your page:
    <af:selectManyCheckbox value="#{backing_testPage.usernames}">
      <f:selectItems value="#{backing_testPage.userList}"/>
    </af:selectManyCheckbox>When the form is rendered any strings in the usernames array that are in the userList will be checked. When submitted, any checked items will be in the array.

  • Dynamic Structure / Element building

    Hallo, I am new to Java and have some problems at building Elements and handling like passing them to some dynamic structure and letting the references be handled without losing the elements in memory.
    There are also some questions about general memory usage. I hope it gets visual at this small testclass. Maybe you can pass me throuh to some reference post at topic?
    import java.util.*;
    import javax.swing.*;
    class Testvec{
         public static void main(String args[]){
              Vector<String> ob = new Vector<String>();
    //          String string[] = new String[1000000]; @tested to add this at vector, but cant remove
              System.out.println(ob.size());
              long mem = Runtime.getRuntime().totalMemory(); //- Runtime.getRuntime().freeMemory();
              //@1 What about that here? total and free almost same value
              long time = System.nanoTime();
              System.out.println("Total Runtime Mem: "+Runtime.getRuntime().totalMemory()/Math.pow(2,20));
              System.out.println("Free Runtime Mem: "+Runtime.getRuntime().freeMemory()/Math.pow(2,20));
              JOptionPane.showInputDialog(null,"Runtime stopped");
              //@2 time to look at taskmanager, the value differs to total runtime memory @doubled
              time = System.nanoTime();
              for (int i = 0; i < 1000000; i++){
    //               string[i] = Integer.toString(i);
                   ob.add(Integer.toString(i));
              time = System.nanoTime()-time;
              mem = Runtime.getRuntime().totalMemory(); //- Runtime.getRuntime().freeMemory() - mem;
              System.out.println("Total Runtime Mem: " +Runtime.getRuntime().totalMemory()/Math.pow(2,20));
              System.out.println("Free Runtime Mem: " +Runtime.getRuntime().freeMemory()/Math.pow(2,20));
              System.out.println("Memory taken @ " mem/Math.pow(2,20) " MBytes" +"\n" +"Time nedded @ " time/Math.pow(10,9) " seconds");
              System.out.println(ob.size());
              //@QUESTION I just want to know how to remove from vector. If i put it in the building loop
              //and remove it immediately after adding, memorysize does not grow. Here like you see the last
              //element is removed, but stays in memory. How to fix it?
              //maybe I have to build the added element in another way? and not at adding but look @tested
              for (int i = 0; i < 1000000; i++){     
                   ob.remove(ob.size()-1);
    //               string[i] = null;
              System.out.println(ob.size());
              //Here I ve tried clearing at once, but does not work either that way. The vector is empty and I ve lost Strings in memory
         //     ob.removeAllElements();
         //     ob.clear();
         //     ob = null;
         // System.gc();
              JOptionPane.showMessageDialog(null,"HalloWindow");//@3 time to look at taskmanager, the value differs to total runtime
              //but not that much anymore and there is a little bytechange(seems to have some cases?) if you run sometimes again
    }

    992686 wrote:
    Hmm, sorry... the format and some bytes were lost between copy and paste.Edit your post and use the tags to format the code.
    And what does happen when I remove them while nobody holding references? If nobody has references to the objects, the garbage collector will collect them. Just putting them in an ArrayList won't lose them, the ArrayList will still have references to the objects.
    tried also to build dynamic array myself but having problems with memory managmentNo, you have no problems with memory management.
    cant get back to the amount of startup, even backwards does not work...That's because you're trying to do irrelevant things. Basically you're wasting your time.
    Maybe I should trie interface building object?No, you should learn the basics of Java by going through the tutorials.
    Have fun there.Thanks, you too!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for