2

I have this simple User Control that just displays a string in the web page:

In JScript Runtime Render tab:

function test4($)
{
    this.Width;
    this.Height;

    this.show = function()
    {
        ///UserCodeRegionStart:[show] (do not remove this comment.)

        this.setHtml("<p>Hello World!</p>");


        ///UserCodeRegionEnd: (do not remove this comment.)
    }
    ///UserCodeRegionStart:[User Functions] (do not remove this comment.)


    ///UserCodeRegionEnd: (do not remove this comment.):
}

I installed this user control, and tested it. Everything is ok, the message "Hello World!" is displayed in my web panel.

The problem is that, when I change the user control, for example to display "Hola GeneXus!!":

function test4($)
{
    this.Width;
    this.Height;

    this.show = function()
    {
        ///UserCodeRegionStart:[show] (do not remove this comment.)

        this.setHtml("<p>Hola GeneXus!!</p>");


        ///UserCodeRegionEnd: (do not remove this comment.)
    }
    ///UserCodeRegionStart:[User Functions] (do not remove this comment.)


    ///UserCodeRegionEnd: (do not remove this comment.):
}

I always get "Hello World!!"!!! How can I see those changes applied? How I'm I supposed to develop an user control, and see the changes during the development?

I have tried doing this:

  1. Close GeneXus if it is open.
  2. Replace the files of the User Control which have been updated in the User Control folder under GeneXus installation path.
  3. Execute GeneXus with the /install parameter. For example: \GeneXus.exe /install
  4. Check that the toolbox still has the option under the User Controls section.

I also have tried to change the user control version, as is said here (http://wiki.genexus.com/commwiki/servlet/hwiki?HowTo%3A+Installing+User+Controls,):

When providing UCs, it is advisable to include the tag “Number” in the UserControlName.control file. If this recommendation is followed, the newer version of the user control is copied to the application directory once the UC installation process is complete (i.e. “genexus.exe /install” execution) and building the application.

And having this information (http://wiki.genexus.com/commwiki/servlet/hwiki?HowTo%3A+Installing+User+Controls,):

How are the UCs copied to the application directory?

UCs are installed in the GX installation directory (i.e. UserControls\UserControlName) and all the UCs being used by an application are automatically copied from the GeneXus Installation directory to the application directory (e.g. CSharpModel\Web\UserControlName).

I suspect that the new js file is never updated in the application directory, but I don't know why!

What can I do to solve this problem? Because right know every time I do changes in the JS files the only way I can see those changes (even if it is just a simple string "Hello World!!" to "Hola Genexus!!") is by creating a complete new user controller.

Any help?

I'm using the Genexus v3 trial version.

Mario
  • 1,213
  • 2
  • 12
  • 37
  • 1
    Can you check that the modified js file was copied to the server? Maybe the problem is with de browser's cache. It may be using the old, locally-cached version of the file instead of the new one. Try with another browser or by forcing a refresh with Ctrl+F5. – Marcos Crispino Aug 14 '14 at 16:31
  • 3
    Just wanted to add that the user control files are copied from the GX installation to the KB target environment's target path, only when the control's version number changes. When developing the control it's somehow easier to just modify the js files directly in the target path, and only when ready move those changes to the GX user controls folder incrementing the user control version number. If when changing the file directly in the target path folder you don't notice changes, then there may be some issue with the browser cache as @MarcosCrispino noticed. – Fede Aug 14 '14 at 16:46
  • Can you tell me how do I check if the file was copied to the server? I'm a beginner using GeneXus ;) I don't know the KB target environment's target path? – Mario Aug 14 '14 at 17:12
  • 2
    You can go inside GX to Tools->Explore Target Environment Directory. That should position you in the web folder in windows explorer. You should find there a folder named as your user control, with the js files inside. – Fede Aug 14 '14 at 17:37
  • 1
    @Fede Thanks a lot. You saved my day :) If I directly update the js file everything works great, I can now continue to develop the User Control. – Mario Aug 14 '14 at 21:00
  • And during the development is perfect, because I need to check many times the changes I do, and just need to change the js files and run the GX to see the result. Two easy steps. If you want to give any advice feel free to do it. – Mario Aug 14 '14 at 21:32

1 Answers1

1

I think this answer your problem when you want to update the User Control:

https://stackoverflow.com/a/25454131/2121837

And during the development you should do this:

  1. Go to the target path folder
  2. Change the javascripts in that directory and save them
  3. Run Developer Menu
Community
  • 1
  • 1
Rcardoso
  • 26
  • 6