0
Welcome Guest! Login
0 items Join Now

Component loads into wrong position...

  • Component loads into wrong position...

    Posted 13 years 2 months ago
    • If this is in the wrong forum please let me know and I will move it.

      I have a very, very simple component. It is really just a simple web form. The problem is that when I submit the form, the component loads into the wrong location when the form updates. This is pretty easy to demonstrate.

      www.mistrhanky.com/public2.5/index.php is the site. You can login as guest/guest. Then under the 'game' menu is a single option, 'Buddy Tracker'. This is the form I am referring too. You will notice that when you first go to the page, the form is displayed on the left with a single 'Stats' module on the right(sidebar-a position). If you submit the form, it then re-displays to the right of the Stats module. I also noticed that it seems to assign to the home tab and not the game tab in the menu. There is only one instance of the stats module and it is located in the same place everytime, so I feel certain that the component location is the issue. I also don't understand why it seems to move to the home menu tab and not stay on 'game'. I do pass the option, itemid, and even the view(though I am really not using MVC anywhere). I dump a print_r at the top so the form vals are easily seen.

      I feel pretty certain that is an obvious problem, but I can't figure it out. Any help would be appreciated.

      Joomla 2.5(freshly installed)
      PHP 5.3.8
      MYSQL 5.1.5.2
  • Re: Component loads into wrong position...

    Posted 13 years 2 months ago
    • Disregard.

      Issue appears to be related to using a post form method. When I provided option and itemid in the post, it would just relocate me to the default home menu tab. When I changed the form to explicitly point to the full url ... such as

      option=com_content&view=article&id=25&Itemid=201

      it worked. So, I can deal with that.
    • Adamck's Avatar
    • Adamck
    • Elite Rocketeer
    • Posts: 546
    • Thanks: 2
    • Web Developer, IT Assistant, Graphics design, App Developer

    Re: Component loads into wrong position...

    Posted 13 years 2 months ago
    • usually you have to have a hidden form field with name 'Itemid' and the value '201' at the end of the form and it will post correctly.

      example
      <input type="hidden" name="option" value="com_content">
      <input type="hidden" name="view" value="article">
      <input type="hidden" name="id" value="25">
      <input type="hidden" name="Itemid" value="201">
    • Kiss my RSS
  • Re: Component loads into wrong position...

    Posted 13 years 2 months ago
    • That was the funny thing. I did have that. That is my normal method. However, it was not taking it for some odd reason. Only when I moved it up into the form action field did it "see" it. In fact, that is
      why I posted... because I didn't even think to try moving it from the hidden field. Then on a whim I did and it worked.

Time to create page: 0.057 seconds