How to dynamically populate IDropDownListController

Hi!
My question is how can I dynamically populate the IDropDownListController widget? In the sample project WriteFishPrice the entries are all static, but I need to add or remove entries in the list. Thanks for any pointers!

Assuming you want to add inside a controller or an observer to you panel
Here's a function I use.
void MyDialogController::InitialiseDropdown(K2Vector<PMString> &stringArray, const WidgetID &widgetId)
    InterfacePtr<IPanelControlData> panelControlData(this, UseDefaultIID()); // i can get a Panelcontoldata because my controller is in the kDialogBoss
    if (panelControlData == nil)
        ASSERT_FAIL("panelControlData invalid");
    do
        IControlView* view = panelControlData->FindWidget(widgetId);
        if (view == nil)
            ASSERT_FAIL("control view invalid");
        InterfacePtr<IStringListControlData> stringListControlData(view, UseDefaultIID());
        if (stringListControlData == nil)
            ASSERT_FAIL("invalid stringListControlData");
            break;
        // Clear the drop down list.
        stringListControlData->Clear(
            kFalse, // don't invalidate.
            kFalse // don't notify
        // Add their names to the drop down.
        K2Vector <PMString>::iterator iter;
        for (iter = stringArray.begin(); iter < stringArray.end(); iter++)
            PMString server = *iter;
            server.SetTranslatable(kFalse);
            stringListControlData->AddString
                server,
                IStringListControlData::kEnd,
                kFalse, // don't invalidate.
                kFalse //don't notify.
        view->Invalidate();
    while(false);

Similar Messages

  • How to dynamically populate a listbox with the values in the database

    Hi,
    How do dynamically populate the list box with the values in the oracle database. I want to load the list box at run time.Plz anybody help me out to find a solution for this problem.
    Thanks in advance...
    Regards,
    Shiva.

    u can wite code like this..on jsp page
    <%
    ResultSet rs = stmt.executeQuery("select vender_name from vendors");
    %>
    <select name = "vendorlist">
    <%
    while(rs.next()){
    String vname = rs.getString(1);
    %>
    <option value="<%=vname%>"><%=vname%></option%>
    <%
    rs.close();
    %>

  • How to dynamically populate data from a data source

    What I am trying to do:
    I am building a simple blog reader application with two screens, 'Home' and 'FeedR'.
    The data needed for this to work is an excel table 'Blogs'; which has the following columns:
    BlogName, image, Source
    I have created about 6 REST data sources from the RSS feeds of these blogs and added their names into the excel table.
    The home has an "Image Gallery with Text", which has the blog image and BlogName on it. On the select event, I want to navigate to the second screen and populate the text gallery with the feed details.
    The Problem:
    So, when I have only feed, I can do something like:
    'Navigate(FeedR, ScreenTransition!UnCover);Collect([@blogposts], rss_aspx!channel!item)'.
    When I have more than one feed; I would like to be able to do something like:
    'Navigate(FeedR, ScreenTransition!UnCover);Collect([@blogposts],
    (Blogs!Source)!channel!item)'.
    The Question:
    Is dynamically populating the name of the data source work? If yes, how do I do it? If no, is there a way around it?
    I was looking at UpdateContext(), but does not seem like a feasible option.
    Thanking you...
    Hemanth

    you wanted a onchange for a htmlb:inputfield which would also trigger server event. try the following code.
    <htmlb:inputField id            = "test"
                                alignment     = "LEFT"
                                size          = "6"
                                required      = "TRUE"
                                doValidate    = "TRUE"
                                type          = "INTEGER"
                                 />
    <bsp:htmlbEvent id="myid" onClick="myonclick" name="ValueChanged" />
      <script for="test" event=onchange type="text/javascript">
    alert(this.value);
    ValueChanged();
    </SCRIPT>
    if the value in the inputfield is changed it would trigger a alert at the client side and also trigger a server event. now you can caputre the value in oninputprocessing.
    Hope this helps.
    do let us know if you need help in how to capture this value in oninputprocessing.
    Regards
    Raja

  • How to dynamically populate a manager name and level for any user who login

    Hi All,
    I need some help in doing this in my DB:
    Table 1 is the the manager hierarchy {which basically shows the structure of every employee's org).
    Table 2 is a list of all people manager ( all these usernames will also be in table 1). What i need to find is using the username from Table 2, the highest level that username exists in the manager hierarchy.
    For ex:
    Table 1: { What this shows is Sam is CEO and Jeff reports to him. So for Sam, he will exist on all 15 levels and Jeff will have Sam has his top level manager and then Jeff will repeat for all remaining levels till 15.
    Manager Level 0  Level 1  Level 2 Level 3...Level15
    Sam                       Sam     Sam     Sam         Sam
    Sam                        Jeff     Jeff        Jeff          Jeff
    Now in Table 2:
    User Name   Manager Level/Name
    Sam               Manager Level 0 Sam
    Jeff                 Manager Level 1 Jeff
    As you see, for each user name in Table i want to populate their high level from the manager hierarchy {their record in manager hierarchy).
    Hope This helps to clear the confusion.
    Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hello,
    this is the forum for the tool {forum:id=260}. Please mark this question as answered, so others know that they can ignore it.
    Then post again in {forum:id=75}
    Regards
    Marcus

  • How do I populate a popup button?

    Well, I've found this snippet of code here and in various place around the 'net:
    tell window 1
        tell menu of popup button 1
            delete every menu item
            repeat with catListItem in catList
                make new menu item at end of menu items with properties {title:catListItem}
            end repeat
        end tell
    end tell
    When I use it in my AppDelegate script in a Cocoa-AppleScript Application, Xcode gives me an error: "t2t_AppDelegate.applescript:25: error: Expected end of line but found identifier. (-2741)" Line 25 is "tell menu..."
    I'm not sure what I'm missing that would allow me to dynamically populate the popup button with a list of terms (catList) that I'm drawing from another application. Any suggestions?

    Thanks for answering, Red Menace, here and elsewhere. Yes, this code was found in connection with AppleScript Studio. Silly me, I thought a Cocoa-AppleScript Application would be similar.
    I've added the
    property popCatList : missing value
    declaration and connected the Pop Up Button in my view: what I'm seeing is (Menu)-(Menu - popCatList). Then I added the
    popCatList's addItemsWithTitles_(catList)
    command. Leaving out my code to populate the initial array, here's what I've got:
    script t2t_AppDelegate
         property parent : class "NSObject"
         property popCatList : missing value
         set catList to {"1","2","3"}
         popCatList's addItemsWithTitles_(catList)
         on applicationWillFinishLaunching_(aNotification)
              -- Insert code here to initialize your application before any files are opened
         end applicationWillFinishLaunching_
         on applicationShouldTerminate_(sender)
              -- Insert code here to do any housekeeping before your application quits
              return current application's NSTerminateNow
         end applicationShouldTerminate_
    end script
    The build succeeds but I get nothing in the popup. Have I created the connection improperly (I can't figure out how to remove it -- clicking the 'x' doesn't do anything) or is there some additional code I'm missing?

  • Dynamically  populate  a  record  group  on  the  fly uisng LOV

    Hi,
    I want to create dynamically populate a record group on the fly uisng LOV.
    1. This is how the RG_BANKNAME Record Group object look like
    Object : Record Group
    Name : RG_BANKNAME
    Record Group Query : SELECT NAME, SHORT_NAME FROM C_BANKS
    2. I create the Push Button and when user click it will popup the LOV.
    DECLARE
         rg_id RecordGroup;
         errcode NUMBER;
         status BOOLEAN;
    BEGIN
         rg_id := Find_Group('RG_BANKNAME');
         IF Id_Null(rg_id) THEN
              Message('No such group: ',ACKNOWLEDGE);
              RAISE Form_Trigger_Failure;
         ELSE
              errcode :=POPULATE_GROUP(rg_id);     
              SET_LOV_PROPERTY('LV_NAME', TITLE, 'My Own LOV');
              SET_LOV_PROPERTY('LV_NAME', GROUP_NAME, rg_id);
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Title, 'NAME');
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 1 ,Width, 150);     
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Title, 'SHORT NAME');
              SET_LOV_COLUMN_PROPERTY('LV_NAME', 2 ,Width, 100);     
              status := Show_LOV('LV_NAME',10,20);
              IF NOT status THEN
                   Message('You have not selected a value.');
                   Bell;
              END IF;
         END IF;
    END;
    My question is do I need to create the LOV Object name call 'LV_NAME'? since I don't have this
    create on my design times, because I thought it can be done dynamically on the fly.
    The problem is compliant that the Lov Id is not valid.
    Thanks
    David
    Edited by: user445990 on May 24, 2011 9:19 PM

    Hello,
    You request is not clear. Do you need to display the LOV or not ? In other words, what is the goal of your record group ?
    Francois

  • How do I populate one Combo box based on input from another

    Hi,
    I have a dynamic Combo box populated from a database. Now I want to use the onChanged event to dynamically populate a second combo box on the same page.
    Any ideas on how to do this?
    Robert
    [email protected]

    Here is an example:
    let us consider it not coming from the database:
    <html>
    <head>
    <title>New Page 1</title>
    <script>
    function popSub()
    var n = 1;
    var mainValue;
    mainValue = document.test.main.options[document.test.main.selectedIndex].value ;
    if (mainValue=="Age" )
                        document.test.sub.options[n].value = 'below18';
                        document.test.sub.options[n].text = 'Below 18';
                        n =     n + 1;
    if (mainValue=="Age" )
                        document.test.sub.options[n].value = 'over18';
                        document.test.sub.options[n].text = 'Over 18';
                        n =     n + 1;
    if (mainValue=="Sex" )
                        document.test.sub.options[n].value = 'male';
                        document.test.sub.options[n].text = 'Male';
                        n =     n + 1;
    if (mainValue=="Sex" )
                        document.test.sub.options[n].value = 'female';
                        document.test.sub.options[n].text = 'Female';
                        n =     n + 1;
    </script>
    </head>
    <body>
    <form method="POST" name="test">
    <p><select size="1" name="main" onClick="popSub()">
    <option value="Age">Age</option>
    <option value="Sex">Sex</option>
    <option selected>select one</option>
    </select></p>
    <p><select size="1" name="sub">
    <option value=""></option>
    <option value=""></option>
    <option value=""></option>
    </select></p>
    <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>
    </body>
    </html>
    If it coming from the database then you have to write the javascript function in jsp as follows:
    out.println('<script language="JavaScript">');
    out.println('function popSub()');
    out.println('{');
    out.println('var n = 1;');
    out.println('var mainValue;');
    out.println('mainValue = document.test.main.options[document.test.main.selectedIndex].value ;');
    // start one for loop from 1 to record count
    out.println('if (mainValue=="' + valuefrom the resultset + '")');
    out.println('{');
    out.println("document.test.sub.options[n].value = '" + value from the result set +"';");
    out.println("document.test.sub.options[n].text = '"+value from the result set+"';");
    out.println('n=n+1;');
    out.println('}');
    // end of the for loop
    finish the javascript function using out.println

  • Hey, How do I populate my replace colors color library in illustrator? I tried to replace color on a traced/ vectorized image and when I selected and went to the color library CC said I need to use a valid username. I was already logged into my adobe acco

    Hey, How do I populate my replace colors color library in illustrator? I tried to replace color on a traced/ vectorized image and when I selected and went to the color library CC said I need to use a valid username. I was already logged into my adobe account.

    Can you please show a screenshot of what exactly you want to replace where?

  • How to dynamically resize JPanel at runtime??

    Hello Sir:
    I met a problem, I need to resize a small JPanel called panel within a main Control JPanel (with null Layout) if I click the mouse then I can Drag and Resize this small JPanel Border to the size I need at runtime, I know I can use panel.setSize() or panel.setPreferredSize() methods at design time,
    But I have no idea how to do it even I search this famous fourm,
    How to dynamically resize JPanel at runtime??
    Can any guru throw some light or good example??
    Thanks

    Why are you using a null layout? Wouldn't having a layout manager help you in this situation?

  • How to dynamically determine Receivers within BPM

    I’m trying to design a way to determine my receivers within my BPM process during runtime.   My Scenario is as follows:
    SAP IDOC
        V
      XI
                 XI uses JAVA Mapping MT1 to determine vendors and if customer receives PIDX
                             JAVA Mapping MT2 to creates the PIDX output file if required
      V
    SENDs to required Vendor (PIDX if required otherwise email)
    My problem is how to dynamically determine the appropriate receiving vendor for my PIDX.
    I can not use the condition editor on the standard Receiver Determination because the output message (PIDX) doesn't have specific enough information to determine the vendor.
    Other than the customer number there are no other values and we don't want to use customer number because each vendor can have multiple customer numbers (hundreds).
    I've tried various attempts but none seem to work.  This could also be because I have limited knowledge of BPMs and this is my first complex development.  Below are the different attempts I've made at dynamically determining the receiver.  Any input would be appreciated.
    Receiver Scenario 1 
      I developed an interface mapping with MT1 as input and the SAP Receiver Determination as output.  The problem is for me to use this, the interface mapping had to reference the PIDX output (MT2 instead of MT1) which has no data that I can use to determine the receiver.
    Receiver Scenario 2
    I added a receiver step right before my send step and used the receiver list.  This appears to send the PIDX to everyone in the list and there is no way to evaluate or eliminate a name from the list. 
    Receiver Scenario 3
    I created a context object in the Integration Builder and assigned it to a field in MT1.  I then added a switch step with a branch for each vendor.  Within each specific branch there is a Send step that has the context object name I created in the "Send Context" field.  However, on the configuration side I’m unable to access the context object which I created on the design side.  Whenever I open the condition editor and select the radiobutton for "Context Object" the list  does not include the context object I created in the Integration Builder.

    Hi,
    Try using the enhaced receiver determination concept.
    Maybe based on certain field values you can write a UDF which calculates the receiver.
    Try this Blog out
    Link : [
    http://help.sap.com/saphelp_nw70/helpdata/en/43/a5f2066340332de10000000a11466f/frameset.htm]
    Regards,
    Abhishek
    Award if helpful.

  • Custom Field in BSID - How do I populate value at time of JE?

    Hi all
    We have a custom append to the BSID table to have a custom field. I was hoping we could populate this custom field on BSID using the FI substitution rule in OBBH. However, it looks like we cannot access BSID from within the FI substitution exit.
    Can anyone suggest how I could populate data into a custom field on BSID at the time of a AR Journal entry?
    Thanks
    V

    I posted the following reply to a similar question before, which I am copying below.
    Try the following: I have taken HKONT (GL Account) as an example to add to the substitution table.
    SE16
    Table GB01
    field HKONT
    execute
    /h
    select the line and hit display
    bearkpoint -> breakpoint at -> subroutine
    enter subroutine -> SET_STATUS_VAL
    F8
    double click on the word "code"
    remove SHOW and type EDIT and click on pencil
    F8
    remove the exclude flag and save.
    do again and save.
    debugging off and save again.

  • How do I populate the address book when trying to send a photo(s) by email?

    How do I populate the address book when trying to send a photo(s) by email?

    Click the Edit Contacts button, the silhouette, in the email attachments panel to bring up the contact book and enter the addresses there. In the contact book, click the new contact button to start entering the information.

  • How can I populate a pdf with database data?

    How can I populate a pdf that we have on our server with database data on our server?

    Actually, if you export it in the right format then you won't need a script
    at all.
    You can import data directly into fields from a plain-text file via Tools -
    Forms - More Form Options - Import Data...
    I believe the format is tab-delimited with the field names in the first row
    and their values in the second.

  • How to dynamically set column name in Answers

    Hi.
    How to dynamically set column name in Answers, for example I want to put presentation variable in column header. Is this possible?
    Regards,
    Goran Ocko
    http://108obiee.blogspot.com/

    May be a rude way .. but it works.
    Add narrative view and use Java script to change the column headings based on the variables.
    <script language="javascript" type="text/javascript">
    var a = document.getElementById('idResultsTableParent');
    var rows= a.getElementsByTagName('tr');
    rows[1].cells[1].innerText ="@{Presentation Variable}";
    </script>
    Editing the same post to remove irrelevant information.
    - Girish

  • How to dynamically resize taskflow popup set as inlineDocument.

    I've been trying to figure out how to dynamically set the WindowHeight and WindowWidth of a taskflow deployed as a inlineDocument popup. Sadly, neither the forums nor google came to the rescue so I had to actually figure this one out on my own. But at least now is my opportunity to work up some forum karma! :)
    Sample workspace containing the solution is here: http://www.williverstravels.com/JDev/Forums/Threads/2337969/MaxPopupSize.zip
    General Strategy for Solution:
    - Pull the browser height and width using Javascript
            function browserSize(evt)
              var button = evt.getSource();
              var agent = AdfAgent.AGENT;
              var windowWidth = agent.getWindowWidth();
              var windowHeight = agent.getWindowHeight();
              AdfCustomEvent.queue(button, "customEvent",
                width: windowWidth,
                height: windowHeight
              true);
              evt.cancel();
            }- Using a clientListener and serverListener, pull this information into a managed bean and set height / width in button's setWindowWidth(), setWindowHeight() attribute.
      public void onButtonClick(ClientEvent clientEvent)
        Double dw = (Double)clientEvent.getParameters().get("width")-100;
        Double dh = (Double)clientEvent.getParameters().get("height")-100;
        this.popupButton.setWindowWidth(dw.intValue());
        this.popupButton.setWindowHeight(dh.intValue());
        ActionEvent aE = new ActionEvent(this.getPopupButton());
        aE.queue();  
      }- Due to JSF Lifecycle complications, the managed bean will need to call a different button than the one which holds the client and server listener. It will be the second button (popupButton in the code above) which then calls the popup.
    Props to Frank for the client / server listener tutorial: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/56-handle-doubleclick-in-table-170924.pdf
    Props to Martin Deh for the javascript insights: http://martindeh.blogspot.com/2011/03/dynamic-resizing-for-popup-dialogs.html
    Hope this helps someone down the road.
    Will

    Thanks LovettWB ...
    Your question helped me a lot...  I am able to pass these two parameters width/height to my bean and am able to set it to pop-up :)                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • Folder is no longer part of the system data source....message

    I just got a replacement phone due to a hardware issue with my old phone.  I was able to transfer all the data from my old device to new device via blackberry desktop manager, however, I have been unable to get the synchronization to work properly. 

  • Edi inbound process

    hi all incoming messages 1. incoming message for ex. (ordrsp) is recieved and stored in a catalog on sap server. 2. In transaction we20 i have for a vendor messagetype ordrsp and processcode ORDR. Processing by func module = trigger immediately. Ques

  • Q10 not switching on

    Hello. Last year I bought my blackberry Q10 and i didn't use it and kept it for almost 8 months. So when I wanted to use it didn't switch on. I tried to charge it but it still doesn't switch on and it flashes red and yellow and also I tried removing

  • No decimals in ALV

    Hi, I am populating field quantity (13+3 decimals) in ALV. I want it to appear without decimal places. how should i get rid of it? there is a field called 'decimals_out' in ALV field catalogue. How to use this..? I am passing '0' in that but its not

  • I think my mac book pro has a virus - is that possible and what can I do?

    I think my mac book pro has a virus.  Is that possible and what can I do? I opened an attachment on an email claiming to be an order confirmation from Amazon.  I now have several copies of it on my desktop and can't delete them.