Valids not being fired

This forum is for eXpress++ general support.
Post Reply
Message
Author
Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Valids not being fired

#1 Post by Cliff Wiernik »

I have seen the results in my application in the past. Validations that should be happening are not being processed. As a result, on the respective screen I added page level validation to catch these occurrences and attempt to resolve them. In most cases this has worked but have never determined the cause. Validations failing to be fired can be a major problem.

Today I go more detailed information on the check for our customer loan credit application program. We have two date field, one for when the paperwork has been received and then when the paperwork has been reviewed. The 2 date fields start out empty. When the user clicks modify and enter edit mode, they go to the date fields and enter in the date, typically by using the +/- key or entering in the actual date. When the field is exited, the valid clause normally causes the corresponding user initials field for the paperwork and paperwork review date fields to be populated and displayed on the screen.

Today, when the valid clause did not work properly I had the user stop doing anything until I could review the dialog that was still in the edit mode. The error check process returns focus to the field in question that upon exit with a non-empty date value, updates the initials field if no currently completed. I exited the now completed field and the proper updating of the user initial field did not occur. I then click on the state filed, while still in edit mode, and entered in the state code of WW, which is not valid. However, the popup saying the invalid state code of 'WW' did not appear. The valid clause did not fire. I even went out of edit mode and then went back in and the state code validation still did not work. I should have tried other validation fields but did not this time. For some reason the valid clauses were not firing.

Only when I closed that dialog, staying in the main program and reopened that dialog did the validation clauses again work.

What is causing the validation clauses to not be fired. It is as if the fields never detect focus being gained so focus is not lost or detect as lost. This is not a readily duplicable situation but it can be detected so some type of debugging could be added. I am using Express 264. Is there something in the Express++ kernel that could be disabling the valids from being en mass.

Cliff Wiernik
Posts: 605
Joined: Thu Jan 28, 2010 9:11 pm
Location: Steven Point, Wisconsin USA
Contact:

Re: Valids not being fired

#2 Post by Cliff Wiernik »

Had another episode today. This is what the user said they did.

1. Enter a new customer account via one dialog
2. Went to the customer application dialog for the next account to work on.
3. Press "M", the hotkey for the modify pushbutton. It first calls the gotofirst function to go to the first editable field on the dialog:

Code: Select all

FUNCTION GotoFirstGet( oFocus, aApp )
LOCAL i, oXbp, aChildList, lFocus := .F.

  aChildList := oFocus:childList()
  SetAppFocus(oFocus)
  IF DC_VersionExpress(3) < '235' .OR. DC_VersionExpress(3) > '235'                                                // PC CAW 04-25-05
      LB_CompleteEvents(.T.)
  ENDIF
  FOR i := 1 TO Len(aChildList)
    oXbp := aChildlist[i]

    IF (oXbp:isDerivedFrom('DC_XbpGet')       .OR. ;
        oXbp:isDerivedFrom('DC_XbpCheckBox')  .OR. ;
        oXbp:isDerivedFrom('DC_XbpComboBox')  .OR. ;
        oXbp:isDerivedFrom('DC_XbpRadioButton')) .AND. ;
       oXbp:isVisible() .AND. ;
       oXbp:isEnabled() .AND. ;
      (Empty(oXbp:protectBlock) .OR. !Eval(oXbp:protectBlock))
      SetAppFocus(aChildList[i])
      lFocus := .T.
      EXIT
    ELSEIF !Empty(oXbp:childlist())
      lFocus := GoToFirstGet( oXbp, aApp )
      IF lFocus
        EXIT
      ENDIF
    ENDIF
  NEXT

  RETURN lFocus
4. Clicked on the date file for the date the information was received and enter the paperwork date field (next field) and pressed PgDn, the hotkey for the "Save" pushbutton to start the update process. I have a page level validation added detects that the initials of the user who enters in these dates did not get automatically updated by the valid clause attached to the two date fields.

5. The user then called me when the popup indicated that there were completed date fields and no user initials. While still in edit mode I used the mouse to go to any of the several fields on the dialog with valid clauses (like the State code or a field requiring the entry of a valid user or another requiring the entry of a valid product line). None of the fields exhibited the valid clause being fired. There would accept any value. I then clicked on the workstation desktop outside of the application and then back to the customer application dialog. I then clicked and tested the state code attempting to enter 99 for the state which promptly reported that it was not valid. I then accessed the date field again and it now properly updated the corresponding user initials field with the initials of the currently logged in user and everything again worked properly.

So it would appear that something in either Xbase++ or Express++ is causing it to not detect focus being placed in any field having a valid clause and thus when the field is exited, it is not detecting that edit focus has been lost and that the valid should be processed. I point to Xbase++/Express++ because these are what is providing this information. Since the issue is being trapped but not prevented, I am wondering what I should do to get more info as to what is happening. What events should I be trapping/logging to try to determine what is happening. I would guess something tied to the gotfocus clause or lost focus clause or something that I could turn on when the event is trapped in order to get more information.

But the key thing is that if I click outside of the application, then back on the dialog, the issue is fixed. I need to add something, that is working behind the scenes, that will provide more debugging info to determine what is happening.

What specifically does Express++ use to trigger/detect when a field with a valid clause is entered/exited in order to determine that the valid clause needs to be evaluated. In the case of this code, it just populates a field and updates the screen with that value.

Post Reply