Welcome, Guest
Username: Password: Remember me

TOPIC:

Re: Two information in a combobox 28 Nov 2012 13:35 #5677

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
You can now use {field_name}, instead of <%fieldname%>, much better ;-)

And can be done in XML.

FKeys or any other var can be used as well, since they are initializated in the object.
Coding is now a piece of cake

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

Re: Two information in a combobox 28 Nov 2012 13:37 #5678

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
In your grid, you are wrong.

Do not use 'dataKey', but 'labelKey'.
Totally different.

dataKey is used to catch the value,
labelKey, is for the final visualization parsing.
Coding is now a piece of cake

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

Re: Two information in a combobox 28 Nov 2012 13:50 #5680

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Hi @admin,

Thanks for the response but it's not working for me!

<%title%> (<%alias%>)

Just to clarify, is the only element that should be passed 'labelKey' => '<%title%> (<%alias%>)' or 'labelKey' => '{title} ({alias})' because, with the code
<?php echo JDom::_('html.fly', array(
	'dataKey' => '_finish_title',
	'dataObject' => $row,
	'labelKey' => '<%title%> (<%alias%>)',
	'link_title' => $row->_finish_title,
	'route' => array('view' => 'finish','layout' => 'finish','cid[]' => $row->finish)
));?>
It is not working.

Thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Two information in a combobox 28 Nov 2012 14:01 #5681

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Sorry. I made a mistake.

dataKey. Not labelKey.
In 'html.fly', use 'dataKey'


both <%%> and {} should work.
No ?
Coding is now a piece of cake

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

Re: Two information in a combobox 28 Nov 2012 14:03 #5682

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Neither worked, I was only getting a white page. I've rebuilt my component since you just did maintenance and am just about to retest it with new updated code.

Will let you know in a couple of mins...

Thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Two information in a combobox 28 Nov 2012 14:07 #5683

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
I could also manage it for link_title, but I should use another parameter name for compatibility with previous versions...

For the moment link_title is not using it.
Coding is now a piece of cake
The following user(s) said Thank You: JoomGuy

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

Re: Two information in a combobox 28 Nov 2012 14:18 #5684

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Hi @admin,

OK, got it working in grid but, cannot get it to work in the combobox itself when in a form.

Any advice?

Thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Two information in a combobox 28 Nov 2012 14:40 #5685

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
In combobox, use 'labelKey'.
It works in my hand.

Do you want to same feature for title ?
Coding is now a piece of cake
The following user(s) said Thank You: JoomGuy

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

Re: Two information in a combobox 28 Nov 2012 14:41 #5686

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Thanks @admin!

Got it working perfectly! Don't know what was happening but now it just works! :woohoo:
$field = $fieldSet['jform_section'];
$field->jdomOptions = array(
			'list' => $this->lists['fk']['section'],
			'labelKey' = '{title} {alias}'
		);
It's not working at all in the combo

Thanks,

G
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Last edit: by JoomGuy. Reason: Working all of a sudden!

Re: Two information in a combobox 28 Nov 2012 17:41 #5687

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Sorry to bother you again Jocelyn,

I just wondered how to handle adding additional related fields when using ajax combo and groupby? Could you please demonstrate?

Here's the jDom code for my Category field:
// Category
$field = $fieldSet['jform_category'];
$field->jdomOptions = array(
	'ajaxVars' => array('values' => array(
		$this->item->category))
);
many thanks,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Two information in a combobox 01 Dec 2012 10:02 #5696

This is great been trying to get two fields in the combo box for several days now and solved by reading this post :P

I can't get the grid to work This is the code with just a surname in
<?php echo JDom::_('html.fly', array(
												'dataKey' => '_race_officer_surname_surname',
                                                                                               	'dataObject' => $row
												));
				?>

Should I be using the following
<?php echo JDom::_('html.fly', array(
					'labelKey' => '{ _race_officer_forename_forename} { _race_officer_surname_surname}',
                                                                                               	'dataObject' => $row
												));
				?>

Or is it
<?php echo JDom::_('html.fly', array(
					'labelKey' => '{forename} {surname}',
                                     	'dataObject' => $row
												));
				?>

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

Re: Two information in a combobox 01 Dec 2012 18:09 #5701

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Hi there,

use dataKey instead of labelKey in your last example like;

<?php echo JDom::_('html.fly', array(
	'dataKey' => '{forename} {surname}',
        'dataObject' => $row
));
?>

Hope it helps!

Gez

PS I'm glad it wasn't only me baffled by this :blush:
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Two information in a combobox 01 Dec 2012 18:39 #5703

  • VeCrea
  • VeCrea's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
And there goes Michael Jackson singing "YOu are not alone... i am here with youuuuu" ;)

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

Re: Two information in a combobox 02 Dec 2012 06:07 #5706

Apologies for being dumb here, I am still new to cook book but still can't it to work in the grid.
Here is the code I am using
<?php           echo JDom::_('html.fly', array(
				'dataKey' => '{forename} {surname}',
				'dataObject' => $row
				));
				?>

The field in the grid just shows blank

Do I need to do anything else, somewhere else in the code?

I notice one of the earlier posts mentioned the XML forms, but the code that cookbook generated doesn't have any XML forms other than access config and the install file. I have tried building the project using different configurations but still no success.

Thanks for your help

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

Last edit: by dave1167.

Re: Two information in a combobox 02 Dec 2012 15:05 #5728

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Try on a fresh generated install. (Upgrade JDom), or use <% %>.

This is absolutly working for me.

html.fly => use 'dataKey'
html.form.input.select => use 'labelKey'
Coding is now a piece of cake

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

Time to create page: 0.103 seconds

Real time saver and great Component Builder tool ! I have been developing with J-Cook Pro Component Builder for several months now and can say with all honesty that this product/service is second to none. The product is feature rich and is being improved and added to all the time. Do yourself a favor if you need to build a Joomla! Component then you can do no wrong in trying the product. You will save on time and effort while being able to deliver your project on time. J-Cook pro does the hard work for you you then have the freedom to fully customise the end result for your own needs. 

One word: Awesome.
Edwardcox (JED)
         

Get Started