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

TOPIC:

[HELP HOWTO] form for a specific record in V2 (1:1) 16 Nov 2012 20:07 #5432

I've been trying to understand this at this post: www.j-cook.pro/forum/9-coding-inside-you...or-a-specific-record

It refers to how easy it is in V2, but doesn't explain how to do it in V2. As this example talks about, I want to display an edit form for the user where it's primary key is equal to $user->id instead of the value specified in the menu item for the component.

How can this be done in V2?

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

Re: [HELP HOWTO] form for a specific record in V2 20 Nov 2012 21:43 #5521

Found the answer for my implementation:

In protected function displayLicenseemaintenance (where I'm loading the form), I did this. In my component, the table "license" will always have an id equal to the current user_id, so I adjusted the state as follows:
protected function displayLicenseemaintenance
...
$this->model	= $model	= $this->getModel();
$this->state	= $state	= $this->get('State');
$this->state->{'licensee.id'} = $user->id;
It doesn't strike me as the "right" way of doing it, but it works :unsure:
The following user(s) said Thank You: admin

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

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

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started