Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2008
    Posts
    182

    Clear all project Input Objects at once?

    Is this possible?

    I want AMS to clear all Input Objects throughout the project when the user returns to page One.....

    I have no idea how to do this...

    Thanks

  2. #2
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    It can only be done one page at a time.

    Page1, On Show Remember, this will only clear the inputs in page 1
    Code:
    local tObjects = Page.EnumerateObjects();
    if(tObjects)then
    	for i, sObject in tObjects do
    		if(Page.GetObjectType(sObject)==OBJECT_INPUT)then
    			Input.SetText(sObject, "");
    		end
    	end
    end
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  3. #3
    Join Date
    Jun 2008
    Posts
    182
    Thanks, that is what I thought!

    So basically I will have to quite and then restart the AMS project to clear all?

  4. #4
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Or you put it on every page's On Show event. Or you use variables.

    Page 1 On Show

    Code:
    Input1_Content = "";
    Input2_Content = "";
    --etc.
    And on the other pages On Show event you place
    Code:
    Input.SetText("Input2', Input2_Content);
    and while you are on that page you could use the On Key event in the input
    to set Input2_Content every keystroke.

    Code:
    Input2_Content = Input.GetText(this);
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  5. #5
    Join Date
    Apr 2009
    Posts
    277
    just wrap the above code in a function and call it from each page or dialog

    Code:
    function ClearAllInputs(FormType)
    	local tObjects = FormType.EnumerateObjects();
    	if(tObjects)then
    		for i, sObject in tObjects do
    			if(Page.GetObjectType(sObject)==OBJECT_INPUT)then
    				Input.SetText(sObject, "");
    			end
    		end
    	end
    end
    
    -- call from page
    ClearAllInputs(Page)
    
    -- call from dialog
    ClearAllInputs(DialogEx)
    Edit, lol post same time

  6. #6
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Haha yeah, but your way is nicer lol, why didn't I think of that. I like your way of dealing with Page/DialogEx troubles hehe
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  7. #7
    Join Date
    Apr 2009
    Posts
    277
    yeah the DialogEx system broke most of my page wide functions so i updated them with the same system, whenever i make a function that calls a "Page" action i always throw in that switch in case i ever need it in a dialog.

Posting Permissions

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