CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [FIXED] Panel Hide-Show Problem

Print topic Send  topic

Author Message
maxhugen

Posts: 272
Posted: 04/28/2008, 11:10 PM

In my index page, I have a login form (in the left hand sidebar), plus custom menu items.

I've placed the Login form inside of 'Panel_Login', and the menu items inside Panel_Menu. The idea is that if you're logged in you see the menu items, otherwise you see the Login.

As per the Help docs, I've added the following code to function Panel_Login_BeforeShow:
    if (CCGetUserID()){    
        $Component->Visible = False;    
    }else{    
        $Component->Visible = True;    
    }  
  
    // Let's see what's returned  
    global $UID;  
    $UID = CCGetUserID();  
    echo "CCGetUserID: " . $UID;

I have similar code in Panel_Menu_BeforeShow (true/false are reversed).

However, it's not working - both panels show before and after Login. The Login certainly works, as I have checked the session variables, and other secured pages redirect me to the index page if not logged in.

Also, I don't get any output from the echo statement - this often doesn't seem to work in events!!!

Anyone have some thoughts on what the issue is?
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
ckroon

Posts: 869
Posted: 04/29/2008, 9:03 AM

Had this EXACT same problem.
Lucky for you.. Walter saved me.

if (!CCGetUserID()){
$Component->Visible = True;
}else{
$Component->Visible = False;
}

The damned >> !


_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
maxhugen

Posts: 272
Posted: 04/29/2008, 3:46 PM

Thanks, I'd found your post previously when I searched the forum, but unfortunately, it makes no difference. Both panels display regardless. :-/

Walter's code is just checking for NOT logged in, mine checks for IS logged in.
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
ckroon

Posts: 869
Posted: 04/29/2008, 5:23 PM

This wouldn't be ccs4.. and you have a hide show/panel within a hide/show panel would it?

IF it is.. the second hide/show won't work.

_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
maxhugen

Posts: 272
Posted: 04/29/2008, 5:37 PM

Yep, it's CCS4, but no, the panels aren't nested.

The HTML structure is basically:
<table>  
    <!-- BEGIN Panel Panel_Login -->  
        <tr><td>  
        <!-- BEGIN Record Login -->  
            ... the Login form ...  
        <!-- END Record Login -->  
        </td></tr>  
    <!-- END Panel Panel_Login -->  
  
    <!-- BEGIN Panel Panel_Menu -->  
        <tr><td><a href....></a></td></tr>  
        <tr><td><a href....></a></td></tr>  
        <tr><td><a href....></a></td></tr>  
        ....  
    <!-- END Panel Panel_Menu -->  
</table>

Pretty simple... or so I would have thought!
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
maxhugen

Posts: 272
Posted: 04/29/2008, 7:23 PM

Looks like its off to YesSoftware Support again, they must be getting sick of me.

I seem to be having recurrent problems with php events. I'm starting to wonder if CCS v4.00.00.04 events are buggy?

Support has already had to send me two separate patches for other bugs I've come across.
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
ckroon

Posts: 869
Posted: 04/29/2008, 11:32 PM

I am wondering when the rest of us will get he patches...
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
maxhugen

Posts: 272
Posted: 04/29/2008, 11:53 PM

Yeah, and I wonder how many patches have been sent out to others???

Wish they had a more 'Bazaar' approach than 'Cathedral'.
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
maxhugen

Posts: 272
Posted: 04/29/2008, 11:59 PM

Oh, in case any forum readers haven't seen this famous essay, see http://en.wikipedia.org/wiki/The_cathedral_and_the_bazaar

There's an External Link at the bottom of the article to the original essay. ;-)
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message
maxhugen

Posts: 272
Posted: 04/30/2008, 4:00 AM

After logging a Support request, I stumbled across the answer to this.

I had previously added custom code to the Login button's OnClick event, in order to store an additional Session variable. This worked AOK.

Later, after adding the panel, I added custom code to the Panel BeforeShow event. The php code generator placed the function inside function Login_Button_DoLogin_OnClick.

Specifically, it was added in Login_Button_DoLogin_OnClick after the line:

    //Close Login_Button_DoLogin_OnClick @8-0EB5DCFE

... and before the lines:

    return $Login_Button_DoLogin_OnClick;  
}  
//End Close Login_Button_DoLogin_OnClick

I don't know if this was a one-off glitch, or whether the generator has a bug.

Once again, a php debugger would probably have pinpointed this in an instance!

_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.