Alpha Video Training
Results 1 to 1 of 1

Thread: Refresh Conditional Object on Form using a Hotspot

  1. #1
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,619

    Default Refresh Conditional Object on Form using a Hotspot

    I have a form that has an A-Z supercontrol (actually there are 3 of them) inside a conditional object. The condition is based on a variable set by a dropdown object that is also based on a variable. The dropdown when changed by the user sets the index for the form for the user to perform a search based on a key field. When I open the form normally, there is a default setting for the dropdown and the variable is set to select the correct A-Z supercontrol in the conditional object which changes appropriately when the user selects a different field to search by. All of this works great - until I went to open the form to a particular record from another form.

    I was able to change the dropdown and the index from the calling script, but could not get the conditional object to refresh so it would show the correct supercontrol - which in this particular case was NONE. In one of the threads posted here, I think it was Cal Locklin who suggested pushing a button on the form as the OnPush event would trigger the form changes I needed to get the conditional object to refresh. That at least got me thinking in the right direction, though I didn't want to add a button - even if I made it 'invisible', it would still show on the form. Soooo I used a hotspot instead, and placed it on the default page of the conditional object. I also added a new page where the variable was set to blank to hide the supercontrol. The user never sees the click on the hotspot because the blank condition is set so fast now. And he cannot even hover over it to know that something is there.

    After spending most of my day trying to get this to work, I thought somebody else might find it useful.

    Normal vs Called
    default.pngcalled.png

    Code:
    dim choice as c = ""
    dim default as c = "Member Info"
    dim frmname as c = ""
    
    choice = ui_get_list("Open Form",default,"Member Info","Member Data")
    select
    	case choice = ""
    		'user cancelled
    		goto ENDIT
    	case choice = "Member Info"
    		frmname = "MembInfo"
    		Frm_Pop(frmname,"MEMB_ID",go_rec,"center","top")		
    	case choice = "Member Data"
    		frmname = "MembDetail"
    		Go_Frm(frmname,"MEMB_ID",go_rec)
    		xbasic_wait_for_idle(.15)
    		If MembDetail:b_editok.text = "No Edit" then
    			MembDetail:B_EditOk.push()
    		end if	
    		MembDetail:vSearchfor.value = go_rec
    		MembDetail.hotspot1.Push()		
    end select
    
    ENDIT:
    end
    
    '*****************************************
    
    'code for Hotspot on called form
    
    dim shared btntype as c = ""
    dim shared vcLookup as c = "Memb_ID"
    browse1:display.entry.width = 12
    topparent:browse1:display.object.column_title = vcLookup
    btn_cond.refresh()
    lu_field.refresh()           'this is the object name on the form for the var->vcLookup (Search By field)
    My udf's Frm_Pop() and Go_Frm() used in these scripts can be imported into the control panel:
    myudfs_06292019.txt

    EDIT: Just noticed I still have an error to address - notice the column title 'LNAME' (a calculated field) should be ' MEMB_ID' on the called form...I changed the hotspot code above.
    Last edited by MoGrace; 06-30-2019 at 12:01 AM. Reason: Small error noted
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

Similar Threads

  1. Replies: 5
    Last Post: 04-25-2016, 04:16 PM
  2. Refresh bitmap object on form
    By Steve Workings in forum Alpha Five Version 9 - Desktop Applications
    Replies: 12
    Last Post: 12-01-2009, 08:10 AM
  3. Conditional appearnace of object on form?
    By Dave Wilson in forum Alpha Five Version 6
    Replies: 3
    Last Post: 04-23-2005, 09:45 AM
  4. Addressing tabbed form on a conditional object
    By Jeff Klages in forum Alpha Five Version 4
    Replies: 4
    Last Post: 08-27-2002, 05:18 PM
  5. Can conditional object be a form outside of set?
    By Greg Fong in forum Alpha Five Version 4
    Replies: 5
    Last Post: 07-07-2001, 04:01 AM

Bookmarks

Posting Permissions

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