PDA

View Full Version : DD_REQUIRED issue in mobile webapp



danwalsh46
15-Jan-2017, 02:26 PM
I've created a new mobile Webapp and I'm having trouble with a simple wizard-generated view. There are several fields in the view that have DD_REQUIRED assigned in the DD class.

When I tab out of one of the required web forms without entering data, I get the expected error message. Pressing shift+tab or clicking back into the form I do not see the cursor as expected. Additionally, I can type something, but I don't see what I'm typing. Then I press tab again, and only then see the characters that I've typed.

I can't duplicate the problem in the mobile OE example, and I've compared my view to oZoomCustomer.wo without seeing any difference. What could I be missing?



// C:\DataFlex Workspaces\ClientPortal\AppSrc\ZoomNewprovs.wo
// New Provider
//


Use cWebView.pkg
Use cWebPanel.pkg
Use cWebMenuGroup.pkg
Use cWebMenuItem.pkg
Use cWebForm.pkg
Use cWebDateForm.pkg
Use cWebEdit.pkg


Use cClientDataDictionary.dd
Use cNewprovsDataDictionary.dd


Object oZoomNewprovs is a cWebView
Set piColumnCount to 12
Set psCaption to "New Provider"
Set peWebViewStyle to wvsDrilldown
Set peViewType to vtZoom
Set pbShowCaption to False
Set Verify_Save_Msg to 0
Set piMaxWidth to 1024


Object oClient_DD is a cClientDataDictionary
End_Object


Object oNewprovs_DD is a cNewprovsDataDictionary
Set DDO_Server To oClient_DD
End_Object


Set Main_DD To oNewprovs_DD
Set Server To oNewprovs_DD




Object oWebMainPanel is a cWebPanel
Set piColumnCount to 12
WebSetResponsive piColumnCount rmMobile to 4


Object oNewprovsName is a cWebForm
Entry_Item Newprovs.Name
Set piColumnSpan to 6
Set piColumnIndex to 0
Set peLabelPosition to lpTop
Set psLabel to "Name"
Set psPlaceHolder to "required"
End_Object


Object oNewprovsAddress1 is a cWebForm
Entry_Item Newprovs.Address1
Set piColumnSpan to 6
Set piColumnIndex to 0
Set peLabelPosition to lpTop
Set psLabel to "Address 1"
Set psPlaceHolder to "required"
End_Object


Object oNewprovsAddress2 is a cWebForm
Entry_Item Newprovs.Address2
Set piColumnSpan to 6
Set piColumnIndex to 0
Set peLabelPosition to lpTop
Set psLabel to "Address 2"
End_Object


Object oNewprovsCity is a cWebForm
Entry_Item Newprovs.City
Set piColumnSpan to 4
Set piColumnIndex to 0
Set peLabelPosition to lpTop
Set psLabel to "City"
Set psPlaceHolder to "required"
End_Object


Object oNewprovsState is a cWebForm
Entry_Item Newprovs.State
Set piColumnSpan to 1
Set piColumnIndex to 0
Set peLabelPosition to lpTop
Set psLabel to "State"
Set psPlaceHolder to "req"
End_Object


Object oNewprovsZip is a cWebForm
Entry_Item Newprovs.Zip
Set piColumnSpan to 2
Set piColumnIndex to 1
Set peLabelPosition to lpTop
Set psLabel to "Zip"
Set psPlaceHolder to "required"
End_Object


Object oNewprovsPhone is a cWebForm
Entry_Item Newprovs.Phone
Set piColumnSpan to 3
Set piColumnIndex to 0
Set peLabelPosition to lpTop
Set psLabel to "Phone"
Set psPlaceHolder to "required"
End_Object


Object oNewprovsFax is a cWebForm
Entry_Item Newprovs.Fax
Set piColumnSpan to 3
Set piColumnIndex to 0
Set peLabelPosition to lpTop
Set psLabel to "Fax"
End_Object


Object oNewprovsSince is a cWebDateForm
Entry_Item Newprovs.Since
Set piColumnSpan to 2
Set piColumnIndex to 0
Set peLabelPosition to lpTop
Set psLabel to "Since"
Set psPlaceHolder to "required"
End_Object


Object oNewprovsDescription is a cWebEdit
Entry_Item Newprovs.Description
Set piColumnSpan to 0
Set piColumnIndex to 0
Set peLabelPosition to lpTop
Set psLabel to "Description"
Set piMinHeight to 150
Set psPlaceHolder to "required"
End_Object
End_Object


Object oActionGroup is a cWebMenuGroup


Object oSaveBtn is a cWebMenuItem
Set psCSSClass to "WebSaveMenuItem"
Set psCaption to "Save"


Procedure OnClick
Send Request_Save
End_Procedure
End_Object


Object oEditBtn is a cWebMenuItem
Set psCSSClass to "WebEditMenuItem"
Set psCaption to "Edit"


Procedure OnClick
Send ChangeEditMode True
Send SetActionButtons
End_Procedure
End_Object


Object oDeleteBtn is a cWebMenuItem
Set psCSSClass to "WebDeleteMenuItem"
Set psCaption to "Delete"
Set peActionDisplay to adMenu


