-
1. <rich:tabPanel> tabs validation
ilya_shaikovsky May 10, 2011 10:36 AM (in response to dabar23)seems tricky but possible actually. You just need to bind activeItem to some model property. Then in getter you could figure out if there are any messages in context and if so check inside which tab container the component which causes the messages lies. Then just change that current item name in model and return it. And if there are no messages just return the current active Item as usually.
In order to create something even more cool could try to find all the tabs with fallen validation and add header CSS class on backend to highlight tab in some way. But then on sucessfull validation need to remove it manually also.
If will have much problems trying to implement this - please update the thread and I will try to assist you more.
-
2. <rich:tabPanel> tabs validation
dabar23 May 10, 2011 11:56 AM (in response to ilya_shaikovsky)Ilya, thanks for fast reply.
Could you give me some guide or example, because I am relatively new to richFaces.
Maybe we can solve problem with other approach. Let's say I have 5 tabs in tabPanel, and all tabs have inputs and each input has some validation.
But only inputs on first tab are mandatory, so when I click on save button, I don't want to trigger validation on other tabs. I just want to trigger validation on current tab with mandatory inputs.Is that possible and how?
Thanks again for your time and replies.
-
3. <rich:tabPanel> tabs validation
ilya_shaikovsky May 10, 2011 5:04 PM (in response to dabar23)you could limit processing by using execute="somecontainerid".. It could be panel inside the tab which holds inputs. But if the same button should update the model with the values from other tabs - it should not be used. As execute limits tree processing at all the processing phases (decode/validation/update model).
But if you sure b.t.w. that all the inputs which has validations placed for example in the first tab - then the task getting pretty easier. Just use the same approach as I described above but in the activeItem getter return always first tab name in case facesContext contains messages.