TheCoder4eu / BootsFaces-OSP

BootsFaces - Open Source Project
Apache License 2.0
246 stars 102 forks source link

b:slider2 label example is not working and JSF markup is incorrect #977

Closed jepsar closed 6 years ago

jepsar commented 6 years ago

See https://showcase.bootsfaces.net/bootstrap/Slider2.jsf#labels

Validate button does not work and JSF markup is what you see on screen (it does not contain a slider).

stephanrauh commented 6 years ago

This is the AJAX response of the server:

<partial-response id="j_id1">
    <error>
        <error-name>class javax.validation.ValidationException</error-name>
        <error-message>
            <![CDATA[See your server log for more information]]>
        </error-message>
    </error>
</partial-response>
stephanrauh commented 6 years ago

It's a Hibernate class cast exception.

stephanrauh commented 6 years ago

This error has been caused by the bugfix of #956.

stephanrauh commented 6 years ago

@jepsar I've fixed the bugs (and several others I saw while I was at it). I've also tried to improve the demo. Please have a look at it. Maybe you have an idea to do it better. The input fields of most editable sliders truncate the numbers. I've fixed this by adding these attributes:

badge-span="2" badge-style="width: 2.7em;padding-right:5px;padding-left:5px"

Should we document that? Or should we generate this code by default? Is there a better way to make sure the numbers are displayed without wasting too much space?

jepsar commented 6 years ago

@stephanrauh I have the feeling that there are more bugs, like "You can use the span attribute to control the width, in terms of Bootstrap's grid columns". I don't see any difference there. I had to add some CSS hacks to get the slider to fit the with of its container.

I'll try to fix as much as possible in a PR (not sure when.. holiday is around the corner for me). If any larger issues arise, I'll create (a) new issue(s).

stephanrauh commented 6 years ago

@jepsar Enjoy your holidays!

span and badge-span influence the width of the slider and its badge (or input field). Come to think of it, I'm not convinced it's clever to use the Bootstrap column system for that. It's just something we've been doing from day one, but we might want to change that. The entire slider always fills all the space it can get (because it's in a <row>), and the badges and the input fields simply require a certain width. Making them wider or smaller only makes them look odd.

In any case, we don't have to specify the width for each size. col-xs-2 should do the trick, too.

@TheCoder4eu What's your opinion?

image

jepsar commented 6 years ago

@stephanrauh yeah, the badge is a different thing. My project requires me to have the current value in a large font, centered above the (horizontal) slider. I can achieve that using some CSS hacks, but I would have preferred to be able to use the onEvent JavaScript functions (https://github.com/seiyria/bootstrap-slider#events).

Also something I'm willing to look into (adding support for those events to the component). I think that's worth creating a new issue, right?