Hi all Gnoga Users!

In a previous e-mail I wrote about the selectmenu using jquery ui. The issue 
with that piece of code that I sent is in the procedure:

procedure Make_Select_Menu
     (Element            : in out Gnoga.Gui.Element.Form.Selection_Type'Class;
      On_Changed_Handler : in     Base.Action_Event)
   is
      US : constant String := Element.Unique_ID'Img;

      Unique_Id : constant String := US (US'First + 1 .. US'Last);
      Mouse_Event_Script : constant String := "";
   begin
      Element.On_Change_Handler (On_Changed_Handler);
      Element.jQuery_Execute ("selectmenu({ change: function( e, data ){ 
ws.send (""" & Gnoga.Escape_Quotes (Unique_ID & "|change|") & """); } })");
   end Make_Select_Menu;

Notice the line "Element.On_Change_Handler (On_Changed_Handler);". It binds to 
the "change" event on the selectmenu.
This event is never fired, at least to my experience.
According to the documentation (http://api.jqueryui.com/selectmenu/) it is 
"selectmenuchange" event
that should be subscribed for if one wishes to receive notifications of when 
the user has changed a selection.
The unnecessary code that is being executed in the "Element.On_Change_Handler 
(On_Changed_Handler);" is the binding to the change event,
but the useful thing is setting up the event handler i.e. one would like to set 
up the event handler but not subscribe
to the "change" event. The implementation of Gnoga.Gui.Base.On_Change_Handler 
is in the package Gnoga.Gui.Base and it's implementation is hidden
because the code for plugin bindings is not in a child package. It is thus not 
possible to create a custom implementation that
only sets up the event handler but does not subscribe to the "change" event. 
Maybe one would like the Plugin bindings to be
a child package of the Gnoga.Gui.Base package? Of course that is not the 
perfect solution neither in this case since
the selectmenu (jquery ui version) has a new event called "selectmenuchange", 
and one would like to create a specific
eventhandler for this event. Anyways, the issue of selectmenu raises questions 
about the architecture of the Gnoga framework,
the sense of "Has this been thought about?", if no "What do we need to do about 
it?", if yes "What is the standard solution for this contingency?".

Best regards,
Joakim Strandberg
------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Gnoga-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gnoga-list

Reply via email to