Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validated tooltip-position field if tooltip is used inside form. #348

Closed
jpiersanti opened this issue Apr 19, 2016 · 8 comments
Closed

validated tooltip-position field if tooltip is used inside form. #348

jpiersanti opened this issue Apr 19, 2016 · 8 comments
Assignees
Milestone

Comments

@jpiersanti
Copy link

jpiersanti commented Apr 19, 2016

Hi Guys,

I have observed that whenever I put a tooltip for a component inside a form, while using at the same time "b:messages" to display global validation message the b:messages display an error saying that "tooltip-position needs to be top, bottom, left or right".

If I add the attribute the message goes away, perhaps there should be a default value for the tooltip-position?

Regards,

@stephanrauh
Copy link
Collaborator

Both documentation and implementation indicate that the default already is "bottom". Can you send us a reproducer? And would you mind to tell us which version of BootsFaces you are using?

@stephanrauh stephanrauh added this to the v0.8.2 milestone Apr 19, 2016
@jpiersanti
Copy link
Author

Hello there,

I am using version 0.8.1. I will place here the reproducer by the end of the day.

Regards,

@zhedar
Copy link
Collaborator

zhedar commented Apr 20, 2016

This issue has since been fixed and should be absent in 0.8.2.
0.8.1 didn't had the default value setting, if position was null. (However I don't get how it could actually be null after generateTooltip).
0.8.2. introduced another null check in generateTooltipInternal, before the warning was printed.

@jpiersanti Are you able to test this with the 0.8.2 Snapshot?

Edit: I just realized, that there are two generateTooltip overloaded methods, the first leaving the tooltip possibly with a null value, the 2nd doesn't. I will probably include this in my refactoring in #347, duplicated code like this will always be error-prone.

@stephanrauh in the current code there is

if (null == position)
    position = "auto";

as default value. Would that produce the same result as bottom or should I remove it?

Edit2: Seems like auto puts the tooltip on top, not at the bottom. So maybe I should just remove that, if bottom is the documented default value. Otherwise auto feels more intuitive.

zhedar added a commit to zhedar/BootsFaces-OSP that referenced this issue Apr 20, 2016
@jpiersanti
Copy link
Author

jpiersanti commented Apr 20, 2016

Hi Guys,

Here is how to reproduce the issue:

`

xmlns:b="http://bootsfaces.net/ui"> <h:head><meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Titke</title> <meta name="author" content="The Author"></meta> </h:head> <h:body> <b:container> <h:form id="form1"> <b:panel title="test" look="primary" id="panel1" collapsible="false"> <b:row> <b:column col-md="12" tooltip="textTooltip"> <b:inputText rendered="true" required="true" type="number" /> </b:column> </b:row> <b:row> <b:column col-md="12"> <b:messages globalOnly="true" showSummary="false" showDetail="false"/> </b:column> </b:row> <b:row> <b:column> <b:column> <b:commandButton value="Accept" update="@form"></b:commandButton> </b:column> </b:column> </b:row> </b:panel> </h:form> </b:container> </h:body> </html>`

However I have found that if I put the row containing the mesages tag BEFORE the row of theinputText it also works fine (I need the message to be on top of the button, so I ended up putting the tooltip-position as well).

Hope this help. I will try with 0.8.2-SNAPSHOT and let you know if it still happens.

@jpiersanti
Copy link
Author

Hello again,

With 0.8.2-SNAPSHOT is working fine, there is no issue.

Regards,

@zhedar
Copy link
Collaborator

zhedar commented Apr 20, 2016

I couldn't reproduce this in my tooltip refactoring branch as well, so I guess I won't introduce a regression :)
Thanks for the snippet!

@jpiersanti
Copy link
Author

You are welcome ;-)

At least could you confirm that the snippet fails with the 0.8.1 version? Just in case I missed something,

Regards,

@zhedar
Copy link
Collaborator

zhedar commented Apr 20, 2016

Yes, I was able to reproduce it with 0.8.1, but it's definitely gone now.

@stephanrauh stephanrauh self-assigned this Apr 21, 2016
zhedar added a commit to zhedar/BootsFaces-OSP that referenced this issue Apr 22, 2016
zhedar added a commit to zhedar/BootsFaces-OSP that referenced this issue Apr 22, 2016
zhedar added a commit to zhedar/BootsFaces-OSP that referenced this issue Apr 25, 2016
zhedar added a commit to zhedar/BootsFaces-OSP that referenced this issue Apr 27, 2016
zhedar added a commit to zhedar/BootsFaces-OSP that referenced this issue Apr 28, 2016
zhedar added a commit to zhedar/BootsFaces-OSP that referenced this issue Apr 28, 2016
@zhedar zhedar mentioned this issue May 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants