1. Oscar Naranjo
  2. PowerServer 2020 or older (Obsolete)
  3. Wednesday, 22 January 2020 20:52 PM UTC

Hi everyone, 

We have an MLE that have a custom event ue_paste that ID=pbm_paste that has been working for many years in client-server. When we run it on the web it does not fire the ue_paste event.     

We build our web application in Powerbuilder 2017 R3 1880, and we are running on Windows 10. 

Best Regards,

Oscar Naranjo

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 23 January 2020 02:06 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 1

Good catch Zhao Kai!

I missed the fact that Oscar associated the event id to pbm_paste. You are 100% correct for that not being supported in PS.  My framework has a ue_paste event and this has worked for decades with PB and since 2008, PowerServer. The key was that I use a non-mapped event plus a GetObject() command to implement a paste() on any object class.

Comment
There are no comments made yet.
Kai Zhao @Appeon Accepted Answer Pending Moderation
  1. Thursday, 23 January 2020 01:23 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 2

Hi Oscar,

 

PowerServer does not support this event id, please refer to article below for detail about support event id.

https://docs.appeon.com/appeon_online_help/ps2019/features_help_for_appeon_web/ch09s02.html

 

Regards,

Zhaokai

Comment
  1. Miguel Leeuwe
  2. Thursday, 23 January 2020 01:31 AM UTC
Aha, yes that brings back vague memories. So Oscar, you'll have to code some key event / mouse up / down events I guess.
  1. Helpful
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 23 January 2020 00:59 AM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 3

Hi,

Maybe the reason your event is not being triggered is because nothing has been successfully copied onto the clipboard?

Have you tried copying something from for example "notepad" and than past that into the mle?

Can you add a button somewhere and see what the clipboard() function returns?

Try using ::clipboard(ls_value) to put some text on the clipboard, instead of clipboard(ls_value). The "::" makes use of the system clipboard instead of powerbuilder's clipboard, if I remember well.

Just in case ...

Comment
There are no comments made yet.
Oscar Naranjo Accepted Answer Pending Moderation
  1. Wednesday, 22 January 2020 21:46 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 4

Hi Chris,

 

Again thank you for supporting us, 

 

1) How does the "ue_paste" get fired ... from what object?
 
    In an MLE focused --> mouse right-click --> menu open --> click in Paste option. Or Ctrl + V in the MLE.   
    Note: it is firing in client-server.   

2) Have tried your web app in a few different web browsers

   I tried on Internet Explorer and Chrome. Even I used the debugger to see what is fired. 

3) How does your code handle the paste operation?

   We have no code to paste the text. Windows handles that and it pastes the text but does not fire the event.  

4) Is the "ue_paste" event POSTed or TRIGGERed?

   Triggered! I think.

Best Regards,

Oscar Naranjo

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 22 January 2020 21:04 PM UTC
  2. PowerServer 2020 or older (Obsolete)
  3. # 5

Hi Oscar;

  Can you tell us ...

1) How does the the "ue_paste" get fired ... from what object?

2) Have tried your web app in a few different web browsers

   Note that the IE plug-in is not the sane as the Edge, FF, Opera or Chrome browser pplug-in

3) How does your code handle the paste operation?

4) Is the "ue_paste" event POSTed or TRIGGERed?

   What does the code look like for this?

Regards ... Chris

Comment
  1. Chris Pollach @Appeon
  2. Thursday, 23 January 2020 19:55 PM UTC
Hi Oscar;

My UE is actually called "oe_paste" and its fired from either a main menu (Edit => Paste) or a CTRL+V as assigned also through the menu.



Base Ancestor Menu Code ...

ParentWindow.Post Event Dynamic oe_paste ( ) // Send PASTE Msg!



Base Ancestor Window code ...

GraphicObject lo_go // Object Pointer!

lo_go = GetFocus () // Get Current Object

IF IsValid ( lo_go) THEN // Instantiated OK?

lo_go.Post Dynamic event oe_Paste ( ) // YES=>Send PASTE Msg 2 control!

END IF



Base Ancestor Control (for example a DW Control) ...

THIS.Paste () // Paste from Clipboard!



Note1: If a control type does not support a PASTE() command. Use - THIS.Text = Clipboard()

Note2: The above works in PB Native, PS Web and PS Mobile Apps!

Note3: Any Pop-up Menu(s) also fire the "oe_paste" on the control that instantiated them. Then the local control's implementation takes over immediately.

Note4: CTRL+V always works based on the above design no matter what. ;-).



HTH

Regards ... Chris
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.