VictoriaD
Apprentice

Can you put multiple data labels in a list view column?

Just wondering if anyone knows a trick to add multiple data labels in a list view column without using a single data label expression to combine them?

0 Kudos
Reply
8 Replies
AhmadAbdullah
Apprentice

Re: Can you put multiple data labels in a list view column?

Dear ,

 

i do believe that this is not possible to do in a list view , but to understand u more , wht is the scenario u r trying to achieve ?

 

cuz if u r tryin to retrieve 2 different data into 1 column that depends on some kind of an input parameter ,

then u could use 2 approches :

1- create 2 columns and try hide/show 1 of them depending on the input parameter ,

2-create sql stored procedure to handle this thing , i had similar thing handling retrieving data in arabic or english depending to the browser culture ,

if it was arabic then retrieve columns in arabic , if it was english then retrieve columns in english .

 

Hope it helps!

Regards.

0 Kudos
Reply
NathanBrown
Apprentice

Re: Can you put multiple data labels in a list view column?

It is a little "hacky" but you can create an expression that creates two span or div html tags.  If each has their own id's, it is possible using javascript code to manipulate them at runtime.  It is really a javascript solution, but I have used this with success to hide and show values when users click on columns.

0 Kudos
Reply
VictoriaD
Apprentice

Re: Can you put multiple data labels in a list view column?

My scenario is that I have two columns in my database that may contain the same data but in two different languages.  Both may not have data. I just want to show them both in one column, since there's no point to have two when many cells could be blank, and it would increase the length of the list view.

 

I like the show/hide column idea, but that would apply to the entire list whereas it would vary for each record.

 

I know I could accomplish it with a single control using an expression, but I'd just simply rather not. Plus, the expression would only work for read-only data but not editable data.  My data isn't editable, but the fact remains.  I was hoping somebody else may have run into this scenario and had a solution without code.

0 Kudos
Reply
NathanBrown
Apprentice

Re: Can you put multiple data labels in a list view column?

Language translation is a big problem for me also... we have users both in Europe and China, and showing things in navtive languages REALLY has helped us with adpotion.

 

For most list views we do as Ahmad suggest and use a store procedure when we have the data presented in mulitple columns in the DB.  Most of our SPs take a userid as a parameter, it is cumbersome, but we lookup the language value on most of our SPs that do this kind of display.

 

But, there is one more technique that we use...  we've created a custom control that accepts a "term id" as it's value and displays back the language translated string.  This is done on the server side so the it is transparent to the user.  At runtime, the control has access to both the actual user and the browsers culture so it can best decide how to react.   We use local (to the web server) resource files to hold all our language translated terms (really just string resources) so it really is pretty quick and is cached in memory properly.  This technique works really well for simple labels, but not so well with list views (I went through some big headaches to make my custom control render during list views).  Thus, not really a solution to your specific problem, but I'm grinding down K2 on the some enhancements to make this work in list views also.  This is a little difficult to bundle into a market solution because the resource files are specific for our needs, but I'd be happy to share the technique with you if you're intersted.

Reply
Nagorskiy
Apprentice

Re: Can you put multiple data labels in a list view column?

Nathan, it would be cool if you can share your technique
0 Kudos
Reply
VictoriaD
Apprentice

Re: Can you put multiple data labels in a list view column?

That's very cool Nathan, but I don't think it works for my requirement regardless.

 

It sounds more like you're talking about showing one or the other based on the user's language preference, is that correct?  In that scenario I think the show/hide column suggestion would work fine.  But that's not what I'm trying to accomplish.

 

I'm just going down the single control with expressions route for now but if anyone knows how to get two controls in a single list view column, please let me know.

0 Kudos
Reply
NathanBrown
Apprentice

Re: Can you put multiple data labels in a list view column?

Victoria, I reread your post several times and I think I FINALLY undestand your use case.   I agree I'm doing something different.  Sorry for projecting my problem on you :-)

 

All, I'm going to bundle my I18n controls into a market control project, just gotta find the time.

0 Kudos
Reply
VictoriaD
Apprentice

Re: Can you put multiple data labels in a list view column?

No need to apologize!  What you are describing is also a pain point for us. Being in Canada we struggle to make K2 workflows and SmartForms both English & French friendly, and I have also raised it to K2's staff at every opportunity. So I still enjoyed and got value from your explanation :)

0 Kudos
Reply