steveh
Novice

Concatinate in List View with leading space

Trying to use an expression in a list view to perform a calculation on a field and add the units so I can display the value in a list view.  I'm using K2 blackpearl 4.6.11.

 

Example SmartObject:

Name (Text)

AgeInDays (Number)

 

Expression used in the list view

Concatenate ( Round ( AgeInDays / 365, 2 ) ,  years )

 

The text "years" has a leading space in the expression editor.  However, when I run the form, the space is eliminated.  

 

In the view it looks like this:  

24.73years  

instead of this:

24.73 years

 

Now on an item view, this works just fine.  The space is retained and displays correctly.  But in a list view, the space (though retained in the expressions) seems to get ignored and is not displayed.  I have tried using quotes (e.g. "[space]years") but the space is still stripped out (displays:  24.73"years").

 

Is there any way to get the space to display when introduced via an expression when on a list view?

 

No, I do not have the luxury of changing the SmartObject to be AgeInYears.

 

Thank you.

 
0 Kudos
Reply
6 Replies
AhmadAbdullah
Apprentice

Re: Concatinate in List View with leading space

Dear,

 

Please try adding   before the "year" , to be like  year ... inside the expression box .

it would probably solve your issue , since this is html entity , and k2 can render htmls.

 

Hope it helps!

Regards.

0 Kudos
Reply
steveh
Novice

Re: Concatinate in List View with leading space

Sorry for the delay.... just now got around to testing it.  Changing the space to   in the expression didn't help.

 

Concatenate ( Round ( AgeInDays / 365, 2 ) ,   years )

 

Still displays as:

24.73years  

instead of this:

24.73 years

 

 

Something about the list view doesn't seem to like spaces.

0 Kudos
Reply
Kran
Apprentice

Re: Concatinate in List View with leading space

Hi steveh,

 

Usally space works on both listview and  itemview in case if its not working one can use emptystring   function.

 

 below is sample which works with space and empty string function.  Hope this  will help you.

 

4702i72073F3E7780A382.jpg

 

 

 

 

 

0 Kudos
Reply
steveh
Novice

Re: Concatinate in List View with leading space

Interesting ideas... but are not working for me.  Let me show what I have...

 

Here's the SmartBox SmartObject data.

4707i4B94245BA883FAA2.jpg

 

Age is tied to an expression

4709i4592AD5D606792F2.jpg

 

Same results if I configure the rule with "Empty String"-space-years.

4712i31520D92B445FBE6.jpg

 

I appreciate the suggestions; unfortunately, I cannot get any of them to work.  (I have tried IE11, Chrome v35, Chrome v55, Firefox v30, and Firfox v47.0.2.)

 

0 Kudos
Reply
Kran
Apprentice

Re: Concatinate in List View with leading space

Hi Steveh,

 

I am not sure why space is not appearing in your expression as  providing a space before  or after text  works fine in all cases.

 

can you please try for html tag <span> with space

 

 <span>   </span>

 

4716i3AC33AA55A1B07A7.png

and while doing this keep Literal property as checked.

 

 

 

 

0 Kudos
Reply
AhmadAbdullah
Apprentice

Re: Concatinate in List View with leading space

Dear,

 

As Kran said, its true these ways should be working fine, im kinda confused that it has rendered the &nbsp and still no space yet, simply because it didnt show up as plain text which means that it has rendered it...

one more thing you might wanna try is accessing this form from another machine, maybe you have an issue regarding browser cache or any browser issue on your machine.

 

Regards,

A.Abdullah.

0 Kudos
Reply