Code Monkey home page Code Monkey logo

Comments (8)

jDramaix avatar jDramaix commented on June 17, 2024

It's something I wanted to add before the first release but I forgot.

Try with the last snapshot : https://github.com/jDramaix/gwtchosen/raw/master/release/gwtchosen-1.0.3-snapshot.jar

ChosenOptions options = new ChosenOptions();
options.setResources(GWT.<MyResources>create(MyResources.class));
ChosenListBox box = new ChosenListBox(options);

from gwtchosen.

ivmarkov avatar ivmarkov commented on June 17, 2024

It is working just fine, thanks!
Minor glitch: all other setXXX() methods return ChosenOptions, i.e. "return this;" while ChosenOptions.setResources() returns void. Of course this is not a showstopper at all.

from gwtchosen.

jDramaix avatar jDramaix commented on June 17, 2024

you right. commit 2719745 correct that

from gwtchosen.

djgouze avatar djgouze commented on June 17, 2024

Hi!

I would also like to change to font size as ivmarkov wanted to but I am finding it difficult to understand the way of customizing the css which is presented in your comment jDramaix. I hope you can help me even though I know the last message was written 9 months ago ;)

I have written this:

ChosenOptions options = new ChosenOptions();
options.setResources(GWT. create(CustomChosenRecources.class));
marketSegmentListTest = new ChosenListBox(options);

and have created the CustomChosenResources like this:

import com.google.gwt.resources.client.DataResource; import com.watopi.chosen.client.resources.ChozenCss; import com.watopi.chosen.client.resources.Resources; public class CustomChosenRecources implements Resources{ @Override public ChozenCss css() { // TODO Auto-generated method stub System.out.println("Does this even show?"); return null; }
@Override
public DataResource chosenSprite() {
    // TODO Auto-generated method stub
    return null;
}

}

But the System printline is never printed and the program crashes with the following errors:
00:00:16,018 [DEBUG] Rebinding com.watopi.chosen.client.resources.CustomChosenRecources
00:00:16,018 [DEBUG] Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
00:00:16,018 [ERROR] com.watopi.chosen.client.resources.CustomChosenRecources is not an interface.
00:00:16,018 [ERROR] Deferred binding failed for com.watopi.chosen.client.resources.CustomChosenRecources'; expect subsequent failures

What am I doing wrong? And a following question: if I got it to work, where would I call for my own css?

from gwtchosen.

jDramaix avatar jDramaix commented on June 17, 2024

00:00:16,018 [ERROR] com.watopi.chosen.client.resources.CustomChosenRecources is not an interface.

Your Custom resource should be an interface. Check the gwt documentation : http://www.gwtproject.org/doc/latest/DevGuideClientBundle.html#ClientBundleExamples

from gwtchosen.

cplaetzinger avatar cplaetzinger commented on June 17, 2024

We use a regular CSS file to style our GWT application. Customers may define a custom CSS to apply some changes. Thus I would like to avoid to bundle any resources which can not be changed without building the code. So is there a way to override the CSS classes with an external CSS?

from gwtchosen.

jDramaix avatar jDramaix commented on June 17, 2024

Try to use the @external at-rule : http://www.gwtproject.org/doc/latest/DevGuideClientBundle.html#External_and_legacy_scopes

from gwtchosen.

cplaetzinger avatar cplaetzinger commented on June 17, 2024

Thanks, I tried it already and it works. I have implemented a custom resource class which uses a copy of the original chosen CSS file. Compared to the original version my CSS file has one additional line to avoid CSS class name obfuscation:

@external .chzn-*;

from gwtchosen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.