Hi,
in the 9.4x-Session Handling Exercise in the "Developing Web Apps" course, as per instructions, I had the MaximumRating site property set at number 5, then through Service Center (web interface) I set it to 10, getting the expected "success" green message.
Supposedly that would make possible to rate a movie with 10 stars in the movie app, but I see the same old 5 (I refreshed the page and opened the app again in the browser). Surprisingly (or maybe not), that MaximumRating site variable is still set at 5 in the Service Studio. Yet when I logout and login again in the Service Center, that variable's "Effective value" is set to 10.Something isn't 'jiving' here, can someone give some hints please as to why this is happening?
Thanks.
Is it a session variable? Do you still have the old session in browser? Logout from the application and login or clear the session from browser.
Pedro Coimbra wrote:
Hi Pedro use CTRL + F5 to refresh the cache and you may see the difference
Hi Pedro,
have you tried again one more time, without log out and changing the site property value and check the application again by refreshing the page? because site properties effected value should appear.
Manish Jawla wrote:
Hi Manish, I tried several times, without logging out, then by logging out, I tried logging in with those faux users like mary_jane (from the course), then with my login again, nothing works, and as you guys can see from the attached screenshot, that variable must be "quantic" or something because it has 2 values at the same time :P
@Swatantra , "MaximumRating" is not a session variable, but a Site Property, it retains it's value forever unless we change it.@Carlos , I should have seen 10 stars, but I always get the same 5, even with F5, ctrl+F5, closing and opening again, closing and opening the app from Service Studio..
Pardon the movie reference, but since this is a Movie app, it's case to say «My God, it's *NOT* full of stars!...» :P
Just to shed some light on Site Properties and their two different value properties. A Site Property has a Default Value which you can set in Service Studio upon creation. But it also has an Effective Value which you can set at runtime for a specific environment via Service Center.For example, lets say we have a DEV and PROD environment and we have a module with has a site property with the environment name as its value. Upon creation in the DEV environment, we set its default value to “Development” and published the module. Now we deploy the module to the Production environment, but remember the Default Value is still set to “Development”, so anywhere in our code where this site property is being used it will say “Development”. We don’t want that in our Production environment right? So what do we do? We log into Service Center on our Production environment and set the Effective Value of the site property to “Production” (normally we wouldn’t want this if the site property is shown on a webscreen, but its just an example). This way we can use site properties to configure different behaviors for different environments.
We could also set the Effective Value at runtime for the same environment on which we have set its Default Value during design time (remember it was set to “Development”). So now we log into Service Center on the same environment and set the Effective Value at runtime to “Dev”. Like the name of the property hints at, this is the value that will have effect on your application. The value the site property now has is “Dev” since we have set its Effective Value.
I hope this explains it a bit.
Regards,
Nordin
Nordin Ahdi wrote:
Just to shed some light on Site Properties and their two different value properties. A Site Property has a Default Value which you can set in Service Studio upon creation. But it also has an Effective Value which you can set at runtime for a specific environment via Service Center.For example, lets say we have a DEV and PROD environment and we have an module with has a site property with the environment name as its value. Upon creation in the DEV environment, I set its default value to “Development” and published the module. Now I deploy the module to the Production environment, but remember the Default Value is still set to “Development”, so anywhere in my code where this site property is being used it will say “Development”. We don’t want that in our Production environment right? So what do we do? We log into Service Center on our Production environment and set the Effective Value of the site property to “Production” (normally we wouldn’t want this if the site property is shown on a webscreen, but its just an example). This way we can use site properties to configure different behaviours for different environments.
Hi Nordin,I had some insight of that, but your explanation shed much more light on it, thanks :)
My problem still persists though, and as you can see, I have the expected values for both the default and effective values:
...and yet, 5 stars only:
If I can't solve this I'm afraid I'll have to start over from those quickstart .oap files available in the lessons. Anyway, this makes no sense
before you give up, can you maybe share your oml here, or have you tried debugging with a breakpoint in your webblock preparation.
It looks like you are doing everything right, so maybe the problem is some small detail you overlooked ??
Dorine
Dorine Boudry wrote:
I finally cracked it!! It turns out just clicking "Apply" wasn't enough, I also had to press "Redeploy Published Version", that big red button, for it to work, and this by the way wasn't mentioned ANYWHERE in the exercise PDF, I saw that button before but I didn't want to break anything (and also I don't know yet the differences between publishing and deploying). But I guess @Nordin talking about "deploying" inspired me, lol, that and also I was in the "if it breaks, it breaks" mood, now.
But the 9.4x-Session Handling Exercise PDF should be revised, since not only it doesn't mention anything about pressing the redeploy button, but also says that by clicking Apply "changes are immediately visible in runtime"
Thank you all for your time and hints :)
I have added some more info to my earlier post to explain another scenario (which is the same as yours).
Could you maybe share your OML to check it out?
I'm glad you got it to work, but it is possible to change a site property, press apply and have the new property available in the app without redeploy.
What if you now try to change again from 10 to some other value, and Apply but not Redeploy, is it still 10 ??
Hi Dorine, with the webapp opened, I changed the Effective Value from 10 to 7, checked it again by going back in the Service Center and forward again (Modules/ my OSMBd module/ site properties), and the new value 7 was there. But my MovieDetail Screen still has 10 stars (instead of 7). I reloaded the web app tab, closed it and launched it again from Service Studio, and still 10 stars. Something *is* broken here, then...
It seems something must have been inconsistent in your module and by redeploying it you fixed it. These things rarely happen, but they may occur sometimes.
As Dorine says, it is indeed possible to set the effective value of a site property, hit apply, and it would have immediate effect in your running application (without the redeploy).
I agree,
cause I had a little test yesterday, and changes in site prop were effective immediately in my app upon reloading the page (i.e. rerunning the preparation). Can you maybe share the oml ? Or maybe add your site prop as an expression on one of your screens and see if that also doesn't reflect the change
Hi Dorine,
Here goes the Oml. That isn't my main concern in Outsystems though, since I just watched the "web services" video lesson, and it's like I just parachuted into another course, for experts, and in the middle of it with no previous context. Talk about a steep dificulty...
Thanks for all the help so far.
Can't see anything wrong. I put your webblock on an empty testscreen (don't have core, so can't use your screens) and it works as expected, even tried different browsers and refreshing the screen always picks up the latest version of the site property (honestly, I'd be surprised if browser has anything to do with it, preparation runs on the server.)
If I were you, i would try debugging this or otherwise move on in the course and onto more interesting subjects.
Good luck,
Thanks Dorine, I'll see what I can do (Maybe it's my core module), but more likely I will move on with a default oml app file, since web services are a way bigger fish to fry for me right now.
thanks all for your help
P.S. Should I uncheck my previously marked solution where I said that Redeploying worked? Or mark you last answer as a solution?
Id' say indeed unmark the solution that isn't one, but there is no solution yet, so mark nothing
that won't change anything for you, but maybe for future readers of the forum.