Menu

#131 Callback to wrong page when using Moodalbox or Lightbox

open-wont-fix
None
5
2007-09-19
2007-09-16
CyberHawk
No

If you have a page with Anthem controls and they are loaded into a moodalbox or lightbox, the callbacks are sent to the page that opened the box, rather than to the page where the callback originated. Form is set to be the page that was loaded into the box. The rel attribute is also set, yet the callback still does not get executed by the correct page

Discussion

  • Andy Miller

    Andy Miller - 2007-09-18

    Logged In: YES
    user_id=1245761
    Originator: NO

    Please attach a sample page that demonstrates the problem. If possible, the page should load lightbox or moodalbox javascript from an existing server so that I do not need to install lightbox or moodalbox on my computer.

     
  • Andy Miller

    Andy Miller - 2007-09-18
    • assigned_to: nobody --> afm_44
     
  • CyberHawk

    CyberHawk - 2007-09-18

    Test process that includes the moodalbox

     
  • CyberHawk

    CyberHawk - 2007-09-18

    Logged In: YES
    user_id=1891639
    Originator: YES

    I have attached a test script that include the moodalbox. There is a link on the Default.aspx page which will load popup.aspx into the moodalbox. If you run the popup.aspx on its own, you will see that the callback works fine. Loaded in the modalbox, nothing happens.

    Thanks for looking into this issue :)
    File Added: moodalbox_test.zip

     
  • Andy Miller

    Andy Miller - 2007-09-18

    Logged In: YES
    user_id=1245761
    Originator: NO

    Moodalbox (and Lightbox I suspect) add the popup as a second form to the page. As you probably know, ASP.NET is pretty much designed from the ground up to have one form on each page. And Anthem.NET was written using the same assumption. So, for example, the callback URL is extracted from the first (and presumably only) form action property...which is why your event handler in PopUp.aspx is not called.

    If retrieving the correct callback URL was the only issue, this would be pretty easy to solve. But Anthem.js makes the assumption that there is only one form throughout the code. It is going to be very tedious to update the code in Anthem.js to handle multiple forms.

    I'll take a more careful look over the next few days to see if I can do it without breaking the existing code...but I can not promise anything.

    If you have already made the changes, or are willing to make the changes to Anthem.js, please let me know.

     
  • CyberHawk

    CyberHawk - 2007-09-18

    Logged In: YES
    user_id=1891639
    Originator: YES

    Thanks for taking a look at this. I'll have a look as well and see what I can come up with now I know whats causing the issue.

     
  • Andy Miller

    Andy Miller - 2007-09-19

    Logged In: YES
    user_id=1245761
    Originator: NO

    As I look at this problem, I see more an more code that must be changed, often in a way that makes it more complicated. To add support for multiple forms "the right way" would lead to some breaking changes.

    To work around the problem in your particular case, I think you can try this:

    1. Add an Anthem control to the main page (i.e. Default.aspx) to make sure the Anthem.js script is added to page.
    2. Give the form in Popup.aspx a unique form id (it should probably have a unique id anyway).
    3. Modify moodalbox.js so that when a popup is added to the page, it sets Anthem_FormID = the popup form id.
    4. Also modify moodalbox.js so that when the popup is closed, it resets Anthem_FormID = the original form id.

    I'll add a feature request to SourceForge to add multiple form support into Anthem so we don't forget.

     
  • Andy Miller

    Andy Miller - 2007-09-19
    • status: open --> open-wont-fix
     
  • CyberHawk

    CyberHawk - 2007-09-19

    Logged In: YES
    user_id=1891639
    Originator: YES

    I tried your suggestion and it works perfectly. Thanks again for taking the time to look into this issue :)

     
  • Nobody/Anonymous

    Logged In: NO

    dghdfghdf

     

Log in to post a comment.