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

  • BTB300
  • BTB300's Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 415
  • Thank you received: 132
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

  • BTB300
  • BTB300's Avatar
  • Away
  • Moderator
  • Moderator
  • Posts: 415
  • Thank you received: 132
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.120 seconds
  I still don't believe he can really be human to do all this ! From all of the forums that I've ever participated in this is certainly the one that most encapsulates the feeling of being truly open source where everyone's opinions and contributions can and will shape the development of the service! It's truly awesome! Hope you enjoy cooking and look forward to reading and contributing to any of the editorial work that you proposed too!! Thanks
Gez (audibleid - JED)

Get Started