Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

FK Combo Labels 10 Nov 2015 23:53 #13671

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
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

Please Log in or Create an account to join the conversation.

FK Combo Labels 16 Nov 2015 15:54 #13677

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
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

Please Log in or Create an account to join the conversation.

FK Combo Labels 16 Nov 2015 20:09 #13678

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

Please Log in or Create an account to join the conversation.

Last edit: by Romkabouter.

FK Combo Labels 16 Nov 2015 21:50 #13679

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
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

Please Log in or Create an account to join the conversation.

FK Combo Labels 17 Nov 2015 10:42 #13680

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

FK Combo Labels 17 Nov 2015 18:48 #13683

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Fixed.
Coding is now a piece of cake
The following user(s) said Thank You: MorganL

Please Log in or Create an account to join the conversation.

FK Combo Labels 02 Dec 2015 22:30 #13699

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
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

Please Log in or Create an account to join the conversation.

FK Combo Labels 03 Dec 2015 12:37 #13702

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

Last edit: by admin.

FK Combo Labels 03 Dec 2015 12:51 #13704

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
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

Please Log in or Create an account to join the conversation.

FK Combo Labels 03 Dec 2015 13:06 #13706

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.104 seconds

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started