Ticket #696 (closed defect: fixed)

Opened 15 months ago

Last modified 15 months ago

TTabPanel: JS error when one of the tabs is invisible

Reported by: intol Owned by: xue
Priority: urgent Milestone: 3.1.1
Component: Prado Framework v3 Version: 3.1
Severity: minor Keywords:
Cc:

Description

Hi! There is a problem with TTabPanel component. If we set Visible="false" (and then tab doesn't render) to one of the tabs, there will be JS errors when we try to change any tab.

Change History

Changed 15 months ago by intol

Hi! I was in a rush, so here is a fix:

In TTabPanel in function getClientOptions() change line:

foreach($this->getViews() as $view)
		{
			$viewIDs[]=$view->getClientID();
                }

to:

foreach($this->getViews() as $view)
		{
                     if($view->getVisible())
			$viewIDs[]=$view->getClientID();
                }

Changed 15 months ago by xue

  • status changed from new to closed
  • resolution set to fixed

Thanks!

Changed 15 months ago by tof06

  • status changed from closed to reopened
  • resolution fixed deleted

I reopen this ticket, because there 's still a bug when you set the Visible property with an expression tag in template. Ex:

<com:TTabView 
    Caption="admin" 
    Visible=<%=$this->User->isInRole('admin')%>>

If I set the Visible property with the same expression in onInit, everything is ok. Because the Expression tag is evaluated in pre-render, I think that the Visible Property is not yet set when the getClientOptions is called.

Not sure if there is a workaround to this... :(

Changed 15 months ago by tof06

  • status changed from reopened to closed
  • resolution set to fixed

It's ok all time now

Note: See TracTickets for help on using tickets.