Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3

Thread: ComboBox Reset

  1. #1
    Join Date
    Oct 2004
    Location
    East, South & West Asia
    Posts
    1,020

    ComboBox Reset

    Hi,

    I need to automatically SELECT a ComboBox to the same data that was retrieved from SQLite in a compiled AM6 Project. After scores of tries it wont work and I am lost.

    Scenario.
    Step 1: After opening an interface, a ComboBox is populated with 3 choices.
    Step 2: After selecting 1 choice, I click submit to save it to SQLite.
    Step 3: When I retrieve the interface again, the ComboBox has already selected my previous choice.
    Step 4. I can reselect another choice from the same ComboBox and save again.

    Here is the code:
    Code:
    	-- Clear the combobox object 
    	ComboBox.ResetContent("CB_MemberStatus");
    
    	--Populate Contents of Membership Status Box
    	--Table of items to be added to the combobox object (text and data)
    	tCB_Member_Status = {}
    	tCB_Member_Status[1] = {sText = "NOT SET", sData = "Not Set Yet"};
    	tCB_Member_Status[2] = {sText = "RENEWED", sData = "Renewed"};
    	tCB_Member_Status[3] = {sText = "NOT RENEWED", sData = "Not Renewed Yet"};
    
    	-- Step through each item in the table
    	for nIndex, tItemInfo in tCB_Member_Status do
    		ComboBox.AddItem("CB_MemberStatus", tItemInfo.sText, tItemInfo.sData);
                 if tItemInfo.sData == sMemberStatus then
    	       ComboBox.SetSelected("CB_MemberStatus", nIndex);
    	end
    sMemberStatus is basically a variable containing a data retrieved from SQLite statement, which was earlier saved. I am pretty sure that the data retrieved is similar to the combobox data.

    Can anyone help?

    Thanks

  2. #2
    Join Date
    Oct 2004
    Location
    East, South & West Asia
    Posts
    1,020

    Additional Info

    The ADD item to ComboBox works well.

    The issue is to get the ComboBox choice be selected when it gets compared to a data from DB.

  3. #3
    Join Date
    Oct 2004
    Location
    East, South & West Asia
    Posts
    1,020
    Quote Originally Posted by azmanar
    The ADD item to ComboBox works well.

    The issue is to get the ComboBox choice be selected when it gets compared to a data from DB.
    Hi again.

    I have resolved it. Whenever I clicked any selected names on my listbox, the Combox Dropdown adjusts itself to the previous selection made and that was saved previously on SQLite DB.

    Here's the code for your reference.
    Code:
    		-- reset dropdown for Member Status Dropdown
    		-- Clear the combobox object (needed for when the page is returned to (2nd+ time it is shown)
    		ComboBox.ResetContent("CB_MemberStatus");
    
    		--Set Contents of Membership Status Box
    		-- Table of items to be added to the combobox object (specify both text and data)
    		tCB_Member_Status = {}
    		tCB_Member_Status[1] = {sText = "NOT SET", sData = "Not Set Yet"};
    		tCB_Member_Status[2] = {sText = "RENEWED", sData = "Renewed"};
    		tCB_Member_Status[3] = {sText = "NOT RENEWED", sData = "Not Renewed Yet"};
    
    		-- Step through each item in the table
    		for nIndex, tItemInfo in tCB_Member_Status do
    			ComboBox.AddItem("CB_MemberStatus", tItemInfo.sText, tItemInfo.sData);
    			if 	tCB_Member_Status[nIndex].sData==sMemberStatus then
    			ComboBox.SetSelected("CB_MemberStatus", nIndex);
    			end
    		end

Similar Threads

  1. Need ComboBox To Update Image Object
    By octane6228 in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 09-21-2006, 12:10 AM
  2. ComboBox problem
    By andrewr in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 05-06-2005, 09:49 AM
  3. Usage Count Expiry - How do I reset it?
    By freddy4242 in forum Setup Factory 7.0
    Replies: 10
    Last Post: 10-18-2004, 07:31 PM
  4. ComboBox display current
    By pjhiggins in forum AutoPlay Media Studio 5.0
    Replies: 4
    Last Post: 05-21-2004, 12:14 PM
  5. Spotlight: ComboBox Object Plugin
    By Desmond in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 03-02-2004, 01:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts