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.111 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started