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

TOPIC:

problem with model and getFieldset 27 Dec 2012 04:22 #6287

I got this in a vew.html.php
I works OK, but I need to get from 52 and 52,53
I did it in a foreach but just brings the first (52) ...
$this->model	= $model	= $this->getModel();
		$this->state	= $state	= $this->get('State');
		$state->set('context', 'detalleoficio.adddetalleoficio');
		$state->set('detalleoficio.id', 52);
		$this->item		= $item		= $this->get('Item');
		$this->form		= $form		= $this->get('Form');
		 $fieldSet = $this->form->getFieldset('adddetalleoficio.form_1');
		 echo "<pre>**".print_r($fieldSet,true);

why I'm doing this?

Because I got a Edit form which needs to edit 3 records from a table.

Any Ideas or some pointing directions?

Thanks!

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

Last edit: by soportedo.

Re: problem with model and getFieldset 27 Dec 2012 07:10 #6288

a little confused here...
are you saying that there is 53 records in your database or are you saying that record 53 is a new record

-> foreach - can you post your foreach(...){ statement it might help to see what your trying to do
-> view.htmtl - are you working with a collection or item view

I know i had problems before with getFieldset from a collection view and did find that there was no definitions for collection view fieldsets infact there was no XML file in models/forms for collection layouts (obviously because no data entry required)

but i know all works fine in an item layout

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

Last edit: by BTB300.

Re: problem with model and getFieldset 27 Dec 2012 10:21 #6291

this is the view.html.php
foreach($this->permisos as $i => $permi){    // $this->permisos has 3 array items
			$this->state	= $this->get('State');
			$state->set('context', 'detalleoficio.adddetalleoficio');
			$state->set('detalleoficio.id', $permi->id_detalle_oficio); // <-- here is te id (52,54,56)
			$this->model	= $this->getModel();
			$this->form		= $this->get('Form');
			$fieldSet = $this->form->getFieldset('adddetalleoficio.form_1');
			// echo "<pre>**".print_r($fieldSet,true);die;
			$obj2 = array("fieldSet" => $fieldSet);
			$this->permisos[$i] = (object) array_merge((array)$this->permisos[$i], (array)$obj2);
		}

And in the view I'm trying to reproduce the
$fieldSet = $this->form->getFieldset('adddetalleoficio.form_1');
with the $this->permisos permisos array

the problem is that $this->form->getFieldset('adddetalleoficio.form_1'); is stucked in the first id (52)

is it more clear?
thanks

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

Re: problem with model and getFieldset 08 Jan 2013 19:54 #6376

Soportedo,
I didnt forget ;) i just have not been able to find an answer
The following user(s) said Thank You: soportedo

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

Re: problem with model and getFieldset 25 Jan 2013 11:30 #6505

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
When you want to show multiple items, use a collection MCV.
If you want to show multiple forms in the same page, this is more complex. I never achieved this.
Use ajax, or play with the groups (JForms).

Your stuff is not easy to solve.
Coding is now a piece of cake

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

  • Page:
  • 1
Time to create page: 0.060 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