Welcome, Guest
Username: Password: Remember me

TOPIC:

Re: Version 2 - Manipulating data upon save 07 Nov 2012 23:47 #5091

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100

admin wrote: So I don't know.
It is in your hands. You will find.
Dump is your friend ;-)

Table > store() is the last call before the physical write in DB.


Well, if you don't know, how could I...
looks like $city is empty at the time it looks for the country name. But it's saved in db, if i edit this item again, then it finds the $city and can find back the $country.

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

Re: Version 2 - Manipulating data upon save 07 Nov 2012 23:47 #5092

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Can't you filter by both...?

Do you mean a filter a grid or in a specific function?
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Version 2 - Manipulating data upon save 07 Nov 2012 23:48 #5093

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
You will be able to filter directly by country very soon, once I've finished to implement better filters on different levels.

A detail
In the model, you can write in save(), but it is not the best.

The function in the MODEL is : prepareTable() Where the wizard are written.
This is why it has been confused with prepareQuery()
Now I understand ;-)... I am very tired...
Coding is now a piece of cake

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

Last edit: by admin.

Re: Version 2 - Manipulating data upon save 07 Nov 2012 23:49 #5094

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
a grid.
No i can't filter on country as country is not saved

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

Re: Version 2 - Manipulating data upon save 07 Nov 2012 23:52 #5095

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100

admin wrote: You will be able to filter directly by country very soon, once I've finished to implement better filters on different levels.

A detail, I am very tired...
In the model, you can write in save(), but it is not the best.

The function in the MODEL is : prepareTable() Where the wizard are written.
This is why it has been confused with prepareQuery()
Now I understand ;-)


I use the "store" function in tables, not the prepareTable in model, which doens't even exist here, because i chose to put automatisms in Table

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

Re: Version 2 - Manipulating data upon save 07 Nov 2012 23:55 #5096

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Just to check if I'm understanding correctly...

I have tables: countries & counties (states)
Countries have a name
Counties have a name and a country

I also then have a clients table with a county field... When new records are created here, I filter the counties on Countries using ajax checkbox in the options. Also, in the grid combo filter, I do the same... So, I first select a country then a county. Works perfectly...

Is this what you mean?

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Version 2 - Manipulating data upon save 07 Nov 2012 23:56 #5097

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
It works, but it only saves the value of county. So i can't filter on country alone, i have to choose a county too, which is not what i want to do.

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

Re: Version 2 - Manipulating data upon save 08 Nov 2012 00:01 #5098

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Ahhhh, right, I get it...

Isn't there an option to submit after each group in the ajax filters? Sure, I understand that this would still produce a city combo in your case but, that doesn't matter does it?

I mean, in the first select, results would be filtered by country???

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Version 2 - Manipulating data upon save 08 Nov 2012 00:02 #5099

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
Last time i checked on this, it wasn't functional (three weeks ago if i remember ok)

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

Re: Version 2 - Manipulating data upon save 08 Nov 2012 00:03 #5100

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
I'm sure I had it working...

Hold on I'll check now
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Version 2 - Manipulating data upon save 08 Nov 2012 00:14 #5101

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
You're right, it doesn't work...

Theoretically speaking, this should be as easy as making sure that the right joins are in place to travers back up to your country. Practically speaking, I'm not sure how to do this as I've not dug into the code for the ajax combo.

That said, I think that this is something that would be better changed at the core of the combo code as opposed to in any of your component's classes.
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Version 2 - Manipulating data upon save 08 Nov 2012 00:18 #5102

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
Well, the thing is urgent so, even if it is not elegant, even if it's not the best solution, i would like to get back to my initial request : i want to be able to save the country in another field, but it doesn't work for some reason.

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

Re: Version 2 - Manipulating data upon save 08 Nov 2012 00:24 #5103

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
OK so,

When i CREATE the new item, it doesn't work. If i save the item, then i edit it, then i save it again, then it works and the country appears. Can't figure out why.


In the save function, shouldn't you target the city value with $data->city as opposed to $this?
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Re: Version 2 - Manipulating data upon save 08 Nov 2012 00:34 #5104

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
I use the store function in the tables folder.
using $data->city doesn't work

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

Re: Version 2 - Manipulating data upon save 08 Nov 2012 00:45 #5105

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
OK... Try this:

$maDB->setQuery ("SELECT c.id FROM #__xxx_countries as c WHERE c.id = $this->city");
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

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

Time to create page: 0.100 seconds

WOW.. WOW... WOW... This is awesome... in less than 3 hours of work I have my application done... this is simply the best tool I ever tried to generate Joomla Components... Thank you very much for this tool and your answer.. it helped me a lot... My friends here in Brazil are going nuts with this...
Griiettner (Forum)

Get Started