Archive for the ‘

Prado

’ Category

Prado and its page state

I had some hard time tracking a bug of mine. The website is powered with the Prado framework latest version. It happened that the bug was a little tricky to be found. I have extended the TPage class and using it as MTPage. There I had a function used by a TDropDownList which is AutoPostBack enabled on changing the selected index – on the function executes $this->Response->reload(). The actual TDropDownList is in the MainLayOut.tpl file because it should be present on each page. But I have forgotten to use the following syntax:
Read more

Prado and loading modules at runtime

Today I had big problems trying to load modules in Prado from the TPage, not using the application.xml. I had such a requirement for the globalization utility in our web application. So after hours of pain finaly I found the magic lines of code that allow this to happen. I am surprised that there was no entry in the documentation or in the forums :( .

Here is the code:
Read more

Embedding YouTube videos in the Prado’s THtmlArea

I had problem in Prado’s THtmlArea with embedding videos not only from YouTube but also from other alternatives. It seems that THtmlArea is coded so that there is no way of allowing just object and embed tags. However you can use Text property and everything is fine. But when you want to use the SafeText property you are in a trouble with embeded videos. So what I did was to extend the THtmlArea component and created my own that goes beyond that limitation. Here it is:
Read more

Problems with Prado’s client side onclick event of a TLinkButton

Some time ago  I expirienced a strange and difficult to solve problem using the Prado framework. For those that are not aware this is a PHP framework which is ASP.NET alike – it simulates the workflow process of asp.net.

So here is the problem: I had a long form full of controls and validators, but for one of the fields I needed to make  a javascript call to the confirm function. The reason was that we needed to ask the user if he/she wants to go ahead and leave a field blank or no. Ok that is fine but when having other fields and validators for them the confirm function should be called after all of them are validated ok on the client side. The onclick javascript event is called before the validation. That’s the problem. How did I solve it? Well  don’t like the solution but it seems to be the only one that I could figure out. Here it is:

  • I put this on the top of tha page as javascript code:

Read more