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

  I found "cook" two days ago. Played around with it for a day and then within a day got rid of two legacy applications in IBM Lotus Domino Notes and replaced them with "cook". It was really easy. A piece of cake. Actually it was even easier than cooking. Cooking involves more work than developing with "cook". What can I say about "cook"? Great application great price for what it delivers great forum with a lot of information and fast responses active and friendly community fast forward moving development cycle So what should I say "Monsieur Le Cook"? Keep the good work going it will lead to success. Having become a paying member in the words of Edith Piaf may I say ..... non rien de rien ... je ne regrette rien. Vive La France.
FK (JED)
         

Get Started