TheCoder4eu / BootsFaces-OSP

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

dropMenu error message #860

Closed chongma closed 5 years ago

chongma commented 7 years ago

I recently had a problem where when the code below is run, and #{myBean.myClassList} gets a NPE (or other initialisation problem) the error message outputs inside <ul> tags and is not visible to the user. the user has to look through the page source to find out what the error was.

<b:dropMenu value="drop menu" active="true">
    <ui:repeat var="myClass" value="#{myBean.myClassList}">
        <b:navLink outcome="newPage?faces-redirect=true" value="#{myClass.name}">
            <f:param name="id" value="#{myClass.id}" />
        </b:navLink>
    </ui:repeat>
</b:dropMenu>
stephanrauh commented 7 years ago

Oops. BootsFaces shouldn't behave like that. But at first glance, I have no idea how to solve that. It's more like an HTML problem. Anybody got an idea?

chongma commented 6 years ago

could an EL error be caught before the drop menu is rendered ? shall i create a reproducer?

stephanrauh commented 6 years ago

Yes, a reproducer would be nice! As much as I hate to admit it, our spare time is limited, so we love to cut corners :).

stephanrauh commented 5 years ago

I've thought about the issue again.

It's not entirely impossible to improve the HTML code:

But: in your case the error occurs in a different component. That makes it difficult to predict which HTML code to render. More likely than not, you end up with an empty page.

I think it's better to accept the annoying nuisance. Trying to improve things might make it worse. Luckily the current approach works in most cases.

Is it OK to close the issue?