Hi All,

I've some trouble working to integrate AdminLTE template onto my wicket application (wicket-bootstrap based). An AdminLTE SimpleThemeProvider has been implemented and configured successfully. Currently, I'm working to create a sidebar panel based on AdminLTE components: this component is created dynamically based on items retrieved via REST querying my server.

The AdminLTE sidebar is a side menu managed by specifying particular behaviours (defined by JQuery functions) for specific click events. This events are given by the AdminLTE.js javascript file itself included among page header items and executed at every page loading.

Till this point, everything works fine.
The problem occurs when I need to reload the sidebar panel ( via target.add(sidebar) ): in fact this operation seems to break each link between click events and behaviours previously defined on panel side bar components (via AdminLTE.js, as said before).

To fix the problem AdminLTE.js re-execution is required. I implemented this operation by providing a renderHead function into the side bar panel that I'm going to reload.

    @Override
    public void renderHead(final IHeaderResponse response) {
            super.renderHead(response);

final PackageTextTemplate ptt = new PackageTextTemplate(AdminLTE.class, "js/AdminLTE-app.min.js");
response.render(OnLoadHeaderItem.forScript(ptt.asString()));
    }

In this way some malfunctions have been introduced: it seems that at the first page loading the same event is attached twice. By including a boolean into the panel to check for the first loading, it seems that I solve the problem .... at least for the sidebar panel itself. Unfortunately, other components seem to be affected by this multi-execution.

What is the best-practice to manage this kind of scenario? Can someone help me with this issue?

Regards
Marco

--
Dott. Marco Di Sabatino Di Diodoro
Tel. +39 3939065570

Tirasa S.r.l.
Viale D'Annunzio 267 - 65127 Pescara
Tel +39 0859116307 / FAX +39 0859111173
http://www.tirasa.net

Apache Syncope PMC Member
http://people.apache.org/~mdisabatino/

Reply via email to