voyent
selectInputDate ERROR, internal value is one day before displayed value  XML
Forum Index -> Woodstock to ICEfaces Migration
Author Message
AntonioJSG

Joined: 13/Nov/2007 00:00:00
Messages: 32
Offline


Hi,

My environment is
icefaces 1.8.0
Netbeans 6.5.1
GlassFish 2.1
RHE 5 x64

I have the following selectInputDate component:

<ice:selectInputDate binding="#{FacturasPorPagar.fechaInicialDf}" id="fechaInicialDf" renderAsPopup="true"
popupDateFormat="EEE d MMM,yyyy"
lang="es"
style="height: 212px; left: 88px; top: 52px; position: absolute; width: 190px"/>

I commandButton executes a read to this date and assigns the value to an ice:outputText

public String testFechaBt_action() {
this.textoTf.setValue( this.fechaInicialDf.getValue().toString());
return null;
}

The displayed text is like this one
"Thu Apr 16 18:00:00 CST 2009"

The problem is that the selected value in the date component is 17 like
"Fri 17 Apr,2009".

Also, the lang attribute does not work, as the month and day names do not show in Spanish.

Please advice, thank you

Antonio

AntonioJSG

Joined: 13/Nov/2007 00:00:00
Messages: 32
Offline


Hi,

I fixed adding a f:convertDateTime

* <ice:selectInputDate
* binding="#{FacturasPorPagar.fechaInicialDf}"
* id="fechaInicialDf"
* renderAsPopup="true"
* style="height: 212px; left: 88px; top: 52px; position: absolute;
* width: 190px">
* <f:convertDateTime/>
* </ice:selectInputDate>

now the date read is correct.
Diedas

Joined: 28/Apr/2009 00:00:00
Messages: 1
Offline


I had the same problem, but adding "<f:convertDateTime/>" did not solved it.
Later, I found out, that 1 day disappears because of time zone. When I added field in backing bean

private TimeZone laikoZona = TimeZone.getDefault();

and

<ice:selectInputDate
id="pagaminimoData"
required="true"
renderAsPopup="true"
value="#{gKontroleris.ivedimoForma.pagData}"
validator="#gKontroleris.ivedimoForma.tikrintiPagaminimoData}"
partialSubmit="true">
<f:convertDateTime
type="date"
timeZone="#{gKontroleris.ivedimoForma.laikoZona}"/>
</ice:selectInputDate>

in user interface file, the problem was solved.

AntonioJSG

Joined: 13/Nov/2007 00:00:00
Messages: 32
Offline



Thank you !!
anrnewton

Joined: 17/Feb/2010 00:00:00
Messages: 3
Offline


It works perfectly...!!!

If you have many ManageBeans you can add a parent Managebean with this property :

.....
private TimeZone generalTimeZone = TimeZone.getDefault();

Setters and Getters Methods.. too..!!
....

then child managebean inherit from parent ManageBean.

in jsp page add:
....
<ice:selectInputDate value="#{clientInfoBean.openDate}" renderAsPopup="true" partialSubmit="true" >

<f:convertDateTime type="date" timeZone="# {clientInfoBean.generalTimezone}"/>
</ice:selectInputDate>


Thank you very much..!!

ANR..!!
itscefet03

Joined: 17/Sep/2010 15:25:17
Messages: 4
Offline


The problem is Timezone, anrnewton's code work because in <f:convertDateTime> he puts timeZone attribute.
 
Forum Index -> Woodstock to ICEfaces Migration
Go to:   
Powered by JForum 2.1.7ice © JForum Team