Procedure OnClick
Send Request_Delete
End_Procedure
End_Object


Object oCancelChangesBtn is a cWebMenuItem
Set psCSSClass to "WebRefreshMenuItem"
Set psCaption to "Clear/Add"
Set peActionDisplay to adMenu


Procedure OnClick
Send RefreshRecord
End_Procedure
End_Object
End_Object


Procedure SetActionButtons
tWebNavigateData NavigateData
Boolean bHasRecord
Handle hoDD


Get Server to hoDD
Get GetNavigateData to NavigateData
Get HasRecord of hoDD to bHasRecord


// let's hide all buttons and then Show the ones we want
WebSet pbRender of oEditBtn to False
WebSet pbRender of oSaveBtn to False
WebSet pbRender of oCancelChangesBtn to False
WebSet pbRender of oDeleteBtn to False


If (NavigateData.bReadOnly) Begin
WebSet pbRender of oEditBtn to True
End
Else Begin
WebSet pbRender of oSaveBtn to True
WebSet pbRender of oCancelChangesBtn to True
WebSet pbRender of oDeleteBtn to bHasRecord
End
End_Procedure


Procedure OnViewSaved Handle hoServer Boolean bChanged
// Close after save
Send NavigateClose Self
End_Procedure


// this will close the view after a delete
Procedure OnViewDeleted Handle hoDDO
Send NavigateClose Self
End_Procedure


Procedure OnNavigateForward tWebNavigateData NavigateData Integer hoInvokingView Integer hoInvokingObject
Case Begin
Case (NavigateData.eNavigateType=nfFromMain)
// If from main, this is a propbably a main file Select to Zoom.
Case Break


Case (NavigateData.eNavigateType=nfFromParent)
// If from parent, this is a constrained drill down.
Case Break


Case (NavigateData.eNavigateType=nfFromChild)
// If from child, this is a probably a parent Zoom from a Zoom.
Case Break


Case Else // must be nfUndefined


Case End


Send SetActionButtons


End_Procedure


End_Object




Here's the DD code:


Procedure Construct_Object
Forward Send Construct_Object
Set Main_file to Newprovs.File_Number


Set Add_Server_File to Client.File_Number


Set Foreign_Field_Option DD_KEYFIELD DD_NOPUT to True
Set Foreign_Field_Option DD_KEYFIELD DD_FINDREQ to True
Set Foreign_Field_Option DD_INDEXFIELD DD_NOPUT to True
Set Foreign_Field_Option DD_DEFAULT DD_DISPLAYONLY to True


Set Key_Field_State Field Newprovs.NewprovsId to True
Set Field_Option Field Newprovs.NewprovsId DD_AUTOFIND to True


Set Field_Option Field Newprovs.Name DD_REQUIRED to True


Set Field_Option Field Newprovs.Address1 DD_REQUIRED to True


Set Field_Option Field Newprovs.City DD_REQUIRED to True


Set Field_Option Field Newprovs.State DD_CAPSLOCK to True
Set Field_Option Field Newprovs.State DD_REQUIRED to True


Set Field_Option Field Newprovs.Zip DD_REQUIRED to True


Set Field_Validate_msg Field Newprovs.Phone to get_PhoneValidation
Set Field_Option Field Newprovs.Phone DD_REQUIRED to True
Set Field_Mask_Type Field Newprovs.Phone to Mask_Window
Set Field_Mask Field Newprovs.Phone to "###-###-####"


Set Field_Validate_msg Field Newprovs.Fax to get_PhoneValidation
Set Field_Mask_Type Field Newprovs.Fax to Mask_Window
Set Field_Mask Field Newprovs.Fax to "###-###-####"


Set Field_Option Field Newprovs.Since DD_REQUIRED to True
Set Field_Mask_Type Field Newprovs.Since to Mask_Date_Window


Set Field_Option Field Newprovs.Description DD_REQUIRED to True


End_Procedure

danwalsh46
21-Jan-2017, 04:30 PM
FWIW, I started over in 18.2 and do not experience the problem. This is a new workspace, this is not a migration.

Stephen W. Meeley
21-Jan-2017, 05:00 PM
Does the 18.2 and 19.0 code match exactly?

danwalsh46
22-Jan-2017, 11:37 AM
Yes, same code. The DD's & WO's from the 19.0 workspace I had created. The Webapp.src had to have the 19.0 specific stuff commented out.

danwalsh46
22-Jan-2017, 11:51 AM
When first i began this project, I created a new workspace in 19.0. This is rewrite of an old 17.0-style Webapp that's been in production for some time. I copied the contents of the old WS DdSrc & Data folders to the new workspace. The only AppSrc code that was copied was a .BP package. Nothing from the AppHtml folder was copied except a logo .PNG file.

At this point I created a new drill-down style Webapp which populated the AppHtml folder, created WebAppUser, WebAppSession & WebAppServerProps tables. I created zoom & Select views using the wizards. Everything was working as I expected until creating a new record I tabbed through a WebForm defined as DD_REQUIRED in the DD file and experienced the behavior described in my opening post.