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

TOPIC:

Weird behaviour of Jmodel 29 Apr 2013 07:49 #7100

Hello,
here some weird behaviour I found. I don't know if it's my coding mistake, but I didn't make big changes on the jmodel.item / jmodel.list jcook classes. by the way....

component details:
- few tables and views with several ajax filters.
- some table has fields with the same name

scenario:
on an item form view, I have some ajax filters but the data is not retrieved correctly.

Bug:
the data is not retrived correctly because the STATE "filter.FIELDNAME" (the same used on both tables) remains persistent between different models. (I know it's weird)

quick and dirty workaround (before a definitive solution):
simply clear the STATE "filter.FIELDNAME" before to call $model->getItem() or $model->getItems()

example:
$model = JModel::getInstance('items', 'ComponentModel');

// I remove all the filters variables for this model
$filter_vars = $model->get('filter_vars');
foreach($filter_vars as $f_varName => $type){
	$model->setState('filter.'.$f_varName, null);
}

$items = $model->getItems();

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

Last edit: by Tomaselli.

Weird behaviour of Jmodel 11 Aug 2013 15:01 #10740

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
This is fixed since 2.5.
Closed ticket.
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.073 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