-
1. Re: Rich:Calendar how use it like rich:inplaceInput
julienc Mar 16, 2009 5:33 AM (in response to julienc)Maybe
With showInput="false" on rich:calendar
And some javascript it's possible but how can i put the value off the calendar in the inplaceInput ?
In richFace's doc there is :
setValue(newValue) Sets the current value (to be implemented) for inplaceinput.
I can get the value of the calendar with event.rich.date.value.
Have you got any idea to do that ?
thx -
2. Re: Rich:Calendar how use it like rich:inplaceInput
ilya_shaikovsky Mar 16, 2009 6:56 AM (in response to julienc)try to pass event.rich.component.getSelectedDateString(); to setNewValue method of inplace input.
show the latest code if will not works. -
3. Re: Rich:Calendar how use it like rich:inplaceInput
julienc Mar 16, 2009 7:12 AM (in response to julienc)Thx but how get in javascript the inplaceinput component , i'm on a datatable ?
i'don't know the id of inplace input. -
4. Re: Rich:Calendar how use it like rich:inplaceInput
ilya_shaikovsky Mar 16, 2009 7:19 AM (in response to julienc)ok.. show me the code you using.
-
5. Re: Rich:Calendar how use it like rich:inplaceInput
julienc Mar 16, 2009 7:25 AM (in response to julienc)<h:dataTable id="datatable_routes" rowClasses="firstrow,secondrow" columnClasses="string,string,string,string,string,string,string,string,string,action" styleClass="list" value="#{customerHome.routes}" var="route"> <h:column headerClass="title"> <f:facet name="header">Valid from</f:facet> <rich:inplaceInput inputWidth="200px" minInputWidth="200px" id="pouet" maxInputWidth="200px" editEvent="onclick" value="#{route.startDate}" selectOnEdit="true" defaultLabel="click to edit"> <f:convertDateTime timeZone="CET" pattern="dd/MM/yyyy HH:mm" type="both" /> <a4j:support event="onviewactivated" action="#{entityManager.flush}" /> </rich:inplaceInput> <rich:calendar value="#{route.startDate}" locale="FR-fr" mode="ajax" defaultTime="00:00" popup="true" showInput="true" datePattern="dd/MM/yyyy HH:mm" showApplyButton="false" cellWidth="24px" cellHeight="22px" style="width:200px" immediate="true" ondateselected="alert(document.getElementById('customer:datatable_routes:0:pouet'));"> </rich:calendar> </h:column> </h:dataTable>
I' like to hide the input of calendar to replace by the inputInplace. -
6. Re: Rich:Calendar how use it like rich:inplaceInput
julienc Mar 16, 2009 9:05 AM (in response to julienc)I forgot it's in a :
<h:form id="customer"> </h:form>
-
7. Re: Rich:Calendar how use it like rich:inplaceInput
ilya_shaikovsky Mar 16, 2009 10:12 AM (in response to julienc)<rich:column> <rich:inplaceInput value="" id="inplace" > </rich:inplaceInput> <rich:calendar showInput="false" onchanged="$('form:table:#{row}:inplace').component.setValue(event.rich.component.getSelectedDateString());"/> </rich:column>
works for me. -
8. Re: Rich:Calendar how use it like rich:inplaceInput
julienc Mar 16, 2009 10:34 AM (in response to julienc)Thx but what is #{row} for you ?
-
9. Re: Rich:Calendar how use it like rich:inplaceInput
ilya_shaikovsky Mar 16, 2009 11:14 AM (in response to julienc)sorry.. rowKeyVar="row" defined on the table.
-
10. Re: Rich:Calendar how use it like rich:inplaceInput
julienc Mar 16, 2009 11:26 AM (in response to julienc)no problems :)
Sweet it's work for the changing value but not to save it.
i try with :$('form:table:#{row}:inplace').component.save();
In javascript after$('form:table:#{row}:inplace').component.setValue(event.rich.component.getSelectedDateString())
nothing works any more after adding save() :( -
11. Re: Rich:Calendar how use it like rich:inplaceInput
julienc Mar 17, 2009 4:32 AM (in response to julienc)So
Now it works.
But i think there is a bug in your setValue() Method because the setValue method set the value of input with id = ....:inplacevalue and of the span with id = ...:inplace but no for the input with id = ...:inplacetempValue
and the method Save() save the value of the input with id ...:inplacetempValue .
I adddocument.getElementById('form:datatable:index:inplacetempValue').setValue(date);
And it's done :)
Thanks a lot. -
12. Re: Rich:Calendar how use it like rich:inplaceInput
ilya_shaikovsky Mar 17, 2009 6:50 AM (in response to julienc)I've tried this code.
<rich:inplaceInput id="myinput" value="#{userBean.name}"/> <h:outputText id="outtext" value="#{userBean.name}" /> <h:outputLink value="#" onclick="#{rich:component('myinput')}.setValue('new');">qwe</h:outputLink> <a4j:commandButton value="submit" reRender="outtext" />
And could not see the issue you mentioned. After entering something directly to inplace - and submit output with new value appears. And after changing the inplace value to new one with link and submit - again right value in output. -
13. Re: Rich:Calendar how use it like rich:inplaceInput
julienc Mar 17, 2009 7:31 AM (in response to julienc)With your code if you click on qwe you see "new" on the inplace input but if you click on the inplaceinput we will see null value (the tempvalue) i think a the moment we must see "new" too.
With firebug on firefox we can see that.
No all values are changed with the setValue().
maybe it's not a bug but it's strange and for me i must setValue on Two things. -
14. Re: Rich:Calendar how use it like rich:inplaceInput
ilya_shaikovsky Mar 17, 2009 7:56 AM (in response to julienc)no still can't confirm. After I click qwe and click the inplace I see new value in input. I'm using 3.3.1 snapshots.