Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] FK Combo Labels

FK Combo Labels 10 Nov 2015 23:53 #13671

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
I have done this many time, but now.. I just CANT get it to work and its doing my nut in

I am trying to make the labels in my related combo list contain a bit more info

Original
<field name="territories"
				alias="id"
				label="MYCOMPONENT_FIELD_TERRITORIES_AVAILABLE"
				filter="array"
				type="relation"
				multiple="true"
				labelKey="territory"/>

What I am trying
<field name="territories"
				alias="id"
				label="MYCOMPONENT_FIELD_TERRITORIES_AVAILABLE"
				filter="array"
				type="relation"
				multiple="true"
				labelKey="{region} - {territory}"/>

But the list comes up empty.. i have tried each value seperatly, and they work, I just need to pull in the joined label

I have tried many derivations including a reference I found that was '%region%' but everything I do comes up with an empty list

How can I alter the label in an FK (related) combo in 2.8 J-Cook?
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

FK Combo Labels 16 Nov 2015 15:54 #13677

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
Hi Admin

Any assistance on this hopefully easy task is greatly appreciated
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

FK Combo Labels 16 Nov 2015 20:09 #13678

  • Romkabouter
  • Romkabouter's Avatar
  • Offline
  • Elite Member
  • Posts: 310
  • Thank you received: 131
  • Karma: 48
Can't you create an extra field in your model named region_territory and use that as a labelKey?

in prepareQuery, add
$this->addSelect('CONCAT(a.region, ' - ' ,a.territory) as region_territory');

Can't tell you the exact place because I don't know your models
Last Edit: 16 Nov 2015 20:10 by Romkabouter.
The administrator has disabled public write access.

FK Combo Labels 16 Nov 2015 21:50 #13679

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
After the labels failed that is the first thing I tried, unfortunatly the combo items are from the new FK selector for XRef items.. (that generates the new AS _joint_ sql code.. and if I alter the basic model for regions.. the concat does not work

I will have another try as it HAS to be using that model somewhere along the way
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

FK Combo Labels 17 Nov 2015 10:42 #13680

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Sorry for late answer.

The relation field is not using JDom. So the {labelKey} feature is not anymore available.
Good remark.

Let's have a look. I can try to handle this feature in the field.
Coding is now a piece of cake
The administrator has disabled public write access.

FK Combo Labels 17 Nov 2015 18:48 #13683

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Fixed.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: MorganL

FK Combo Labels 02 Dec 2015 22:30 #13699

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
Sorry for the delayed response

Can you remember what you actually changed?

I installed the new JDOM plugin, but that does not seem to be it. I am not in a position to completely download the extension at the moment due to not replicating some changes I made on LIVE to the builder yet.
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

FK Combo Labels 03 Dec 2015 12:37 #13702

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Not in JDom...
that time, I didn't changed anything in JDom.
I simply added it in the regular 'relation' field.

When you uses a relation, the field is not using JDom, but a simple normal field.
That was the change on this topic.

Can I help you more ?
Are you dealing with relation field ? Or JDom one ?
Coding is now a piece of cake
Last Edit: 03 Dec 2015 12:37 by admin.
The administrator has disabled public write access.

FK Combo Labels 03 Dec 2015 12:51 #13704

  • MorganL
  • MorganL's Avatar
  • Offline
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
  • Karma: 15
I am trying to add the info into one of your new relation fields (N:N)

What code do I need to update in my component (I would prefer not to have to download the other JUST yet, though I will if necessary)

Though if you see my ticket, I am having problems with relations fields in sandbox.
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The administrator has disabled public write access.

FK Combo Labels 03 Dec 2015 13:06 #13706

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
models/fields/relation.php

and maybe
models/fields/model.php

Upgrade both because they are new fields, and I work a lot on them. So some changes in both for sure.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.068 seconds

Get Started