Yii Framework Forum: CForm getActiveFormWidget always returns NULL - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CForm getActiveFormWidget always returns NULL Rate Topic: -----

#1 User is offline   sumwai 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 85
  • Joined: 16-March 09

Posted 01 November 2010 - 06:15 PM

As titled, CForm's getActiveFormWidget always returns NULL, tried calling it in a controller, a class inherited from CForm.
$preSignupForm = new CForm('user.views.forms.preSignupForm', new UserPreSignupForm());
var_dump($preSignupForm->getActiveFormWidget());//returns NULL


The form renders and works, no error messages though. Am I missing something? Can somebody verify this for me?
tipstank.com - where I share my coding stuff
0

#2 User is offline   sumwai 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 85
  • Joined: 16-March 09

Posted 01 November 2010 - 06:39 PM

tested on Yii version 1.1.4 and nightly snapshot, someone please verify this for me.
tipstank.com - where I share my coding stuff
0

#3 User is offline   sumwai 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 85
  • Joined: 16-March 09

Posted 01 November 2010 - 07:56 PM

Now I get it, getActiveFormWidget only returns the current activeForm after the form is rendered. Anyway to get the activeFormWidget before it is rendered?
tipstank.com - where I share my coding stuff
0

#4 User is offline   sumwai 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 85
  • Joined: 16-March 09

Posted 01 November 2010 - 08:10 PM

View Postsumwai, on 01 November 2010 - 07:56 PM, said:

Now I get it, getActiveFormWidget only returns the current activeForm after the form is rendered. Anyway to get the activeFormWidget before it is rendered?


I get it, I just overwrite CForm's render to run my codes and its parent, solve!

Thanks! :lol:
tipstank.com - where I share my coding stuff
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users