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

TOPIC:

Access data 20 Jun 2017 12:26 #15221

  • dyvel
  • dyvel's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 200
  • Thank you received: 11
Hi

I've been away from component development for a long time. I have a few questions, as I'm trying to get my head around it.
I've created a Fly on an item view, where I have data from related tables. I have also added a custom button on the item view.

When clicking the button, I'm trying to access this related data, but not sure how.

$model = $this->getModel();
$item = $model->getItem();

Doesn't contain any of those related data.

Any help is greatly appreciated :-)

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

Access data 22 Jun 2017 21:55 #15227

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
did you write your custom code (custom task & redirection) in the right controller file ?
	/**
	* Method to custom an element.
	*
	* @access	public
	*
	* @return	void
	*/
	public function custom()
	{
		// TODO : Write your custom code here

		$model = $this->getModel();

		//Define the redirections
		switch($this->getLayout() .'.'. $this->getTask())
		{
		case 'extension.custom':
                // here you have to write the redirection (wich view?) in order to load the datas and display the layout ...
				$this->applyRedirection($result, array(
					'stay',
					'com_mycomponent.myview.default'
				), array(
					'cid[]' => null
				));
				break;

			default:
				$this->applyRedirection($result, array(
					'stay',
					'stay'
				));
				break;
		}
	}

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

Last edit: by liubov.
  • Page:
  • 1
Time to create page: 0.074 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