Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Can smartGWT Visual Builder Call Pre-defined Client-Side Methods?

    We are considering using Visual Builder to allow our clients to extend and modify our application built using smartGWT. We understand that a Visual Builder OEM license would be required. If we create a client-side static method, say public static void publishClientSideMessage(String message), is it possible for a user to tie this method to an IButton using Visual Builder, passing an arbitrary string message? In other words, can we use the IButton click event exposed in visual builder to call pre-existing client-side methods? 

    #2
    Yes - you can define new in Component Schema, so you can declare your method as an Action and it will appear in the list of targets during Event -> Action binding.

    As far as an "arbitrary string" - what will happen by default is that Visual Builder will try to derive a string value from the available information from whatever Event the user binds to your action. For example, if you used some FormItem event, the FormItem's current value would be used.

    If you instead wanted to do something like open a dialog to get input from the user, an appropriate override point exists for this, but is not yet documented. Any kind of small gap like this can be addressed as part of purchasing a Visual Builder OEM license, or as part of a pilot project.

    Having said all this - the above applies to a custom SmartClient component, whereas with SmartGWT there will be additional steps to set up reflection capabilities so that your custom Java method can be discovered at runtime.

    If you are serious about creating dynamically extensible and/or modifiable applications, you should carefully consider using SmartClient as your main technology rather than SmartGWT. Everything is ultimately doable with SmartGWT as well, but the compile-time oriented nature of GWT tends to make it more complex, error prone and expensive when tackling dynamically modifiable/extensible applications.

    Comment

    Working...
    X