Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Problem with two modules in the same page
luiz@wise.com.br
#1 Posted : Friday, April 09, 2010 3:23:08 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
I created a image galery module, and added it twice in the same page

the initial render is fine, the first one work fine, each thumbnail has an click event calling $.getJSON(url,function(json)......) to get the data and change it

i receive this url, for example /kooboo/c-SmallBusiness/ViewGalery/km2942/ImageGalery/Index/Galery_1/1
the first parameter is the Galery UserKey and the second is the index

but when the second module calls /kooboo/c-SmallBusiness/ViewGalery/km2942/ImageGalery/Index/Galery_2/1
the return show that the UserKey is null, and when the UserKey is null the action uses the this.ModuleInfo.ModuleSettings["GaleryUserKey"].Value

but it return the first UserKey instead of the second

I Might did something wrong, all of this json, jquery stuff is new to me, but I can't see what



luiz@wise.com.br
#2 Posted : Tuesday, April 13, 2010 1:47:09 AM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
This problem persists with the upgrade to 2.1.0.0
jifeng
#3 Posted : Tuesday, April 13, 2010 5:57:11 PM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
Luiz,

I am thinking, in this function getJSON(url,function(json)......), I am not sure what do you put in the variable "url".

It seems like both of them call the module1, instead of 1 to module1, and the other to module2. Each module will have its own set of URL part within the page URL.

The variable "url" should be a value generated using MVC actionlink. When you adding one module twice to a page, on each rendering of the module, we will overwrite the action link method and generate the correct URL based on that module.

According to your description, it seems like that URL is hard coded? Is this case? Can you clarify it or maybe post some source code sample?
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
luiz@wise.com.br
#4 Posted : Tuesday, April 13, 2010 8:43:54 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
i'm using the Url.Action("Index", new { Userkey = Model.Galery.UserKey, Index = i }) to generate the url
zguoqi
#5 Posted : Wednesday, April 14, 2010 8:45:13 PM(UTC)
Rank: Administration
Groups: Registered, Administrators

Joined: 9/2/2009(UTC)
Posts: 695
Location: xiamen
Luiz,

Do you mind sending us the module so that we can have a check here? Hard for us to determine the problem right now.

can send to jifeng's email at jifeng AT chinasoftware.eu
Regards,

Vincent

Kooboo Team
luiz@wise.com.br
#6 Posted : Wednesday, April 14, 2010 8:49:20 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 3/4/2010(UTC)
Posts: 157
Location: brazil
sure, this is my hello world module, it's kinda open for improvements and suggestions
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.270 seconds.