Re: Joomla 3.0: Component doesn't save, delete or edit correctly

514 views
Skip to first unread message

Lemings

unread,
Jan 19, 2013, 3:59:51 PM1/19/13
to joomla-de...@googlegroups.com
What class You are extending your controllers from?


sestdiena, 2013. gada 19. janvāris 12:51:09 UTC+2, Stefan Klokgieters rakstīja:
Hi everyone,
I am very new to Joomla (3.0) extension development so I am still learning. I am making my own component which has the purpose to show images with some additional information connected to categories.

The component installs correctly and displays everything correctly, the only problem(s) that I have are:

- In my first view the delete button doesn't work like it should. It performs my query but doesn't delete my item(s)
- In my second view where I can add and/ or edit my items none of my buttons work. After weeks of searching and comparing I still can't see what I am doing wrong. It is getting really annoying because I can't figure out what I am doing wrong.

I think that both my problems have the same cause but I'm not sure. So my question is that if somebody can help me. I really want to learn how to create my own basic component so every help is welcome. I would really appreciate it if someone would help me! In the link beneath is my .zip file.

I already tried several forums but nobody could seem to help me...

File: https://www.dropbox.com/s/jvcpnwtcuu84xmg/com_blankcomponent.zip


Yours sincerely,
Stefan

P.S. The name of my component is temporary

Stefan Klokgieters

unread,
Jan 19, 2013, 6:18:08 PM1/19/13
to joomla-de...@googlegroups.com
As you can see in my .zip my classes for the admin controllers are BlankComponentControllerBlankComponent and BlankComponentControllerBlankComponents

Op zaterdag 19 januari 2013 21:59:51 UTC+1 schreef Lemings het volgende:

Glenn Arkell

unread,
Jan 19, 2013, 10:21:00 PM1/19/13
to joomla-de...@googlegroups.com
Hi Stephan, I sympathise with your frustrations.  I too am in my early days of Joomla Development and having downloaded your component, I can see some issues, but alas nothing to easily point out what your problem is.  I'm guessing others who have more expertise would be able to identify.

Could I suggest registering at http://www.notwebdesign.com/joomla-component-creator/home and creating a simple component using this tool and then deconstruct it to see where your code varies.  Also compare it with the core components to see similarities.  This component creator tool has enabled me to learn quite a bit about the MVC structure and how to manipulate the code to do some extra things.  I have also seem some other similar component creators through this group and I'm impressed with ease at which they allow you to build a simple "outline" of a component.  Anyway, good luck with your learning journey.  Cheers.

Glenn

Stefan Klokgieters

unread,
Jan 20, 2013, 5:53:07 AM1/20/13
to joomla-de...@googlegroups.com
Hi Glenn, thankyou for your helpfull response! I will certainly have a look at the the Joomla component creator to compare the component with my own one. I have done this also the last two weeks with other downloaded J3.0 components but nothing so far. But i will defintily give it a try!

Just like you said it wont be to hard for more experienced developers, I dont think it's something that I did something very wrong but just a "incorrectly defined" statement of iets dergelijks.

So if any other developers would also have a look at my component that would be very nice.

In any case, thank you for your time and effort Glenn!

Stefan

Op zondag 20 januari 2013 04:21:00 UTC+1 schreef Glenn Arkell het volgende:

Allon Moritz

unread,
Jan 20, 2013, 7:10:24 AM1/20/13
to joomla-de...@googlegroups.com

Or copy the web links component and adjust it to your needs...

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/k1jhnC1MJ4QJ.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

Stefan Klokgieters

unread,
Jan 20, 2013, 7:18:51 AM1/20/13
to joomla-de...@googlegroups.com
That would be possible but then i still don't know what was wrong and i am not learning anything from it except copy pasting. No I would really like to know what is/ i did wrong. No to much to ask is it? :)

Op zondag 20 januari 2013 13:10:24 UTC+1 schreef laoneo het volgende:
To unsubscribe from this group, send email to joomla-dev-general+unsub...@googlegroups.com.

Lemings

unread,
Jan 20, 2013, 4:01:06 PM1/20/13
to joomla-de...@googlegroups.com
I wold suggest follow component flow and put print_r or var_dump and die statemets in code to see what is happening. Start with controller and continue with model.

Sergey Romanov

unread,
Jan 23, 2013, 2:25:12 AM1/23/13
to joomla-de...@googlegroups.com
1. form not saved. In you views/blankcomponent/submitform.js you have

Joomla.submitform(task);

but it should be

Joomla.submitform(task, document.getElementById('blankcomomponent-form'));

2. Cannot delete
in the constructor of the table you had to set _trackAssets to false because you do not yet use it and asset_id is 0 everywhere,

function __construct(&$db){
   parent::__construct('#__blankcomponent', 'id', $db);
   $this->_trackAssets = false;
}

Stefan Klokgieters

unread,
Jan 24, 2013, 4:45:33 PM1/24/13
to joomla-de...@googlegroups.com
Thank you very much for looking at my component! Right now I'm not in the possibility to try this out bu I will defintly try as soon as possible. You have me blessings!

Op woensdag 23 januari 2013 08:25:12 UTC+1 schreef Sergey Romanov het volgende:

elin

unread,
Feb 3, 2013, 9:20:39 PM2/3/13
to joomla-de...@googlegroups.com, s.klok...@hotmail.com
One thing to consider is that camel casing matters a lot in Joomla because it does all kinds of clever things by splitting up strings, so instead of BlankComponent try Blank or Blankcomponent. That will help a lot going forward too as we get autoloading in the CMS.
  Also put the s in the right place i.e. at the end.   It's really easier to get help if you don't ask people to download your extension but instead link to a github repository or pastebin etc. 

Elin
Reply all
Reply to author
Forward
0 new messages