Concatinate in List View with leading space

  • 22 December 2016
  • 6 replies
  • 6 views

Badge +4

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.

 

6 replies

Userlevel 3
Badge +8

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.

Badge +4

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.

Badge +9

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.

 

 

 

 

 

 

Badge +4

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

 

Here's the SmartBox SmartObject data.

 

Age is tied to an expression

 

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

 

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.)

 

Badge +9

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>

 

and while doing this keep Literal property as checked.

 

 

 

 

Userlevel 3
Badge +8

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.

Reply