-
Notifications
You must be signed in to change notification settings - Fork 89
select:MultipleSelect issue #308
Comments
Please see #223. |
thanks I have third part js module that require specific jquery version (jquery-1.10.2.min.js) In the other side I have select jquery. Is that the issue? If yes how you suggest to resolve that. Thanks a lot again Grigory. |
@Grishas Yes, that's the issue. If you have to import a specific version of jQuery (1.10.2), you must ensure that jQuery is not injected again. For the select wiget, we do not provide jQuery directly in the GWT module, so I think you have injected jQuery with another GWT module. Please just make sure you do not inherit a GWT module with jQuery included. |
thanks! |
ok ... and now I use jquery from bootstrap core module. but I got the same error...Any ideas? Note.The issue appear on on thirst load of view.After firts load its work :-) errors Caused by: com.google.gwt.user.client.ui.AttachDetachException: Exception caught: (TypeError) : $wnd.jQuery(...).selectpicker is not a function |
Its impossible to troubleshoot a problem I cannot see. Please fork the gwtbootstrap3-sample project and modify it so it exhibits your problem. |
Hi! I had the exact same problem. I solved adding references to css and javascript in my html page before the .nocache.js, like this:
In fact this is not clear. The documentation here is not clear regarding this. The only one thing that I know is that if I remove the references above in my html page, the app does not start. I can say that I added gwtboostrap3 and gwtboostrap3-extras as a jar file in the libraries references and not adding them as maven dependencies. Maybe is this the reason? I dont' know, anyway, adding those css and js in my html, now it works. |
thanks , |
Did you solve the problem? Please, if you investigate and find something, please keep me up to date on the topic. |
sure
|
@Magallo are you sure you are include Anyway, please ensure that the jQuery is injected ONLY ONCE (not 0, not > 1 time) and before bootstrap-select. It's not a select related issue. The problem is in your source code. |
@crevete yes, I have |
Not at all... These libraries should be injected dynamically by GWT |
@crevete I don't really understand how GWT could dynamically inject these libraries. Is this something related to maven dependencies that I don't use? As I said before, I added gwtbootstrap3 and gwtbootrap3-extras as normal .jar external libraries and not as maven dependencies. Could be this the reason I have to explicitly add .js and .css manually? |
I never tried that. When using maven, why do not add theses lib jars into maven dependencies. Any way, why you don't try it your self ? When loading your webapp, GWT loads all sub-modules. When loading |
This has nothing to do with the build process and it really doesn't matter how you add the jar to your build path. Each module you load has code that injects the corresponding javascript library when it is loaded. This mean that you shouldn't try and inject the css or js yourself in the html file, otherwise, you will get errors like the one you describe above. I personally do not like automatic injection because I feel like its too unpredictable. In every product I create, I always inherit from GwtBootstrap3NoTheme and for extras the NoResources modules. (eg: SelectNoResources). Then I take responsibility for making sure the jquery, bootstrap, select, etc....js and css get loaded before the corresponding modules are loaded. For simple projects, automatic injection is ok but for more complicated projects I feel likes its always better to do that part yourself. Anyway, if you need more specific troubleshooting, please do as @crevete suggests and fork the seed project, duplicate the problem, and I can look at it. Hope this helps, |
Oh @Magallo, Here is the code that injects the javascript for your reference: public class SelectEntryPoint implements EntryPoint {
@Override
public void onModuleLoad() {
ScriptInjector.fromUrl(GWT.getModuleBaseURL() + SelectClientBundle.SELECT_JS)
.setWindow(ScriptInjector.TOP_WINDOW).setRemoveTag(true).inject();
}
} |
it seems that first time during access select js its still not loaded. |
Please fork the seed project and create a test that shows the error. This way we can fix any problems. I will work on an example over the next few weeks. |
Hi all, I also experience this problem:
How can I check that I use or inject the wrong version of JQuery? Thanks, |
My workaround for this problem is using ScriptInjector to inject the correct JQuery: ScriptInjector.fromUrl("https://code.jquery.com/ui/1.11.4/jquery-ui.js")
.setCallback(new Callback<Void, Exception>() {
@Override
public void onFailure(Exception reason) {
logger.info("Script load failed Info: " + reason);
}
@Override
public void onSuccess(Void result) {
logger.info("JQuery for Select loaded successful!");
Select select = new Select();
Option option = new Option();
option.setText("Hallo");
select.add(option);
formGroup.add(select);
}
}).setRemoveTag(true).setWindow(ScriptInjector.TOP_WINDOW)
.inject(); |
Hello all, Im facing the same issue, as you can see in the next image I think after reading this comments that I have referenced twice the same library or some jquery in some inherit zone, but im not able to find out where... This is my main inheritance area
and the common package inheritance area
so @sjardine @crevete Im trying to find out where this extra jquery adition is failing. There is extra clue I have forgotten? Thanks in advance! Saúl |
@sauldeleon your gwt.xml looks good. When injecting @Grishas Just a question: when you said the first load, it does not work, but after that it works fine. In your HTML file, do you have some "static" jQuery/Bootstrap imports and/or some "static" select instantiation javascript code? Anyway, I guess this is a script loading order issue. |
Hello @crevete and thanks for your fast response! Here is an image of the loading files: I dont' see any jquey file to be loaded. but if i hit F5... the second time it works, and i Dont see any difference in the loaded files. Also I have not found any static import. Maybe the Thanks! |
@sauldeleon In your screenshot, I don't see jquery loading, is it loaded before ? Could you provide your HTML page (typically content of the |
Hello @crevete Sure, here it is:
Wow... this is wierd. I have generated a gif with a loading try, as you can see, it loads the select js, then the error is shown and then it dissapears :/ |
The easiest way to resolve this issue is to NOT use the automatic injection. Inherit the *NoResources modules and inject the javascript yourself. This way you control when the JS gets injected. |
Maybe the way we inject select JS changes the script loading order if you guys never had problems with other extra widget...
|
Could you please test this fix and give me a feedback ? thanks |
Do you mean downloading the last version of gwt boostrap3 and try again? or injecting the JS as @sjardine proposed? |
@sauldeleon Please use the last snapshot version (1.0-SNAPSHOT) with maven. |
@crevete OK, I have downloaded the last source code and I have built it with maven. Im going to check the fix a.s.a.p. Ill keep you posted |
@Grishas @Magallo @lofidewanto Could you please also test this fix with current SNAPSHOT version and give me a feedback? Thanks |
@sauldeleon @Grishas @Magallo @lofidewanto Any news? |
hello @crevete and sorry for my very late answer. In my particular case, I got the problem solved. It was not a Boostrap 3 extras problem. It was a poor knowdledge problem: I have some mapper condition added that was avoiding to load the modules correctly. Everything started to work correctly when I set the mappers OK. Now, it is working perfect ;) Thanks for all the help and feedback. P.S: I also tested the 1.0-SNAPSHOT with no issues after I corrected my buggy code |
@sauldeleon great news :-) FYI, the select has been upgraded to the last version 1.11.0 with support of some new options |
@crevete Thanks! but i have a question. Do I am able to use it throught the maven respository like this(in the pom.xml)? org.gwtbootstrap3 gwtbootstrap3-extras 1.11.0Or Do I have to set is a a external package? Thanks again! |
@sauldeleon You can try it (select v1.11.0) using maven, but 1.11.0 is the version of the select widget, but not the version of gwtbootstrap3-extra. You should use the current 1.0-SNAPSHOT version of gwtbootstrap3-extra. Please see the demo page: http://gwtbootstrap3.github.io/gwtbootstrap3-demo/snapshot/#select |
@crevete GREAT! thank you! There is some way to give more ideas for improve GWT Boostrap3 - Select? any ideas panel or similar? Because a I have one and I don't know if here is the correct place Regards! |
@sauldeleon please just create a new issue thanks |
@Grishas @Magallo @lofidewanto without your reply, I will close this issue. |
@crevete I would like to download the 1.0 SNAPSHOT version and test it. |
@attitherobot Why you don't use maven (as described in the project home page) to download the SNAPSHOT version ?
Anyway, you can download it here: |
@crevete I have not worked with maven. Using ant for my project and it works fine! |
@attitherobot You can use maven to wrap ant calls. I did try 5d5b3a1 I was having the same problem and this fixed it. |
I should note that I am using the theme:
|
What is the schedule for the release including this fix? We have had to modify our release builds to allow Snapshots along with manually adding it to our maven repositories just for this fix . This is less than ideal for a production environment. |
Does the SNAPSHOT build currently work for your case? This issue is seems to primarily be an injection issue. As I stated before I don't like the automatic injection features. I don't use them in a production environment. @crevete I will prepare a release. 0.9.4, I guess. Do you have any objections? |
@sjardine Thanks for the release! |
hello,
I try ti use select:MultipleSelect , but got error like
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) : $wnd.jQuery(...).selectpicker is not a function
please advice
<b:Row>
Caused by: com.google.gwt.user.client.ui.AttachDetachException: Exception caught: (TypeError) : $wnd.jQuery(...).selectpicker is not a function
at Unknown.fillInStackTrace_0_g$(Ctn-0.js@3:30942)
at Unknown.Throwable_3_g$(Ctn-0.js@8:30897)
at Unknown.Exception_3_g$(Ctn-0.js@18:31040)
at Unknown.RuntimeException_3_g$(Ctn-0.js@18:31081)
at Unknown.UmbrellaException_3_g$(Ctn-0.js@25:57870)
at Unknown.UmbrellaException_5_g$(Ctn-0.js@26:57931)
at Unknown.AttachDetachException_1_g$(Ctn-0.js@26:86724)
at Unknown.tryCommand_1_g$(Ctn-0.js@11:86780)
at Unknown.doAttachChildren_1_g$(Ctn-0.js@3:6219)
at Unknown.onAttach_0_g$(Ctn-0.js@8:6051)
at Unknown.execute_35_g$(Ctn-0.js@10:86808)
at Unknown.tryCommand_1_g$(Ctn-0.js@14:86764)
at Unknown.doAttachChildren_1_g$(Ctn-0.js@3:6219)
at Unknown.onAttach_0_g$(Ctn-0.js@8:6051)
at Unknown.execute_35_g$(Ctn-0.js@10:86808)
at Unknown.tryCommand_1_g$(Ctn-0.js@14:86764)
at Unknown.doAttachChildren_1_g$(Ctn-0.js@3:6219)
at Unknown.onAttach_0_g$(Ctn-0.js@8:6051)
at Unknown.execute_35_g$(Ctn-0.js@10:86808)
at Unknown.tryCommand_1_g$(Ctn-0.js@14:86764)
at Unknown.doAttachChildren_1_g$(Ctn-0.js@3:6219)
at Unknown.onAttach_0_g$(Ctn-0.js@8:6051)
at Unknown.onAttach_1_g$(Ctn-0.js@20:7239)
at Unknown.setParent_0_g$(Ctn-0.js@12:6147)
at Unknown.adopt_0_g$(Ctn-0.js@14:6206)
at Unknown.add_4_g$(Ctn-0.js@8:6264)
at Unknown.add_3_g$(Ctn-0.js@8:6257)
at Unknown.add_5_g$(Ctn-0.js@8:6384)
at Unknown.execute_6_g$(Ctn-0.js@38:11585)
at Unknown.$executeScheduled_0_g$(Ctn-0.js@40:34159)
at Unknown.runScheduledTasks_0_g$(Ctn-0.js@9:33881)
at Unknown.flushPostEventPumpCommands_0_g$(Ctn-0.js@5:33973)
at Unknown.execute_26_g$(Ctn-0.js@23:34112)
at Unknown.execute_25_g$(Ctn-0.js@19:33849)
at Unknown.apply_0_g$(Ctn-0.js@28:33344)
at Unknown.entry0_0_g$(Ctn-0.js@16:33400)
at Unknown.anonymous(Ctn-0.js@14:33380)
at Unknown.callback_0_g$(Ctn-0.js@46:33900)
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) : $wnd.jQuery(...).selectpicker is not a function
at Unknown.jQuery(Unknown@-1)
at Unknown.initialize_3_g$(Ctn-0.js@23:137166)
at Unknown.onLoad_12_g$(Ctn-0.js@8:137203)
at Unknown.onAttach_0_g$(Ctn-0.js@8:6052)
at Unknown.execute_35_g$(Ctn-0.js@10:86808)
at Unknown.tryCommand_1_g$(Ctn-0.js@14:86764)
at Unknown.doAttachChildren_1_g$(Ctn-0.js@3:6219)
at Unknown.onAttach_0_g$(Ctn-0.js@8:6051)
at Unknown.execute_35_g$(Ctn-0.js@10:86808)
at Unknown.tryCommand_1_g$(Ctn-0.js@14:86764)
at Unknown.doAttachChildren_1_g$(Ctn-0.js@3:6219)
my imports
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui"
xmlns:b="urn:import:org.gwtbootstrap3.client.ui"
xmlns:b.html="urn:import:org.gwtbootstrap3.client.ui.html"
xmlns:b.gwt="urn:import:org.gwtbootstrap3.client.ui.gwt"
xmlns:select="urn:import:org.gwtbootstrap3.extras.select.client.ui"
xmlns:b3="urn:import:org.gwtbootstrap3.extras.slider.client.ui"
xmlns:b4="urn:import:org.gwtbootstrap3.extras.toggleswitch.client.ui">
The text was updated successfully, but these errors were encountered: