-
Notifications
You must be signed in to change notification settings - Fork 102
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
Attribute disabled, readonly, contentDisabled, rendered dynamically set fails. #908
Comments
I don't know if it's got anything to do with your bug, but the update attributes have a space between the dot and the CSS class name. This might work with jQuery, but it doesn't work with the AJAX engine of BootsFaces because space is already the standard separator between multiple ids. |
Hi, thanks; it's a typo. I edited my post, it doesn't affect the bug report. |
THX! Can you provide us some of the bean code, such as the converter? You know, it's always a bit tiresome to reverse-engineer beans matching the bug description. |
Done! |
OK, now I haven't got any excuse left to start working :). |
I've added converter Map population method code. |
I can't see the full code so I don't know exactly what it does but you are using actionlistener instead of action? |
I apologizing for giving you the information in chapters. I've updated my post. In both cases, I'm using actionListeners since both scenarios operate inside their respective |
You should still use an action. But just return null from the function. Action listeners are for preparing other things before executing an action |
@chongma I never thought about this, but like @modima65, I always use an |
@modima65 You don't have to apologize - I know how difficult and annoying it is to simplify one's application and to remove every company specific code from it without removing the bug, too. I'll try to reproduce your bug tomorrow or Saturday. In the meantime, I'm interested in the AJAX response to the AJAX request activating the command button. Are you familiar with your browser's developer tools? If so, open them (F12 or CTRL-CMD-I on a Mac), inspect the AJAX request in the network tab and send me the AJAX request. Thanks in advance! |
Well, in case 1, I'm using the listener to prepare the selectItems Map collection to show data updated on panelGrid below. |
@modima65 Thanks for the kind words! I'm sure we'll solve the bug. Although I'm a bit puzzled - looking at our source codes, I just don't get it. Case 2 might be a problem with the AJAX response, but case 1 beats me. I just hope that doesn't mean a lengthy debugging session... (But then - aren't these debugging sessions the real fun?) :) |
https://stackoverflow.com/questions/3909267/differences-between-action-and-actionlistener this answer explains that listeners trigger before the action which is where the business logic should be. It is not necessary to navigate from an action. Just return null |
Is there a sample application on GitHub that reproduces this problem? I am interested to take a look |
example backing bean:
example xhtml:
|
Hi @chongma ! Thank you for your time. As I commented in my last intervention, I use |
Sorry, I don't know what I saw in your post, I edited mine completely. Question: where do you send cartaporte to be used in bean? How do you prepare a Map for |
It seems to me redundant, given that I can use actionListener in a line to do what you did with three attributes and three lines. However, I give it a try and if it works, well, that's the way to go. Thank you!!!! |
|
Ok. I understand. You obliterate Thank you again for your time. I'll be back soon with my results. |
also i removed the
|
@chongma What are you currently doing? Your post read like you've managed to reproduce the bug. Have you? |
@stephanrauh no i am just copying the code and changing it to the way that i would approach the problem. i am not really sure what the problem is. but i was unsure that |
@modima65 I've been trying to reproduce case 1, but I haven't been successful yet. Would you mind to have a look at our showcase and to examine the page http://127.0.0.1:8080/BootsFacesWeb/issues/issue908.jsf? The showcase is a simple Maven project, so it should run without further ado. You only have to correct the dependency on BootsFaces in the pom.xml, which already points to the developer SNAPSHOT of BootsFaces 1.2.1. Can you spot any difference to your project? Apart from being more simple, of course :). |
Hi. As I commented in my first post: I had to get rid of almost all conditional Now, one thing I haven't been able to make work correctly yet, after all this modifications, is the line commented in the code fragments below and this STILL has to do with Bean
XHTML
At first modal load, |
@stephanrauh I've downloaded showcase to my desktop. I'll do some tests. Thank you. |
¿Hay algo nuevo de tus pruebas? ¿Has encontrado alguna diferencia entra nuestro showcase y tu aplicación? |
Reluctantly, I'll close the issue now because I don't know how to reproduce the bug. |
When an input component like
b:selectOneMenu
,b:commandButton
and others is dynamically hidden, blurred or not rendered at first page load by setting attributes likedisabled
,readonly
,rendered
,contentDisabled
beforehand, the component doesn't show the value that matches one of collection items.Case 1:
XHTML
ENTITY
BEAN SELECTITEMS MAP POPULATION METHOD
SIMPLE CONVERTER
In this requirement, the component value
#{cartaportesController.selectedCartaporte.flete}
MUST match one of theseletedItems
in collection, but it fails to do so becausereadonly
attribute avoids it in some manner. If we change fromb:selectOneMenu
to JSFh:selectOneMenu
or remove thereadonly
attribute, the value matches fine. The converter plays important part, so I think the menu component doesn't apply the converter when this component is setreadonly
beforehand.Case 2:
XHTML
BEAN LISTENERS
In this scenario,
b:commandButton
Agregar was set to disabled beforehand. User then update paramdisabledToggle
to enableb:commandButton
, so as to let him/her apply changes in modal, however the listener is never called because the disabled attribute kept component from registering the listener (I suppose), so it is already spoiled and won't work, even once enabled. Now, if we change fromb:commandButton
to JSFh:commandButton
or remove thedisabled
attribute the listener works fine.In short, my project was plagued with this bug since I use consistently
disabled
,readonly
,rendered
and the brand new BootsFacescontentDisabled
attributes. Sadly, I had to rearrange and redesign my pages once I noticed this behavior.Thanks.
The text was updated successfully, but these errors were encountered: