m3svcs
(M3svcs)
May 23, 2011, 12:27pm
1
Hello
I want to pass a facebook user id variable through ‘itemView’ _view in this manner:
$uid = "Facebook user id";
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
'itemGroupMax'=>4,
'viewData'=>array('uid'=>$uid,),
));
If the CListView has more than 1 page of data items, the subsequent pages will not be passed the variable $uid, is there any way around this? Only the first page receives $uid.
BTW Chrome works for all pages, but not IE.
Thank you very much.
m3svcs
(M3svcs)
May 29, 2011, 2:59pm
2
Hello
I want to pass a facebook user id variable through ‘itemView’ _view in this manner:
$uid = $facebook->getUser(); // "Facebook user id"
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
'itemGroupMax'=>4,
'viewData'=>array('uid'=>$uid,),
));
If the CListView has more than 1 page of data items, the subsequent pages will not be passed the variable $uid, is there any way around this? Only the first page receives $uid.
BTW Chrome works for all pages, but not IE.
Thank you very much.
I finally got my friend who started on yii in early 2009 to look at it. He was equally perplexed by what he saw. Is IE8 on WinXP really that bad?
mdomba
(Maurizio Domba Cerin)
May 30, 2011, 12:21pm
3
I just tried this… and for me it works… even on IE8…
I noticed in your example the attribute ‘itemGroupMax’ this is not part of the standard CListView… do you use some custom version?
m3svcs
(M3svcs)
May 30, 2011, 1:47pm
4
Thanks mdomba for your reply.
Did you use $uid = $facebook->getUser();? If $uid = 1234567890123; it works.
Did you try it on subsequent pages of CListView? $uid is only available on page #1 . From page #2 onwards, $uid is not passed, $uid is NULL from gettype($uid). Even when I go back to Page #1 , $uid is still NULL until I refresh the page. Chrome works fine, all the time.
‘itemGroupMax’ was what I added to the CListView.
mdomba
(Maurizio Domba Cerin)
May 30, 2011, 1:54pm
5
I don’t have $facebook->getUser()… I just put $uid=‘Test’ and in the view echoed that value to see if it would display on every page… and it is displayed on every page…
m3svcs
(M3svcs)
May 30, 2011, 2:21pm
6
Agreed, $uid = “Test”; works for all browsers but not $uid = $facebook->getUser();
mdomba
(Maurizio Domba Cerin)
May 30, 2011, 4:05pm
7
what does $facebook->getUser()… can you call this method staticali like Facebook::getUser() ?
m3svcs
(M3svcs)
May 31, 2011, 2:28pm
8
mdomba
(Maurizio Domba Cerin)
May 31, 2011, 7:15pm
9
Sorry but I don’t have time to study that code… seems to like the variable/class $facebook is not initialized on all other pages…
m3svcs
(M3svcs)
June 1, 2011, 3:56pm
10
Thanks for your reply, but it’s ‘magically’ initialized on all other pages if you use Chrome and not IE8