Issue in XPages

Hi,

I am facing the following issue with Xpages.

I have a column in the view which shows the Month of creation i.e,jan,feb,mar,etc.

I am using the following formula in the column

months := “Jan” : “Feb” : “Mar” : “Apr” : “May” : “Jun” : “Jul” : “Aug” : “Sep” : “Oct” : “Nov” : “Dec”;

month := @Subset(@Subset(months; @Month (@TextToTime(CreatedOn))); -1);

@Text(month)

Now i got a requirement where i have to show the month column in sorted order of calendar like jan,feb,mar etc.

I have added a hidden column before this view which returns a number for corresponding month and sorted based on this number.

months := “1” : “2” : “3” : “4” : “5” : “6” : “7” : “8” : “9” : “10” : “11” : “12”;

month := @Subset(@Subset(months; @Month (@TextToTime(CreatedOn))); -1);

@TextToNumber(month)

This works fine when i preview the view in client.

But when create an xpage and add a view control for this particular view, the sorting is happening correctly but instead of showing the months,i.e,jan,feb,etc, the number is getting displayed like 1.0,2.0,3.0,etc.

Can someone help me in solving this issue?

i am using notes 8.5.1

Regards,

Amit

Subject: Re: Number Display Issue in XPages

Is your column set to display as a Number in your XPage? If not, set it as Number and check the option for Integer only.

Subject: still the same

Hi Paul,

Thanks for the response.

The column which i am trying to show is a categorized column of type string (jan,feb,etc)

The hidden column added before this column returns a number. This is for sorting purpose.

I tried changing it to number type and checked the integer checkbox. But still the issue remains the same that is instead of showing the months as text it displays numbers.

Please suggest me how to solve this issue

Subject: Re: Months

Sorry, I misunderstood. It sounds like it’s picking the wrong column in your view control. Check the view control and also check against the computed name of each view column. I suspect that is what the XPage will be using to decide which column to show. For some reason it’s getting your month number column rather than your month name column.

Subject: Is this a bug

Hi Paul,

I have checked the view panel.

No modifications were done on the xpage view panel columns.

I feel this is a bug…

Please let me know if you have any workaround for this issue.

Regards,

Amit

Subject: A workaroung

I have had the same problem.A workaround is to concatenate the number with the month name in the first column and categorize by that column.

In the view control, in that first column, you have to set a custom converter (data properties) as the following:

getAsObjetc: #value

getAsString: #Middle(value,2,30)

That will convert ,for instance, the month 01January as January when the view is rendered

Hope it helps

Albert

Subject: Rectification

Sorry,instead getAsString: #Middle(value,2,30)

you must enter

getAsString: #@Middle(value,2,30)