-
1. Re: Rich Calendar and Ajax support
ilya_shaikovsky Jun 3, 2009 6:14 AM (in response to aboocs01)a4j:support event="onchanged" actionListener="#{bean.actionYouNeedToPerform}"
:) -
2. Re: Rich Calendar and Ajax support
aboocs01 Jun 3, 2009 6:41 AM (in response to aboocs01)hi illa,
thank you very much -
3. Re: Rich Calendar and Ajax support
elf Jun 4, 2009 4:49 AM (in response to aboocs01)I have a problem with this. Only difference is I tried to do it programmatically. Event 'onchanged' fired only once when selected value is null. My code
HtmlCalendar orgCal = new HtmlCalendar(); orgCal.setPopup(false); orgCal.setValueExpression("value", eF.createValueExpression(eC, "#{bean.organizerDate}", Date.class)); orgCal.setMode("ajax"); HtmlAjaxSupport as = new HtmlAjaxSupport(); as.setEvent("onchanged"); as.addActionListener(new OrganizerValueChangeListener()); orgCal.getChildren().add(as);
I clicked on cells of calendar, ajax status said that request done, but listener called only first time. I tried to create ajax function and called it on onchanged event, tried to create ValueChangeListener and add it to orgCal object - but result is the same, event fired only once.
Please help me, what I am doing wrong ? -
4. Re: Rich Calendar and Ajax support
ilya_shaikovsky Jun 4, 2009 8:53 AM (in response to aboocs01)support should be added as a facet if added programmatically.
-
5. Re: Rich Calendar and Ajax support
elf Jun 4, 2009 9:28 AM (in response to aboocs01)Ilya, I added support object as facest under 'onchanged' key, but the result is the same. Only once event fired.
Is this key correct?
P.S. I have panelBar in sideBar, on one of the items of panelBar there is my calendar. -
6. Re: Rich Calendar and Ajax support
ilya_shaikovsky Jun 4, 2009 9:49 AM (in response to aboocs01)so.. requests risen but listener not called second time?
1) which scope your binding has?
2) if there are any messages in console?
3) add phasetracker in order to check lifecycle execution for second request. -
7. Re: Rich Calendar and Ajax support
elf Jun 4, 2009 10:05 AM (in response to aboocs01)1. session scope
2. in ajax log there is no errors or any suspicious messages
3. first time listener called in 5 phase, second time all 6 phases were executed
Should I check something else ? -
8. Re: Rich Calendar and Ajax support
ilya_shaikovsky Jun 4, 2009 11:28 AM (in response to aboocs01)1) binding should be request scoped. the reasons described many times at this forum. This is JSF related issue.
-
9. Re: Rich Calendar and Ajax support
elf Jun 4, 2009 11:47 AM (in response to aboocs01)Are we talking about this part of code
orgCal.setValueExpression("value", eF.createValueExpression(eC, "#{bean.organizerDate}", Date.class));
Or should I assign 'binding' value for object ? -
10. Re: Rich Calendar and Ajax support
ilya_shaikovsky Jun 5, 2009 6:17 AM (in response to aboocs01)your Object which contains this binding property should be request scoped.
-
11. Re: Rich Calendar and Ajax support
elf Jun 5, 2009 7:58 AM (in response to aboocs01)Ilya , I made my bean request scope, also I added code
orgCal.setValueExpression("binding", eF.createValueExpression(eC, "#{bean.bindingObj}", UICalendar.class));
but the result is the same.
What I am doing wrong ?
Did you try do run my code on your box ? It is simple non-popup calendar. -
12. Re: Rich Calendar and Ajax support
elf Jun 11, 2009 6:20 AM (in response to aboocs01)Looks like I found the problem.
I tried to add on my sideBar tree and it works not properly too.
So my creating of sideBar is wrong.
I did it in this way:
I created page in xhtml file. For creating sidebar I wrote<f:facet name="sidebar"> <h:outputText value=""/> </f:facet>
In action I found page component by ID and did asmypage.getFacets().put("sidebar", MY_SIDE_BAR);
As MY_SIDE_BAR I tried to use AjaxForm with Calendar or tree inside, OutputPanel with AjaxForm and Calendar or tree inside.
In all my cases everything inside sideBar in this way created works wrong.
Help me please, what is the right way to create sideBar for page programmatically ? What I am doing wrong ? -
13. Re: Rich Calendar and Ajax support
nbelaevski Jun 11, 2009 6:43 AM (in response to aboocs01)Whom does "sidebar" facet belong to?
-
14. Re: Rich Calendar and Ajax support
elf Jun 11, 2009 7:01 AM (in response to aboocs01)I found UIComponent of my <rich:page ... id="my_page_id"> by id.
"sidebar" facet belongs to this component.