Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Joomla 2.5.6 Component Development
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  12 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
foysal foysal  
View profile  
 More options Aug 10 2012, 6:20 am
From: foysal foysal <now...@gmail.com>
Date: Fri, 10 Aug 2012 16:20:37 +0600
Local: Fri, Aug 10 2012 6:20 am
Subject: Joomla 2.5.6 Component Development

Can anyone say how the below button works??

JToolBarHelper::deleteList(JText::_('PERSONS_CONFIRM_DELETE'),'persons.dele te');

I mean how this button send delete request to database ??

Thanks

Foysal


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
JSamir  
View profile  
 More options Aug 10 2012, 6:26 am
From: JSamir <samirabul...@gmail.com>
Date: Fri, 10 Aug 2012 03:26:24 -0700 (PDT)
Local: Fri, Aug 10 2012 6:26 am
Subject: Re: Joomla 2.5.6 Component Development

As far as i know, there is some JavaScript attached to this button which
sets some hidden fields. Check it with firebug.

Am Freitag, 10. August 2012 12:20:37 UTC+2 schrieb nowphp:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
foysal foysal  
View profile  
 More options Aug 10 2012, 6:50 am
From: foysal foysal <now...@gmail.com>
Date: Fri, 10 Aug 2012 16:50:08 +0600
Local: Fri, Aug 10 2012 6:50 am
Subject: Re: [jgen] Re: Joomla 2.5.6 Component Development

I know that *delete* method of *persons* class do the job. But I would like
to know how this method get the id of the record ?? how the id pass to the
method ??

thanks

Foysal


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Herman Peeren  
View profile  
 More options Aug 10 2012, 7:11 am
From: Herman Peeren <herman.pee...@gmail.com>
Date: Fri, 10 Aug 2012 04:11:27 -0700 (PDT)
Local: Fri, Aug 10 2012 7:11 am
Subject: Re: [jgen] Re: Joomla 2.5.6 Component Development

The checked checkboxes in front of the items are put in a hidden variable
cid[ ]. This array contains the ids of the records.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
MOHAMED AKRAM  
View profile  
 More options Aug 10 2012, 7:19 am
From: MOHAMED AKRAM <mohamedakra...@gmail.com>
Date: Fri, 10 Aug 2012 16:49:36 +0530
Local: Fri, Aug 10 2012 7:19 am
Subject: Re: [jgen] Re: Joomla 2.5.6 Component Development

Hi, Foysal,
When you check the check boxes , and press the delete button, the task
hidden field of the form is set to person.delete, where delete method in
the person controller, there will be check box array is passed which name
is cid, this id can be taken from the delete function in the person
controller in the following way

$cid = JRequest::getVar('cid',array(),'','array');

now if you want to allow the user to delete multiple record then you can
loop through the ids ($cid) array and delete record one by one,

else if you want to allow only delete one record, you can get the id value
from the zero index of cid array
$id = $cid[0];

On Fri, Aug 10, 2012 at 4:41 PM, Herman Peeren <herman.pee...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
foysal foysal  
View profile  
 More options Aug 11 2012, 5:56 am
From: foysal foysal <now...@gmail.com>
Date: Sat, 11 Aug 2012 15:56:45 +0600
Local: Sat, Aug 11 2012 5:56 am
Subject: Re: [jgen] Re: Joomla 2.5.6 Component Development

My delete button is not working. What can be the problem ??

Thanks

Foysal

On Fri, Aug 10, 2012 at 5:19 PM, MOHAMED AKRAM <mohamedakra...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
foysal foysal  
View profile  
 More options Aug 12 2012, 2:54 am
From: foysal foysal <now...@gmail.com>
Date: Sun, 12 Aug 2012 12:54:38 +0600
Local: Sun, Aug 12 2012 2:54 am
Subject: Re: [jgen] Re: Joomla 2.5.6 Component Development

Hi all,

I am learning  joomla 2.5 mvc component developing . But my delete button
of admin panel is not working. What can be the cause ?? I searched a lot in
google but could not get any soultion. Can anyone say where is the problem
??

Thanks

Foysal

On Fri, Aug 10, 2012 at 5:19 PM, MOHAMED AKRAM <mohamedakra...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Herman Peeren  
View profile  
 More options Aug 12 2012, 3:10 am
