I am having trouble with an x-dialog event. I created the attached x-dialog to perform data entry into a form. When the user exits the field "Segment", I need to capture the "killfocus" event so that I can create an appropriate case number for the program the client is eligible for. I have traced out the events for the field., and it seems that the "killfocus" never fires, even when I depart the field. The variable field is a drop-down list built from a table. The user could either key in the segment, or select from the dropdown. In either case, when they go to the next field, there is no killfocus event.
Included here is the entire script, a trace of theevents for either selecting from a drop down or keying in the segment, and a screenshot of the dialog.
Any suggestions would be greatly appreciated.
Dialog script:
log of events:
Select from Drop Down
tYPE IN SEGMENT
Tom
Included here is the entire script, a trace of theevents for either selecting from a drop down or keying in the segment, and a screenshot of the dialog.
Any suggestions would be greatly appreciated.
Dialog script:
Code:
'Date Created: 05-May-2010 02:54:53 PM 'Last Updated: 07-May-2010 09:54:38 AM 'Created By : Thomas Henkel 'Updated By : Thomas Henkel 'Create an XDialog dialog box to prompt for parameters. dim global cLOG as C cLog = "" DIM clt as P DIM lnk as P DIM SHARED vCASENO as C = "" DIM SHARED vSSN as C DIM v65 as L DIM SHARED vNAME as C = "" DIM SHARED vPGM as C = "" DIM SHARED vSEGM as C = "" DIM SHARED vIWORKER as C = "" DIM SHARED vCWORKER as C = "" DIM SHARED vSWORKER as C = "" DIM SHARED vDATE1 as D = {} DIM SHARED vDATE2 as D = {} DIM SHARED vACTION2 as C = "" DIM SHARED vDATE3 as D = {} DIM SHARED vSTATUS as C = "" DIM SHARED vSTAT_DATE as D = {} DIM SHARED vFILEROOM as C = "" DIM SHARED vCREASON as C = "" DIM SHARED vDREASON as C = "" DIM SHARED vERROR as L DIM SHARED varC_result as C DIM vSEG_rl_def as C DIM vPGM_rl_def as C DIM vIWORKER_rl_def as C DIM vCWORKER_rl_def as C DIM vSWORKER_rl_def as C DIM vACTION2_rl_def as C DIM vSTATUS_rl_def as C DIM vCREASON_rl_def as C DIM vDREASON_rl_def as C 'debugcheck() 'clt = table.open("client",FILE_RO_SHARED) clt = table.current() vSSN = clt.ssn if clt.dob < addyears(date(),-65) v65 = .T. else v65 = .F. end if vNAME = UT(clt.fname)+" "+ut(clt.lname) 'lets first determine if the client already has a case number lnk = table.open("LINK",FILE_RO_SHARED) lnk.index_primary_put("Ssn") foundit = lnk.fetch_find(vSSN) if foundit > 0 if isalpha(left(lnk.Case,1)) vCASENO = lnk.Case else if left(right(trim(lnk.case),6),1)>"3" vCASENO ="S"+right(trim(lnk.case),6) else vCASENO = "C"+right(trim(lnk.case),6) end if end if else script_play_local("reg new case number") end if if vERROR end end if vSEG_rl_def = "k=segment,{keylist_build(\"H=.05,1:9,2:35\",''+Seg,left(''+Seg,9),left(''+Describe,35))}{}" vPGM_rl_def = "k=pgm,{keylist_build(\"H=.05,1:9,2:25\",''+Pgm,left(''+Pgm,9),left(''+Desc,25))}{}" vIWORKER_rl_def = "k=workers,{keylist_build(\"H=.05,1:8,2:25\",''+Wcode,left(''+Wcode,8),left(''+Wname,25))}{between(left(wcode,1),\"A\",\"B\").and.left(WCODE,3)<>\"ADM\".and.left(wcode,2)<>\"AM\".and.left(wcode,2)<>\"AP\".and.left(wcode,2)<>\"AX\".and.left(wcode,2)<>\"BD\".and.left(wcode,2)<>\"BT\"}" vCWORKER_rl_def = "k=workers,{keylist_build(\"H=.05,1:8,2:25\",''+Wcode,left(''+Wcode,8),left(''+Wname,25))}{between(left(wcode,1),\"A\",\"B\").and.left(WCODE,3)<>\"ADM\".and.left(wcode,2)<>\"AM\".and.left(wcode,2)<>\"AP\".and.left(wcode,2)<>\"AX\".and.left(wcode,2)<>\"BD\".and.left(wcode,2)<>\"BT\"}" vSWORKER_rl_def = "k=workers,{keylist_build(\"H=.05,1:8,2:25\",''+Wcode,left(''+Wcode,8),left(''+Wname,25))}{left(wcode,2)=\"AM\".or.left(wcode,2)=\"AP\".or.left(wcode,2)=\"AX\".or.left(wcode,2)=\"BD\".or.left(wcode,2)=\"BT\"}" vACTION2_rl_def = "k=caseact,{keylist_build(\"H=.05,1:10\",''+Action,left(''+Action,10))}{}" vSTATUS_rl_def = "k=status,{keylist_build(\"H=.05,1:4,2:25\",''+Status,left(''+Status,4),left(''+Desc,25))}{}" vCREASON_rl_def = "ke=closerea,{keylist_build(\"H=.05,1:6,2:15,3:25\",''+Closecode,left(''+Closecode,6),left(''+Category,15),left(''+Describe,25))}{}" vDREASON_rl_def = "ke=denyreas,{keylist_build(\"H=.05,1:6,2:15,3:25\",''+Denycode,left(''+Denycode,6),left(''+Category,15),left(''+Describe,25))}{}" heading_string = vNAME+" - Case No: "+vCASENO+crlf()+"Case Information Entry" ok_button_label = "&OK" cancel_button_label = "&Cancel" varC_result = ui_dlg_box(agency+ " Customer Information",<<%dlg% {Background=#234+255+255} {region} {text=45,2:heading_string}; {endregion}; {line=1,0}; {lf}; {region} Program: [%@vPGM_rl_def%.10vPGM]{sp=5} Segment: [%@vSEG_rl_def%.10vSEGM!vSEGM_*]; {lf}; Application Date: [%DATE;P=popup.calendar(dtoc(vDATE1));I=popup.calendar%.15vDATE1!vDATE1_*]{sp=3} Registration Date: [%DATE;P=popup.calendar(dtoc(vDATE2));I=popup.calendar%.15vDATE2!vDATE2_*]{sp=3} Registration Action: [%@vACTION2_rl_def%10.20vACTION2]; {lf}; Intake Case Worker: [%@vIWORKER_rl_def%.10vIWORKER]{sp=5} Ongoing Case Worker: [%@vCWORKER_rl_def%.10vCWORKER]{sp=5} Service Case Worker: [%@vSWORKER_rl_def%.10vSWORKER]; {endregion}; {lf}; {region} Case Status: [%@vSTATUS_rl_def%.8vSTATUS]{sp=3} Status Date: [%DATE;P=popup.calendar(dtoc(vSTAT_DATE));I=popup.calendar%.15vSTAT_DATE!vSTAT_DATE_*] {endregion}{sp=3} {condition=(vSTATUS="C")} {region=a} Close Reason: [%@vCREASON_rl_def%.8vCREASON] {sp=3} {condition=(vSTATUS="D")} {start_pos} Deny Reason: [%@vDREASON_rl_def%.8vDREASON]{endregion}; {condition=.T.} {region} {lf}; Close Date: [%DATE;P=popup.calendar(dtoc(vDATE3));I=popup.calendar%.15vDATE3!vDATE3_*]; {lf}; File Room: (vFILEROOM:3) (vFILEROOM:4) {endregion}; {line=1,0}; {region} <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL> {endregion}; %dlg%,<<%code% [SIZE="4"]'*******HERE is where I am attempting to trap the event ***********[/SIZE] [COLOR="Red"][B]if left(a_dlg_button,6) = "vSEGM_" then clog = clog+a_dlg_button+crlf() if a_dlg_button = "vSEGM_killfocus"[/B][/COLOR] 'debug(1) 'determine if Medicaid, If so, change case number to appropriate "02" number if vPGM = "MED" SELECT case vSEGM="CCPD".or.vSEGM="GO".or.vSEGM="JCAD".or.vSEGM="TTW".or.vSEGM="MOCM".or.vSEGM="MOAL".or.vSEGM="JCNH".or.vSEGM="MONH" if v65 vCASENO="0210"+right(trim(vCASENO),6) else vCASENO="0220"+right(trim(vCASENO),6) end if case vSEGM="MNC".or.vSEGM="MNNH" if v65 vCASENO="0215"+right(trim(vCASENO),6) else vCASENO="0225"+right(trim(vCASENO),6) end if case vSEGM="FAM" vCASENO="0230"+right(trim(vCASENO),6) case vSEGM="FCA" vCASENO="0270"+right(trim(vCASENO),6) case else vCASENO = vCASENO END SELECT 'refresh the heading string heading_string = vNAME+" - Case No: "+vCASENO+crlf()+"Case Information Entry" end if end if a_dlg_button = "" end if if left(a_dlg_button,7) = "vDATE1_" then if a_dlg_button = "vDATE1_killfocus" then vDATE1 = ctod(dtoc(vDATE1)) end if a_dlg_button = "" end if if left(a_dlg_button,7) = "vDATE2_" then if a_dlg_button = "vDATE2_killfocus" then vDATE2 = ctod(dtoc(vDATE2)) end if a_dlg_button = "" end if if left(a_dlg_button,7) = "vDATE3_" then if a_dlg_button = "vDATE3_killfocus" then vDATE3 = ctod(dtoc(vDATE3)) end if a_dlg_button = "" end if if left(a_dlg_button,11) = "vSTAT_DATE_" then if a_dlg_button = "vSTAT_DATE_killfocus" then vSTAT_DATE = ctod(dtoc(vSTAT_DATE)) end if a_dlg_button = "" end if %code%) if varC_result <>"OK" ui_msg_box(Agency+" Customer Information","Action cancelled at user request") end end if
Select from Drop Down
Code:
?clog = vSEGM_popup vSEGM_popupdone vSEGM_change vSEGM_change vSEGM_selok
Code:
?clog = vSEGM_change vSEGM_change vSEGM_changing vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change vSEGM_change
Comment