-
1. Re: selectBooleanCheckbox with a dataTable
pmuir Jul 8, 2006 2:30 PM (in response to trouby)Often when an action method seems not to be called it is because an error occured in the JSF lifecycle BEFORE the INVOKE_APPLICATION phase (which is when the action method is called).
Do you see in any errors (probably related to model update) in <h:messages />? -
2. Re: selectBooleanCheckbox with a dataTable
trouby Jul 10, 2006 1:09 PM (in response to trouby)Hey,
Nothing, no errors in <h:messages/>, nothing at the backend (server logs), but as I said, it's for sure related to the checkboxes, no clue what...
any way to debug such a situation? i'm clueless...
thanks for answering :)
Asaf. -
3. Re: selectBooleanCheckbox with a dataTable
gavin.king Jul 10, 2006 2:08 PM (in response to trouby)Check the Seam startup log, to make sure that all your components are actually getting installed.
-
4. Re: selectBooleanCheckbox with a dataTable
trouby Jul 10, 2006 2:16 PM (in response to trouby)Hey,
I dont think this is the problem,
the stateless bean is accessible ( I use a DataModel to display the dataTable where each of its rows is a checkbox ) and the methods are accessible, the problem -ONLY- occures when I use a 'selectBooleanCheckbox' where its value is an array! when the value is not an array the action is executed fine :-/
Thanks -
5. Re: selectBooleanCheckbox with a dataTable
gavin.king Jul 10, 2006 2:24 PM (in response to trouby)So then it sounds like a pure-jsf problem, nothing to do with Seam, right?
-
6. Re: selectBooleanCheckbox with a dataTable
trouby Jul 10, 2006 2:33 PM (in response to trouby)I'm not sure, but probably...
Is there any way to see if the Map i'm trying to set is really outjected?
Seems like JSF fails before the invoke-application phase if the property is not available...
This is the property in the Statless bean:@Out(scope=ScopeType.EVENT,required=false) Map<Account, Boolean> accountSelection;
This is the code within the DataTable where 'var=account'<h:selectBooleanCheckbox value="#{accountSelection[account]"/>
Thanks. -
7. Re: selectBooleanCheckbox with a dataTable
trouby Jul 12, 2006 11:46 AM (in response to trouby)Okay,
After spending some hours, I figured out that changing the following line in the facelets code:<h:selectBooleanCheckbox value="#{accountSelection[account]}"/>
to:<h:selectBooleanCheckbox value="#{userManager.accountSelection[account]}"/>
made things work, submitting the form really call the action within the 'commandButton' component.
I just wonder what's wrong, as I said, I declared the 'accountSelection' variable within the 'userManager' EJB3 as:@Out(required=false) private Map<Account, Boolean> accountSelection;
I didnt encapsulate it as seems like it's not required for Outjected vars,
So what's wrong? I'm almost sure the field is not outjected at all, this is the only difference between using the variable as outjected by SEAM and using it as a bean property.
How can I check if it's outjected at all? or maybe is it something else?
Thanks a lot,
Asaf. -
8. Re: selectBooleanCheckbox with a dataTable
pmuir Jul 12, 2006 11:55 AM (in response to trouby)Are you sure the accountSelection is not being outjected null? Do you have factory?
-
9. Re: selectBooleanCheckbox with a dataTable
trouby Jul 12, 2006 1:00 PM (in response to trouby)How can I know if it's outjected or not?
I dont have a factory, but on a previous function I call, I intiialize the Map to a HashMap....,
but two questions goes here:
1) How can I know what are the vlaues of the outjected vars? this is very important for debugging.
2) How can I know if the var is outjected as null?
Thanks -
10. Re: selectBooleanCheckbox with a dataTable
pmuir Jul 12, 2006 1:26 PM (in response to trouby)You said the bean is stateless up the thread. So that initialised value may well be lost (I think, I'm not 100% up at what stage in the lifecycle stateless beans are created/destroyed).
If the value is null it won't be outjected.
So,
1) Use the debugger (attached I think to the bijection interceptor)
2) Well if it is not null, you will see the Seam variable resolver find the context variable on the log. Or if you set required=true then Seam throw an exception if the value is null -
11. Re: selectBooleanCheckbox with a dataTable
trouby Jul 12, 2006 2:35 PM (in response to trouby)
Well, actually, if it's null then even calling it is a bean property would raise a null exception... so I assume the previous method which intiialize the Map to a Hashmap works....
More than that, is intiailizing the property while declaring it is for an outjected var? such as:@Out(required=false) private Map<Account, Boolean> accountSelection = new HashMap<Account,Boolean>();
If so, then it doesnt work as well, submitting the form stays on the same form, no error is set and nothing happens.
thanks.