on 09-09-2008 7:33 AM
Hi Experts,
I have a table. In that i want to change the date format.Presently i have the date format of mm/dd/yyyy.But i need the format of dd/mm/yyyy.I have more than one value in tha table..Help me pls.
thanks in advance
Reg
Kiruba.R
Hi raman,
Is your problem solved ? If still you are looking for help, please let me know if you are binding a value attribute to the date column in your table or using direct binding to the model attribute ?
If you are using a value attribute (whose data type is simple type with the required date format), you can use this code to fill the value node from the model node. Say your date attribute joindate is under the value node empdata -
// get the size of the model node from which you are filling the data...
int count = wdContext.nodeIt_ZEmpData().size();
for(int i=0;i<count;i++)
{
//Create an element for your value node.
IWDNodeElement elem = wdContext.nodeEmpDate.createElement();
//Read the date value from model node and assign to your value attribute
elem.setAttributeValue("JoinDate", wdContext.nodeIt_ZEmpData().getIt_ZEmpDataElementAt(i).getJoinDate());
}
Note : in setAttribute... method the first argument is the name of your value attribute (used for date) and the second argument is the date value read from the model attribute....
Regards
Ramesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prajakta,
I done that only. Am having the two columns.Start date ans end date.I have binded the value from backend.but my row count is four. All the rows displaying the first row values.
For ex.am getting like this
Start date End Date .......but i need it like this Start date End date
4/12/2007 3/7/2008 4/12/2007 3/7/2008
4/12/2007 3/7/2008 3/3/2004 2/3/2005
4/12/2007 3/7/2008 -
4/12/2007 3/7/2008
Please help me
regards
kiruba
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
this is happening because your backend values are over writing your context(to whom simple type is attched) which is assigned to date column.
Are you using a value node for displaying table?
if yes then when you copy your values from model node to value node. iterate model node and copy all the data values in your context os simple type.
just assigning it to a table will always over write values
hi prajakta,
Explain it clearly pls.I am not getting this.
Reg
Kiruba
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
I tried in simple data type..In my table more than one value is there. all the row value are displayed the same values,i.e the current selection values.
But the date from backend is different for each row.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Create simple type..Go to Representation tab.And In format give dd.MM.yyyy.
Assign this to column attribute's type.
Ragards
Prajakta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1)Create a dictionary type and bind this to the table column
2)specify the format as part of the type.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
if you want to take a date from the form and set into the table in dd/mm/yyyy.
do the following
take a value attribute of type string in table node.
and use the below code to set the date formate,
SimpleDateFormat formatDate = new SimpleDateFormat ("dd/mm/yyyy");
String stringDate = formatDate .format (wdContext.getDate());
and set the " stringDate " to table attribute.
Regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi kiruba,
Use the following code
SimpleDateFormat fSDateFormat = new SimpleDateFormat ("dd/mm/yyyy");
Date now = new Date ();
String date_out = fSDateFormat.format (now);
Regards,
P.Manivannan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.