From: Herman Peeren <herman.pee...@gmail.com>
Date: Sun, 12 Aug 2012 00:10:23 -0700 (PDT)
Local: Sun, Aug 12 2012 3:10 am
Subject: Re: [jgen] Re: Joomla 2.5.6 Component Development

Hi Foysal,

Could you be a bit more specific: what happens and what not, under which
circumstances? What have you done so far to test what happens? And maybe
some code would be helpful too.

For now it is not clear to me what the problem is. I assume you have a
MVC-component with a JTable and added a delete-button in the toolbar, but
when you push that button nothing happens (that is: is the page not
submitted at all? Or is it, but afterwards returns to the same page without
the deletes being done?

Are you using the code in this tutorial?
http://docs.joomla.org/Developing_a_Model-View-Controller_Component/2...

Greetings,
Herman


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
foysal foysal  
View profile  
 More options Aug 13 2012, 11:32 am
From: foysal foysal <now...@gmail.com>
Date: Mon, 13 Aug 2012 21:32:11 +0600
Local: Mon, Aug 13 2012 11:32 am
Subject: Re: [jgen] Re: Joomla 2.5.6 Component Development

Dear Herman,

Thanks for your valuable reply. I am new in joomla 2.5 component
development that's why it is little more problematic for me to be specific.

I visited your link and some other tutorials then I am trying to develop a
component using knowledge of those tutorials. But delete button of admin
panel is not working.That means when I push that button nothing happens.

*Where can I start my checking ?? *

I am pasting some code for you.

in controllers folder

paper.php

<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
class TestControllerPaper extends JControllerForm
{

}

papers.php

<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
class TestControllerPapers extends JControllerAdmin
{
    /**
    * Set default values when no action is specified (ie for cancel)
    */
    public function getModel($name = 'Papers',
           $prefix = 'TestModel', $config = array())
    {
        return parent::getModel($name, $prefix, $config);
    }

}

in model folder

papers.php

<?php
defined('_JEXEC') or die();
jimport( 'joomla.application.component.modeladmin' );
class TestModelPapers extends JModelAdmin
{
    public function getForm($data = array(), $loadData = true)
    {
    }

}

in tables folder

paper.php

<?php
// No direct access
defined('_JEXEC') or die('Restricted access');
class TablePaper extends JTable
{
    function __construct( &$db ) {
        parent::__construct('#__registry_persons', 'id', $db);
    }

}

here is my delete button code

JToolBarHelper::deleteList( JText::_(
'PAPERS_CONFIRM_DELETE'),'papers.delete');

some of my view code

default.php

<input type="hidden" name="task" value="" />

and

foreach($this->abc as $val)
        {
            $checked = JHTML::_('grid.id',$i++,$val->id);
            echo
'<tr><td>'.$checked.'</td><td>'.$val->id.'</td><td>'.$val->name.'</td><td>' .$val->surname.'</td></tr>';
        }

Thanks

Foysal

On Sun, Aug 12, 2012 at 1:10 PM, Herman Peeren <herman.pee...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Herman Peeren  
View profile  
 More options Aug 13 2012, 3:12 pm
From: Herman Peeren <herman.pee...@gmail.com>
Date: Mon, 13 Aug 2012 12:12:50 -0700 (PDT)
Local: Mon, Aug 13 2012 3:12 pm
Subject: Re: [jgen] Re: Joomla 2.5.6 Component Development

Thank you very much, Foysal. Unfortunately I don't immediately see an error
in the code you showed. So: or I overlooked it or it is somewhere else.
Your question is where to start your checking.
I'd take the following steps:

   - look at the *source code* of the page with the delete button; FireBug
   can be of great help. Are all necessary ingredients there?
   - the checkboxes with something like <input type="checkbox" id="cb0" name
   ="cid[]" value="3" onclick="Joomla.isChecked(this.checked);" and that
   value must be the id of your person
   - the javascript-libraries like mootools and <script src="
   /media/system/js/core.js<view-source:http://www.jug010.nl/media/system/js/core.js>"
   type="text/javascript"></script>
   - has the delete-button something like {Joomla.submitbutton('remove');}
   in the onclick attribute?
   - are there any *error-messages*? If something is wrong in Javascript,
   all further Javascript stops. You can find errors in Javascript in an Error
   Console of your browser (I use FireFox with all kinds of developer addons).
   You could also raise the error-reporting level of PHP to get PHP errors. In
   Joomla you can also put debugging on; then you can for instance see all
   db-queries.
   - and then the real *debugging*. In an IDE you could use XDebug, trace
   everything, set breakpoints etc., but that takes some time to get it in
   your fingers. But you can always do a simple "echo and die" debug to see if
   the program arrived somewhere and what the value of variables was at a
   particular point. Just echo values (or print_r for arrays or var_dump for
   whole objects). If a string is empty you won't see anything, so put
   something around that variable to see the spot where something should be
   printed. It can also be, that the program is redirected after your
   echo-statement; then you also would seen nothing. In that case: use die()
   to halt the program.

All 3 methods can be summarised as: looking "under water"; what is
happening under the hood? Sometimes it takes longer, sometimes shorter, but
you'll always find what is wrong. Debugging is an unseparable part of
programming.

I'm curious what went wrong. Please let us know.

Ciao,

Herman


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
foysal foysal  
View profile  
 More options Aug 15 2012, 5:12 am
From: foysal foysal <now...@gmail.com>
Date: Wed, 15 Aug 2012 15:12:44 +0600
Local: Wed, Aug 15 2012 5:12 am
Subject: Re: [jgen] Re: Joomla 2.5.6 Component Development

Thanks Herman, for your long valuable reply. I checked my code again and
again found that I didn't write a line that is "<input type="hidden"
name="boxchecked" value="0" />" .

But right now I am getting  following error

500 - An error has occurred.

View not found [name, type, prefix]: papers, html, testView

Return to Control Panel<http://localhost/new_joomla/administrator/index.php>

I think joomla is looking for  TestViewPapers.

*But why joomla looking for  TestViewPapers ??
*

*Where did I mention to look for TestViewPapers ??*

Thanks

Foysal

On Tue, Aug 14, 2012 at 1:12 AM, Herman Peeren <herman.pee...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Herman Peeren  
View profile  
 More options Aug 15 2012, 7:59 am
From: Herman Peeren <herman.pee...@gmail.com>
Date: Wed, 15 Aug 2012 04:59:52 -0700 (PDT)
Local: Wed, Aug 15 2012 7:59 am
Subject: Re: [jgen] Re: Joomla 2.5.6 Component Development

On Wednesday, 15 August 2012 11:12:44 UTC+2, nowphp wrote:
> View not found [name, type, prefix]: papers, html, testView

> I think joomla is looking for  TestViewPapers.
> *But why joomla looking for  TestViewPapers ??
> Where did I mention to look for TestViewPapers ??*

Allright, we are almost there!

You are completely right that Joomla! looks for a class TestViewPapers
here. You didn't have to mention it: it is looked for "automagically". This
style of programming is called "Convention over Code" (CoC): as long as you
follow the conventions, you don't have to write any code for it. If you
want another name for your view, you'll have to put that in the code (i.c.
with the controller's getView() method).

The advantage of CoC is that you have to write less code. The disadvantage
is that you have to know the conventions. In this case: that if you don't
specify the class name of the view, Joomla! will look for a class named *
[component_name]View[view_name]* in the file view.html.php in the folder
views/[view_name] of your component, where the view_name is the same as the
model_name and the controller_name if not specified otherwise. In this case
your component_name is "test" (without the com_) and your view_name is
"papers". Another convention is that all file-paths are small case, but
for  the class you use uppercase for the first character of the three
pieces (so: TestViewPapers and not testviewpapers. Which would often not be
a problem, for PHP is case sensitive, but not for class names. Still, you
better get used to it to avoid some hard to find bugs).

There are frameworks that use the CoC-principle more widely than the
Joomla!-platform. For instance Nooku Framework, which can be used besides
the Joomla!-platform to make extensions for Joomla!. It will give you a 40
- 80 % code reduction; but because you first have to learn some conventions
you also have a steeper learning curve (and you just experience the
steepness of Joomla!'s learning curve right now). We have a Dutch
football-player who is as well known for his way of saying things as for
the way he played and he used to say: "every advantage has it's
disadvantage" (or the other way around) and that is certainly true for
Convention over Code!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic