0

Create a tab with onCustom method in java

asked 2022-11-16 23:50:47 +0800

softteam gravatar image softteam
130 1 8

Hi,

I got this tab in a zul file and it works correctly:

<tab id="TabActividadesGenerales" label="Actividades generales" value="0" selected="true"  w:use="zul.tab.TabExt" onCustom="@command('seleccionarTabActividad',evento=event.getTarget())"/>

In this same zul file I got this script:

<script defer="false" type="text/javascript">
        zk.afterLoad("zul.tab", function () {  
            zul.tab.TabExt = zk.$extends(zul.tab.Tab,{
                doClick_: function() {
                    this.fire("onCustom", null, {toServer:true}); 
                } 
             }); 
        });
    </script>

How can I create this same tab in a java file?

I tried something like this but it is not working:

private Tab crearTabActividades (String valor, String label) {
        final Tab tab = new Tab();
        tab.setValue(valor);
        tab.setLabel(label);
        tab.setWidgetAttribute("w:use", "zul.tab.TabExt");
        tab.setWidgetOverride("onClick", "function() { this.fire(\"onCustom\", null, {toServer:true});}");

        tab.setParent(TabsActividades);

        return tab;
    }

Thank you, Javier

delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2022-11-16 23:50:47 +0800

Seen: 2 times

Last updated: Nov 16 '22

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More