Webdynpro table with dropdow list

hi experts,
i wanna webdynpro table rows have their dropdow list,and each row have it's own list values
how can i do
best regards
zlf

Hi,
I hope you already have a Solution, if not try the following:
1-Create a node"table"(0-n) in the context_View
2-Create 2 attribute in this node.
  - The first"List_atr" to show the list
  - The second "save_atr" to save the value selected from the list
3- Create a Table in the Layout_View, bind it dateSource to the node"table" in context_view
3.1- Add a Column in the Table (Layout_View),
     + add a TableCelEditor "DropDownByKey" elt to this Column,
     + bind the "selectedKey" of this Elt to  the first"List_atr" in the node"table" in the context Node
     + Add a eventhandler(method)"onvalSelected" to the Events "onSelect" of this elt
3.1-implement the method "onvalSelected"
    here tel ur view ctrl to save the value selected in the second "save_atr" in the context_View
example code:
           wdContext.currentTableElement().setsave_atr( wdContext.currentTableElement().getshow_atr());
So if you know how to populate the first "show_atr" with some list, coo. So if the user selected one value in the dropdown list, the method will save it in the cell of the table row and so on for each rows.
If you have another questions just asked.
Best Regards
Glap

Similar Messages

  • Creating a selectable HTML table with Sahrepoint list data dind

    Hi All,
    I m creating an app for sharepoint2013 , on my app I want to read data from SP list and display on something like HTML table/ grid view.
    What I have done is as follows.
    <table cellpadding="0" cellspacing="0" border="0" class="display" id="TermList">
                        <thead>
                            <tr>
                                        <th>Start Date</th>
                                <th>End Date</th>
                                <th>Term Type(s)</th>
                                <th>Specialty</th>
                                <th width="12%">Sub Specialty</th>
                            </tr>
                        </thead>
                                            <tbody>
                            </tbody>
    </table>
    var context = SP.ClientContext.get_current();
    var user = context.get_web().get_currentUser();
    var Termsitems, web, hostcontext, currentusertitle;
    var hosturl;
    (function () {
    $(document).ready(function () {
        gethostdata();
        getUserName();
        $('#TermList').dataTable(
                        "sScrollY": 200,
                            This will enable jQuery UI theme
                        "bJQueryUI": true,
                            will add the pagination links
                        "sPaginationType": "full_numbers"
        getTermdetails();
    function gethostdata() {
        hosturl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
        context = new SP.ClientContext.get_current();
        hostcontext = new SP.AppContextSite(context, hosturl);
        web = hostcontext.get_web();
        context.load(web, 'Title');
        context.executeQueryAsync(onSiteLoadSuccess, onQueryFailed);
    function onSiteLoadSuccess(sender, args) {
        //   alert("site title : " + web.get_title());
    function onQueryFailed(sender, args) {
        alert('request failed ' + args.get_message() + '\n' + args.get_stackTrace());
    function getQueryStringParameter(urlParameterKey) {
        var params = document.URL.split('?')[1].split('&');
        var strParams = '';
        for (var i = 0; i < params.length; i = i + 1) {
            var singleParam = params[i].split('=');
            if (singleParam[0] == urlParameterKey)
                return decodeURIComponent(singleParam[1]);
    // This function prepares, loads, and then executes a SharePoint query to get the current users information
    function getUserName() {
        context.load(user);
        context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);
    // This function is executed if the above call is successful
    // It replaces the contents of the 'message' element with the user name
    function onGetUserNameSuccess() {
    currentusertitle= user.get_title();
      $('#message').text('Hello ' + user.get_title());
    // This function is executed if the above call fails
    function onGetUserNameFail(sender, args) {
        alert('Failed to get user name. Error:' + args.get_message());
    function getTermdetails() {
        var Termlist = web.get_lists().getByTitle("TraineeTermsSPlist");
        context.load(Termlist)
        var camlQuery = new SP.CamlQuery();
        camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Title" />' +
                                 '<Value Type="Text"> + currentusertitle + </Value></Eq></Where></Query></View>');
        Termsitems = Termlist.getItems(camlQuery);
        context.load(Termsitems);
        context.executeQueryAsync(getTermdetailsQuerySuccsess, getTermdetailsQueryFails)
    function getTermdetailsQuerySuccsess(sender, args) {
        var listEnumerator = Termsitems.getEnumerator();
        var datatable = document.getElementById("TermList");
        while (listEnumerator.moveNext()) {
            var oListItem = listEnumerator.get_current();
            var startdate = listEnumerator.get_current().get_item('startdate');
            var enddate = listEnumerator.get_current().get_item('Enddate');
            var termtype = listEnumerator.get_current().get_item('TermType');       
            var Specialty = listEnumerator.get_current().get_item('Specialty');
            var Specialty = listEnumerator.get_current().get_item('Subspecialty');
            $("#TermList").append("<tr align='middle'  class='gradeA'>" +
                                      "<td align='left'>" + startdate +
    "</td>" +
                                      "<td align='left'>" + enddate + "</td>"
    +
                                      "<td align='left'>" + termtype + "</td>"
    +
                                      "<td align='left'>" + Specialty +
    "</td>" +
                                      "<td align='left'>" + Specialty +
    "</td>" + "</tr>");
    function getTermdetailsQueryFails(sender, args) {
        alert(' Error:' + args.get_message());
    Now what I want to do is allow user to select rows on the table. Once they select a row I want to get that selected row and search SP list based on the selected value.  Also I would like to make this table with search area to search records.
    Can someone please help me to do this, or are there any easy way to do this. Sample code or useful link much appreciate.
    Thank you very much.
    d.n weerasinghe

    Instead of writing in dive each and every time directly,
    just have a div in html, and inside the while loop
    write and store in the variable like
      output += "<li><a href='#' style='display:none'>" + usernames[i] + " </a> "
                         + "<table id='results' width='100%'>"
                         + "
    <tr style='border-bottom:1px silver solid;'>"
                         + "
    <td style='width:60px;height:70px;' >"
                         + "
    <img alt=\"profile pic\" src= '" + pictureuri[i] + "'  style='width:60px;height:60px;'/>"
                         + "
    </td>"
                         + "
    <td >"
                         + "
    <table style='height:100%'>"
                         + "
    <tr>"
                         + "
    <td style='padding-padding-vertical-align:top;height:10px' >"
                         + "
    <a href='" + personaluri[i] + "' classq='ms-bold ms-subtleLink' style='color: gray; font-size: 12px; font-weight: bold;'>" + tempnames[i] + "</a>"
                         + "
    </td>"
                         + "
    </tr>"
                         + "
    <tr>"
                         + "
    <td  style='padding-vertical-align:top;height:50px;color:#ADAEAD;font-size:14px;' >" + deptNames[i]
                         + "
    </td>"
                         + "
    </tr>"
                         + "
    </table>"
                         + "
    </td>"
                         + "
    </tr>"
                         + "</table>"
                         + "</li>"
    and finaly oyutside the loop 
    $(#div).html(output);

  • How  to Implement a Chained Hash Table with Linked Lists

    I'm making a migration from C/C++ to Java, and my task is to implement a Chained Hash Table with a Linked List. My problem is to put the strings(in this case names) hashed by the table using de Division Metod (H(k)= k mod N) in to a Linked list that is handling the colisions. My table has an interface implemented(public boolean insert(), public boolean findItem(), public void remove()). Any Help is needed. Thanks for everyone in advance.

    OK. you have your hash table. What you want it to do is keep key/value pairs in linked lists, so that when there is a collision, you add the key/value pair to the linked list rather than searching for free space on the table.
    This means that whenever you add an item, you hash it out, check to see if there is already a linked list and if not, create one and put it in that slot. Then in either case you add the key/value pair to the linked list if the key is not already on the linked list. If it is there you have to decide whether your requirements are to give an error or allow duplicate keys or just keep or modify one or the other (old/new).
    When you are searching for a key, you hash it out once again and check to see if there is a linked list at that slot. If there is one, look for the key and if it's there, return it and if not, or if there was no linked list at that slot, return an error.
    You aren't clear on whether you can simply use the provided linked-list implementations in the Java Collections or whether you have to cobble the linked list yourself. In any case, it's up to you.
    Is this what you're asking?
    Doug

  • Multi insert on table with checkbox list

    Hi all,
    I've a problem perhaps it's a small one but I need to do an insert on a table with with the use of a checkbox, however the checkbox retrieves multiple values.
    Which I've tried to insert with a loop in the pl/sql block.
    How exactly can I do that using bind variables ? Can I get an example, please?
    using Apex 4.0
    kind regards,
    Cleo

    Hi,
    what are you trying to do ? Are you inserting a line only a checkbox is checked, or are your trying to save the values of a group of checkboxes ?
    I got an example for deleting a line with a checked checkbox :
    In your process
    DECLARE
       va_val APEX_APPLICATION_GLOBAL.vc_arr2;
    BEGIN
      va_val := APEX_UTIL.string_to_table(:P20_PARAMETRES, ',');
    FOR i IN 1..va_val.count LOOP
        DELETE MY_TABLE WHERE ID = va_val(i);
    END LOOP;
    :P20_PARAMETRES := '';
    END;In your page header (javascript)
    function delete(){
       if(confirm('Do you really want to delete the checked options ?')){
       var param = document.getElementById('P20_PARAMETRES');
       var root = 'f20_';
       var i = 1;
       var id;
       do{
         id = root + i;
         obj = document.getElementById(id);
         if((obj != undefined) && (obj != null)){
            if(obj.checked == true){
               if (param.value == ''){
                 param.value = obj.value;
               } else {
                 param.value = param.value + ',' + obj.value;
       i++;
       }while((document.getElementById(id) != undefined) && (document.getElementById(id) != null));
    doSubmit('BTN_DELETE');
    }In your report your column must be something like this:
    apex_item.checkbox (20,
                               a.id,
                               NULL,
                               NULL,
                               'f20_' || '#ROWNUM#'
                              ) delete_checkboxThat way I delete only those who has been checked. You can do that or try
    FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
    END LOOP;But I'm not sure how you notice those who are checked or not that way.. If I remember clearly, it only store those who are checked...
    Edited by: leinadjan on Sep 21, 2011 2:45 PM
    Edited by: leinadjan on Sep 21, 2011 3:37 PM

  • Relating 2 tables with one List Control

    I am testing the new data services in FB4 with PHP.   I have created a simple List control that displays a mySQL list  -- which works fine.
    When I double click on an item in the list, I want to use it as the search index for a second table. I use the doubleclick event to make the call to search the second table.
    I set the dataprovider of the same List control to the new search result array returned from the second table.   This does not work.
    The Individual search code to each table work fine, but calling the second search in the doublclick event function does not.
    any examples would be appreciated.

    Thanks for your help.   My code is below:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768" height="314" width="574" xmlns:categories="services.categories.*" xmlns:subcategories="services.subcategories.*">
    <fx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.events.FlexEvent;
    import mx.events.IndexChangedEvent;
    import com.adobe.serializers.utility.TypeUtility;
    import mx.controls.Alert;
    protected function connectToData(event:FlexEvent):void
    getAllItemsResult.token = categories.getAllItems();
    protected function list1_doubleClickHandler(event:MouseEvent):void
    var item:* = category.dataProvider.getItemAt(category.selectedIndex);
    getAllItemsResult2.token = subcategories.getAllItems(item.id);
    category.dataProvider = TypeUtility.convertToCollection(getAllItemsResult2.lastResult);
    category.labelField = "name";
    ]]>
    </fx:Script>
    <fx:Declarations>
    <s:CallResponder id="getAllItemsResult"/>
    <categories:Categories id="categories" destination="categories" endpoint="http://springblue/justin/flex/groupbrowser/bin-debug/gateway.php" fault="Alert.show(event.fault.faultString)" showBusyCursor="true" source="categories"/>
    <s:CallResponder id="getAllItemsResult2"/>
    <subcategories:Subcategories id="subcategories" destination="subcategories" endpoint="http://springblue/justin/flex/groupbrowser/bin-debug/gateway.php" fault="Alert.show(event.fault.faultString)" showBusyCursor="true" source="subcategories"/>
    </fx:Declarations>
    <s:List x="25" y="28" height="265" width="525" id="category" doubleClickEnabled="true" doubleClick="list1_doubleClickHandler(event)" creationComplete="connectToData(event)" dataProvider="{TypeUtility.convertToCollection(getAllItemsResult.lastResult)}" labelField="category_name" contentBackgroundColor="#E5E5E5"/>
    </s:Application>

  • Webdynpro table with icon

    hi experts,
      in a  webdynpro for java project,i have a state field in a table and value maybe 'good','bad',and now i wanna change the value to icon displaying dynamiclly.how can i do?
    best regards
    zlf

    Hi If z (interesting name),
                    First put the images you want to display in a table cell,put those on
    workspace\<Project Name>\src\mimes\Components\com.sap.examples.<project>.<controller>
    folder.
    Then In the table cell where you want to display images choose as table cell Editor->image.Then bind the image under table cell with the table context(string type).
    Then add the coding
    if(status.equals("bad")){
    add the respective image to the table cell.
    the code for adding element to table is
    //Create a new element of the node
    Iprivate<yur_view_name>.I<Node_name>Element elmt = wdContext.create<node_name>Element();
    // Set the values
    elmt.set<Attribute_name>(<value>);
    elmt.set<Attribute_name>(<value>);
    // Add the element to the node
    wdContext.node<node_name>.addElement(elmt);
    Regards
    Indranil
    Award Point for useful answer

  • Find hidden column value in a dynamacally bind html table with Sharepoint list - Javascript

    I have following code. Now I want to get the hidden column value based on user selected row. I also want to highlight the entire row, not only the e.target.
    Can someone please help me.
    function getTermdetailsQuerySuccsess(sender, args) {
    var listEnumerator = Termsitems.getEnumerator();
    var datatable = document.getElementById("TermList");
    while (listEnumerator.moveNext()) {
    var oListItem = listEnumerator.get_current();
    //var firstName = listEnumerator.get_current().get_item('Title');
    //var secondName = listEnumerator.get_current().get_item('LastName');
    var termID = listEnumerator.get_current().get_item('ID');
    var startdate = listEnumerator.get_current().get_item('startdate');
    var enddate = listEnumerator.get_current().get_item('Enddate');
    var termtype = listEnumerator.get_current().get_item('TermType');
    var Hours = listEnumerator.get_current().get_item('Hours');
    var EdNone = listEnumerator.get_current().get_item('EdNoned');
    var Specialty = listEnumerator.get_current().get_item('Specialty');
    var Subspecialty = listEnumerator.get_current().get_item('Subspecialty');
    var Hospital = listEnumerator.get_current().get_item('Hospital');
    var DEMT = listEnumerator.get_current().get_item('DEMT');
    var Supervisor = listEnumerator.get_current().get_item('Supervisor');
    rowcount = rowcount + 1;
    $("#TermList").append("<tr style='border-bottom:1px silver solid' align='middle' class='gradeA'>" +
    "<td align='left' style='display:none'>" + termID + "</td>" +
    "<td align='left'>" + startdate + "</td>" +
    "<td align='left'>" + enddate + "</td>" +
    "<td align='left'>" + termtype + "</td>" +
    "<td align='left'>" + Hours + "</td>" +
    "<td align='left'>" + EdNone + "</td>" +
    "<td align='left'>" + Specialty + "</td>" +
    "<td align='left'>" + Subspecialty + "</td>" +
    "<td align='left'>" + Hospital + "</td>" +
    "<td align='left'>" + DEMT + "</td>" +
    "<td align='left'>" + Supervisor + "</td>" +
    "</tr>");
    $('#TermList').click(function (e) {
    var tr = $(e.target).parent().index() ;
    alert(tr);
    alert($(e.target).text()); // using jQuery
    // var Cells = tr.e.getElementsByTagName("td");
    $(e.target).addClass('row-highlight');
    var confirmationM = confirm("Do you want to edit this term deatils ?");
    if (confirmationM == true) {
    confirmation = "You pressed OK!";
    else {
    confirmation = "You pressed Cancel!";
    $(e.target).removeClass('row-highlight');
    $('#TermList').click(function (e) {
    var tr = $(e.target).parent().index() ;
    alert(tr);
    alert($(e.target).text()); // using jQuery
    // var Cells = tr.e.getElementsByTagName("td");
    $(e.target).addClass('row-highlight');
    var table = $("#TermList")[0];
    var cell = table.rows[tr].cells[1];
    alert(cell);
    var confirmationM = confirm("Do you want to edit this term deatils ?");
    if (confirmationM == true) {
    confirmation = "You pressed OK!";
    else {
    confirmation = "You pressed Cancel!";
    $(e.target).removeClass('row-highlight');
    d.n weerasinghe

    Hi,
    According to your post, my understanding is that you want to customize a table to display the list items.
    We can write CSS to customize the table style(background color, highlight, hover).
    The following is an example for your reference:
    Code:
    <style>
    #TermList table {
    border-collapse: collapse;
    margin-bottom: 2em;
    width: 100%;
    background: #fff;
    #TermList td, th {
    padding: 0.75em 1.5em;
    text-align: left;
    #TermList th {
    background-color: #31bc86;
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    #TermList tbody tr:nth-child(2n-1) {
    background-color: #f5f5f5;
    transition: all .125s ease-in-out;
    #TermList tbody tr:hover {
    background-color: rgba(129,208,177,.3);
    #TermList .HiddenColumn {
    display:none;
    </style>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function () {
    ExecuteOrDelayUntilScriptLoaded(getAllListItems, "sp.js");
    $("#TermList tbody").click(function(e){
    //get hidden column value
    var hiddenColumn=$(e.target).parent().find(".HiddenColumn").text();
    alert(hiddenColumn);
    function getAllListItems(){
    var listName="CustomList01";
    var context = new SP.ClientContext.get_current();
    var web = context.get_web();
    var list = web.get_lists().getByTitle(listName);
    var query = SP.CamlQuery.createAllItemsQuery();
    allItems = list.getItems(query);
    context.load(allItems);
    context.executeQueryAsync(Function.createDelegate(this, this.getSuccess), Function.createDelegate(this, this.failed));
    function getSuccess() {
    var ListEnumerator = this.allItems.getEnumerator();
    while (ListEnumerator.moveNext()) {
    var currentItem = ListEnumerator.get_current();
    var itemID=currentItem.get_item("ID");
    var name=currentItem.get_item("Title");
    var email=currentItem.get_item("Email");
    $("#TermList tbody").append('<tr><td class="HiddenColumn">'+itemID+'</td><td>'+name+'</td><td>'+email+'</td></tr>');
    function failed(sender, args) {
    alert("failed. Message:" + args.get_message());
    </script>
    <table id="TermList">
    <thead>
    <tr>
    <th>Name</th>
    <th>Email</th>
    </tr>
    </thead>
    <tbody>
    </tbody>
    </table>
    Result:
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to update a table with ALV list reocrds

    Dear All,
    I have a requirement to display records in ALV list and these records
    should get updated in a table and I should also be able to insert new
    records in an ALV list.
    Could any  body  please let me know how to do this. This is an urgent requirement.

    You can use Table Control instead. Check the following examples in SE38
    demo_dynpro_tabcont_loop
    demo_dynpro_tabcont_loop_at
    RSDEMO_TABLE_CONTROL
    Regards
    Gopi

  • How to create table with list/map value binding

    I need to display few values in a tabular format. Is it possible to create adf table without having value binding to a VO object. Can I make a table with some list/map combination.
    I want to change the display format with minimum change in the application. Hence I am looking for a change to define a list/map and map it with the table.
    Following is the structure I need to display in.
    |     |Header1|Header2 |     
    |_______|_______|_______|
    |Txt R1 |value 1 |Value 2 |     
    |_______|_______|_______|
    |Txt R2 |Value 3 |value 4 |     
    |_______|_______|_______|
    All the views does not have any relation. Hence I should not create a VO and adding rows of the VO object.
    Edited by: Jaykishan on Jun 10, 2011 11:34 AM

    Yes, you can do it. Create a pojo with the properties(column) you want to display in the table and create a list with the instances of pojos and then you can populate your table using the list.
    Sample:
    //POJO
    public class SamplePojo {
    private String col1;
    private String col2;
    public SamplePojo(String col1, String col2){
      this.col1 = col1;
      this.col2 = col2;
    //add setter and getter methods
    //Inside bean, prepare a list with pojo instances (Assume a getter exists for pojoList)
    pojoList = new ArrayList();
    pojoList .add(new SamplePojo("Value1", "Value2");
    pojoList .add(new SamplePojo("Value3", "Value4");
    etc.
    //Inside jspx
    <af:table value="#{<Bean>.pojoList}" var="pojo" ...>
       <af:column headerText="Header1" ..>
         <af:outputText value="#{pojo.col1}"/>
       <af:column>
       <af:column headerText="Header2" ..>
         <af:outputText value="#{pojo.col2}"/>
       <af:column>
    </af:table>HTH
    Sireesha

  • How to bind ADF table with a collection of elements using backing bean.

    Hi Experts,
    My JDev version is 11.1.1.6.0.
    I need to bind ADF table with a collection of elements using backing bean.
    My backing bean consists of 6 lists of strings, where each list represents a column of table. How can I populate the entries of table with these lists.
    Thanks
    Gopi

    Hi,
    Create an object representing the row (setter/getter). Then have a list of these objects. Drag and drop the table and point its value to the list and the type to the row object
    Frank

  • How to Sort single column in webdynpro table

    Hi all
    I have requirement as follows.
    i have webdynpro table with the following columns like Date,firstname,lastname,address etc.
    now when i run the the application the table is populating the data at runtime that is fine.
    i need as soon as table is loaded , Date field in the table should be displayed the values in the decending order...i have the requirement as follows...
    how to sort the single column in table ...by default the values of the column displayed with decending order as soon as table displays at runtime....i dont want to click any button specific button to do the sort for that column
    Regards
    bindu

    Hi, I solved the same problem by modifying the sort() method in the default TableSorter class so that it takes a column id and direction rather than an event.
    I assume you have read the TableSorter tutorial.
    Like this. (This was done on nw ce 7.1 btw but may work on older versions as well.
    Oh and then you just call the sort method right after you have made the request
    //Code that goes into controller/view to execute sorting
    wdContext.currentContextElement().getPensionplanTableSorter().sort("MyColumnId", "Up", wdContext.nodePensionPlan());
    //Part of TableSorter.java
    //The original method that needs an event. Now it just calls the new method
    public void sort(IWDCustomEvent wdEvent, IWDNode dataSource) {
         // find the things we need
         String columnId = wdEvent.getString("selectedColumn");
         String direction = wdEvent.getString("sortDirection");
         sort(columnId, direction, dataSource);
    //This is the new method.
    public void sort(String columnId, String direction, IWDNode dataSource) {
         if (columnId == null || direction == null ) {
              return;
         IWDTableColumn column = (IWDTableColumn) table.getView().getElement(columnId);
         NodeElementByAttributeComparator elementComparator =
    (NodeElementByAttributeComparator) comparatorForColumn.get(column);
         if (elementComparator == null){
         //not a sortable column
              column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
              return;
         // sorting
         elementComparator.setSortDirection(WDTableColumnSortDirection.valueOf(direction));
         dataSource.sortElements(elementComparator);

  • Af:table with any predefined column (dynamicaly build)

    I want to create a table but i don't know the number and name of the column.
    The user select the object attribute he wants to display in the table and the table his displayed dynamicaly with user selected object attributes.
    How to do this with af:table or backing bean ?

    A af:table, a Data Table is generated with the Create DataTable Wizard.
    In the Create DataTable Wizard either the number of coumns are required to be specified, or a data table may be created by binding a managed bean method which returns a List, ResultSet or an array.
    The number and name of columns are required to bind a data table with a List, result set or array and generate a data table.
    Generating a JSF Data Table section explains generating a data table from a method which returns a List.
    http://www.oracle.com/technology/pub/articles/vohra_hibernate.html
    The SQL query which generates the result set may be different. The number of columns in the result set are required to be the same.

  • Drop Down list in table with data from database table

    Hi,
    I have created an interactive form in WD ABAP.
    In Context tab I have created the nodes as follows:
    ZSOHEADER node with cardinality 1..1
    |-> MATERIAL node with cardinality 0..n. Under MATERIAL node there are 2 attrib. MAKTX and MATNR.
    I am fetching data from MARA table into an internal table IT_MARA.
    The node MATERIAL is bound to internal table IT_MARA.
    I have created a table with property ' Body rows vary depending on data ' .
    I have only one row in table. The first cell of the row is a drop down field.
    I have bind the field to the node MATERIAL->DATA->MAKTX.
    Now the issue is even though I have created only one row in my table, in preview it is creating as many rows in the table as the no.of records in the internal table.
    I want only one row with the drop down list containing all values of the internal table.
    Kindly suggest what to do.
    Regards,
    Vinod

    Hi,
    In the WebDynpro Context, in the main node create another node like A1 with cardinality 0..n and in this node create attributes TEXT and VALUE.
    Now goto method and in that method using code wizard read the node A1.
    And use the below code snippet sample in your program, i.e. code this under respective method of the webdynpro.
    *Declare the TYPES
    TYPES : BEGIN OF TY_TABLE,
    TEXT TYPE SOMETYPE,
    VALUE TYPE SOMETYPE,
    END OF TY_UOM.
    *Define Internal Table and work area.
    DATA : IT_TABLE TYPE STANDARD TABLE OF TY_TABLE INITIAL SIZE 0,
    WA_TABLE TYPE TY_TABLE.
    SELECT TEXT VALUE FROM TABLENAME INTO TABLE IT_TABLE.
    lr_node_info->bind_table( IT_TABLE ).
    And in the Adobe Form Layout
    Go to Menu of the Adobe LiveCycle Designer:
    Tools>Options..>DataBinding
    In that window you just check the Show Dynamic properties Check Box.
    Now for the Drop Down go the binding tab in object palette and click on the list items and there specify the Internal Table and specify the text as the internal table text field and value as internal table value field.
    OR
    From the WebDynpro Native Library Palette use the Value Help Drop Down and in object pallette goto binding tab and provide the form interface binding. Before this in the WebDynpro goto Context and for the particular field under the properties provide the search help as dictionary search help and specify the name of the dictionary search help.
    OR
    We have another method of setting the Text and Value to the DDL directly in the WebDynpro by coding in the methods, I dont have much knowledge on this.
    Regards
    Pradeep Goli

  • Dynamic table with dynamic drop-down list values

    Hi,
    I need to display a dynamic table with 2 columns on an interactive form.
    My Context is defined as below:
    Root
    StudentData     0..n
    StudentName
    StudentCourses     0..n
    Text
    Value
    The 1st column should display student name, 2nd column should display student courses. The courses will be different for each student. I populated the context properly. I checked it by printing them. My DDL is bound to "Student Courses".
    When there is one row -> The DDL is populated with the courses of student 1 (as there is only one).
    When there are more rows -> The DDLs for all the students are populated with all the courses of all the students.
    I want to see the data populated like:
    TEXTFIELD    DROP-DOWN LIST
    Student 1------Student1-Course1
    Student1-Course2
    Student1-Course3
    Student 2------Student2-Course1
    Student2-Course2
    Student2-Course3
    I tried to do this in plain web dynpro using SVS.. it is also working similarly.
    I have set the singleton property of nodes "StudentData" and "StudentCourses" to false.
    Could any one tell me where I am going wrong?
    Thanks
    Ram

    Ram,
    I'm not sure how much this will help, but I know I had the same problem as you when I tried to get a similar thing working, but I can't remember which of the many changes I made fixed the problem, so I'll just show you my code and perhaps you can see if anything is different than yours.
    Here's where I'm creating my dropdown - in my case EastNew_RegOut is the same as your StudentData, and RateTypeDropValues is the same as your StudentCourses (the comments in the code are not meant to sound bossy to you, this is actually an example piece of code that other developers in my company "steal", so I have to put very specific instructions in there!):
    int nodeSize = wdContext.nodeEastNew_RegOut().size();
    for (int i = 0; i < nodeSize; i++) {
         //create an element called "table", that's the element at i.  So, basically it's a row.  Maybe I should have
         //called it "row" instead of table.
         IPublicDeviceExchange.IEastNew_RegOutElement table = (IPublicDeviceExchange.IEastNew_RegOutElement)wdContext.nodeEastNew_RegOut().getElementAt(i);
         //this line of code just executes an rfc that finds out what rates need to be in the dropdown for this particular row
         executeRateTypeDropdown(rateCategory, table.getNum(), wdContext.currentEastNew_MeterOutElement().getReggrp());
         //clear out what's already in there before we re-populate it.
         table.nodeRateTypeDropValues().invalidate();
         //now, I'm looping through all the values in the *actual* rate type dropdown (the one that's an RFC, populated by the above "execute" method)
         for (int j = 0; j < wdContext.nodeEastRatetype_DropdownOut().size(); j++) {
              //for each element in the *actual* Rate type dropdown, I'm going to create an element in my node that I created
              //and set the values from the *actual* one as the values in my node.
                        IPublicDeviceExchange.IRateTypeDropValuesElement element = wdContext.createRateTypeDropValuesElement();
              IPublicDeviceExchange.IEastRatetype_DropdownOutElement rateTypeOut = (IPublicDeviceExchange.IEastRatetype_DropdownOutElement)wdContext.nodeEastRatetype_DropdownOut().getElementAt(j);
              element.setText(rateTypeOut.getText());
              element.setValue(rateTypeOut.getRatetype());
              //here's another key - notice how I don't say wdContext.nodeRateTypeDropValues() - it's the one that's
              //directly off that table I created earlier - the thing that's essentially a row in my newReg table.
              //So, what I'm doing here is adding that new element I created to the dropdown FOR THAT ROW!               
              //(btw, if you're trying to duplicate this, and this method does not exist for your "table" object, it's
              //probably because you didn't listen to me above and you didn't create your node with the singleton property
              //set to false.)
              table.nodeRateTypeDropValues().addElement(element);
    As for my layout... my table is bound to the EastNew_RegOut node, and the column with the dropdown is bound to RateTypeDropValues.Value  (that's probably obvious, but there you have it anyway)
    Finally, in my context, EastNew_RegOut is singleton = true (I was surprised about this, actually, I would have assumed it was false) with a selection of 0..1 and RateTypeDropValues has singleton set to false with a selection of 0..1
    I hope that helps to some degree!
    Jennifer

  • WebDynpro ABAP : Table with DropDownByKey does not have neat focus

    Hi Experts,
    I have a table, with one column of type dropdownbyKey, i need this so that i can display the DESCRIPTION rather than key. Issue is when i select a ROW in this table i see a special YELLOW BG COLOR on all columns except the column that has drop down by key   it is first thing enduser points out as issue ???
    Any help would attract points

    >
    ramkumarvalluru wrote:
    > Hi Eureka,
    >
    > I am new to webdynpro abap area.Please provide me step by step procedure for working on Dropdown by key,Check boxes  Radio buttons aand all UI elements.
    >
    > Please provide me.
    First of all, please don't attach new questions to existing threads. Second asking for step by step procedures on all UI elements is really outside the scope of a forum posting and asking for too much.  If you are that new to Web Dynpro ABAP, then start by reading the online documentation, the WDA WIKI section, and the WDA eLearnings.

Maybe you are looking for