Results 1 to 10 of 10

Thread: Selection popup

Threaded View

<< Previous Post   Next Post >>
  1. #3
    Join Date
    Sep 2011
    Location
    Minneapolis, MN
    Posts
    114

    Default Re: Selection popup

    Thank you very much for this. With this, I got it working in no time.

    I have another anomaly with sizing the dialog. Maybe a bug but I am not sure if I am doing something wrong.

    When adding another column to the grid inside the dialog the WebApp Designer shows the change properly but when compiling and running it, the dialog appears as a small square box in the top left of the browser.
    You can't click either close or the confirm button. See pictures for visuals.
    Click image for larger version. 

Name:	2017-11-14 14_48_31-WebApp Designer [SelectionListDialog.wo].png 
Views:	10 
Size:	7.5 KB 
ID:	11468Click image for larger version. 

Name:	2017-11-14 14_48_46-Tempus Field.png 
Views:	8 
Size:	9.1 KB 
ID:	11467

    I have added my source code below to share and reference for aboves issue.

    SelectionDialog.wo
    Code:
    Object oSelectionListDialog is a cWebModalDialog
        Set psCaption to "Select Item from list"
        Set pbResizable to True
        Set piMinHeight to 300
        Set piMinWidth to 300
    
    
        {WebProperty=True}
        Property tListItem[] paListItems
        {WebProperty=True}
        Property Integer piSelectionIdno
        
        // send reply on Esc or "x" as submit, which will send the callback on a cancel
        Set pbServerOnEscape to True
        Procedure OnEscape
            Forward Send OnEscape
        End_Procedure
        
        Set pbServerOnShow to True
        Procedure OnShow
            Send GridRefresh of oSelectionItems
            Forward Send OnShow
        End_Procedure
    
        Object oMainPanel is a cWebPanel
            Set peRegion to prCenter
            
            Set pbFillHeight to True
            Set piHeight to 200
    
            Object oSelectionItems is a cWebList
                Set pbDataAware to False
                Set pbShowHeader to False
                Set piHeight to 120
                Set pbFillHeight to True
    
                Procedure OnManualLoadData tWebRow[] ByRef aTheRows String  ByRef sCurrentRowID
                    Integer i iItemCount
                    tListItem[] aListItem
                    WebGet paListItems of oSelectionListDialog to aListItem
                    Forward Send OnManualLoadData (&aTheRows) (&sCurrentRowID)
                    
                    Move (SizeOfArray(aListItem)-1) to iItemCount
                    For i from 0 to iItemCount
                        Move aListItem[i].iUniqueRecIdno to aTheRows[i].sRowID
                        Move aListItem[i].sDescription to aTheRows[i].aCells[0].sValue
    
                    Loop
                    Move 0 to sCurrentRowID
                End_Procedure
    
                Procedure OnLoad
                    Forward Send OnLoad
                    Send GridRefresh
                End_Procedure
                
                Procedure OnShow
                    Forward Send OnShow
                End_Procedure
    
                Object oDiscriptionWebColumn is a cWebColumn
                    Set psCaption to "Description"
                    Set piWidth to 50
                    Set pbFillHeight to True
                End_Object
    
                Object oDetailWebColumn is a cWebColumn
                    Set psCaption to "Detail"
                    Set pbNewLine to True
                    Set piWidth to 100
                    Set psCSSClass to "RowCaption"
                End_Object
                
            End_Object
                    
        End_Object
        
        Object oButtonPanel is a cWebPanel
            Set peRegion to prBottom
            Set piColumnCount to 4
            
            Object oConfirmBtn is a cWebButton
                Set pbShowLabel to False
                Set psCaption to "Confirm"
                Set piColumnSpan to 4
                
                Procedure OnClick
                    Send Ok
                End_Procedure
            End_Object
            
        End_Object
        
        Set pbServerOnSubmit to True
        Procedure OnSubmit
            Send Ok
        End_Procedure
        
        Procedure Ok
            Integer iSelectionIdno
            WebGet psCurrentRowID of oSelectionItems to iSelectionIdno
            WebSet piSelectionIdno of oSelectionListDialog to iSelectionIdno
            Forward Send Ok
        End_Procedure
        
        Procedure InitializeSelectionListDialog String sTitle Integer iWidth Integer iHeight tListItem[] aListItems
            String sSelected
            Move 0 to sSelected        
            WebSet piWidth of oSelectionListDialog to iWidth
            WebSet piHeight of oSelectionListDialog to iHeight
            WebSet paListItems of oSelectionListDialog to aListItems
            WebSet psCaption of oSelectionListDialog to sTitle
        End_Procedure
        
        Procedure GetSelectedItem Integer ByRef iSelectionIdno Boolean ByRef bCancel
            WebGet piSelectionIdno of oSelectionListDialog to iSelectionIdno
            WebGet pbCanceled to bCancel
        End_Procedure
    
    End_Object
    Call from webview:
    Code:
    //ToDo: Build and pop up selection list to client.
    Send InitializeSelectionListDialog of oSelectionListDialog "Select Attachment ..." 300 400 aAttachmentArray
    Send Popup of oSelectionListDialog Self
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	2017-11-14 14_48_31-WebApp Designer [SelectionListDialog.wo].png 
Views:	6 
Size:	8.1 KB 
ID:	11466  

Posting Permissions

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