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

  I want to save the world...... let's cook a solution about it.
VeCrea (Forum)

Get Started