Good day,
when I try to require the bootstrap/popover Module I become an error
in Firefox console:

[22:05:14.435] "RequireJS error: scripterror: Script error for:
bootstrap/popover
http://requirejs.org/docs/errors.html#scripterror, modules bootstrap/popover"

the tml file:
 <p><t:eventlink id="complete" event="complete" title="tooltip"
class="btn" data-content="Content">Complete&raquo;</t:eventlink></p>

the java call failed:
    void afterRender(){
        javaScriptSupport.require("test").invoke("PopOver").with("complete");
    }

this call works fine:
    void afterRender(){
        javaScriptSupport.require("test").invoke("ToolTip").with("complete");
    }

the wrapper for ToolTip and PopoOver test.js module:
(function() {
    define ("test", ["jquery", "t5/core/console", "require"] ,
function( $, console, require) {
        var ToolTip, PopOver, exports;

        ToolTip = function(elementId, params) {
            require(["bootstrap/tooltip"], function(){
                var element = $("#"+elementId);
                if (!element) {
                    console.error("Element "+elementId+" not found");
                    return;
                }
                    if (params)
                        element.tooltip(params);
                    else
                        element.tooltip();
            });
        };

        PopOver = function(elementId, params) {
            require(["bootstrap/popover"], function(){
                var element = $("#"+elementId);
                if (!element) {
                    console.error("Element "+elementId+" not found");
                    return;
                }
                if (params)
                    element.popover(params);
                else
                    element.popover('show');
            });
        }

        return exports = {
            ToolTip : ToolTip,
            PopOver: PopOver
        };
    });

}).call(this);

If the PopOver module is contributed manually in Appmodule all works
fine (the module name should be other name that popover!):
    @Contribute(ModuleManager.class)
    public static void setupBaseModules(MappedConfiguration<String,
Object> configuration,
                                        @Path("${" +
SymbolConstants.BOOTSTRAP_ROOT + "}/js/popover.js")
                                        Resource popover)
    {
        configuration.add("bootstrap/popovers", new
JavaScriptModuleConfiguration(popover).dependsOn("bootstrap/tooltip"));
     }

Is something wrong in my code or it is a Jira issue?

Thanks
Eugen

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to