Sigma Php Ajax framework, Ajax Components, GUI Builder
May 21, 2012, 11:09:20 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: GUIbuilder corrupted after pasting user functions at top  (Read 546 times)
rodericksmith
Jr. Member
**
Posts: 10


View Profile WWW
« on: November 10, 2010, 02:37:07 AM »

A corruption-on-paste issue:

Context: jslinb/UIbuilder/SimpleUIbuilder/CodeWindow/Corruption-on-paste   

This issue occurs when: Replacing all the javascript in the UI builder demonstration by pasting a valid alternative javascript.  It seems to occur when user-defined javascript functions are inserted at the top of the javascript section, i.e. the top of the window observable in the UIbuilder GUI.
This corrupts the integration of the web-page prior to saving it or running it.  I've attached a minimal example derived from jslinb's UIbuilder webpage.

If that corruption is corrected (e.g. in an  external text editor), the code runs correctly.

A work-around is to place the functions at the end of the page rather than the beginning.  However, I'm concerned there might be some circumstances where my functions would need to be loaded at the top of the page rather than the bottom.

By 'saving the defective page as html', I see the corruption consists of an extra insertion at the end of the html page, within the tail section that's beyond the Javascript section.  So it's invisible in the simple UIbuilder window.

Side effects:

In the design view window, sometimes(with more complex example than attached)  fails to update the region highlighter selectors, and changes what the still-valid buttons highlight.

During load (after pressing RUN icon), it never breaks out of the place-holder streaming dots visual.  [preferred: an error message to help diagnose the cause of the delay, if the error is trappable; otherwise a time-out message].

Questions

Is this considered a bug or a feature? -- have I misunderstood the issue?
 ... if a bug, in which issue of the UIbuilder will it be addressed?
Could the documentation mention the preferred location for user functions, please?
And to describe how the functional blocks should be laid out in the final htmlpage.

Is this format of reporting issues acceptable to you? Can you suggest improvements?



Excerpt of the corrupted html file, including the final semicolon from the visible Javascript window (corrupt pasting is shown red):

. . . . . (start of file is OK)

;

//linb.setAppLangKey('app');
linb.UI.setTheme('default');
linb.Com.load('



// The default code is a com class (inherited from linb.Com)
Class(
'App', 'linb.Com',);', function(){linb('loading').remove()}, 'en');
        </script>

</body>
</html>

;
« Last Edit: November 10, 2010, 02:39:38 AM by rodericksmith » Logged

linb
Administrator
Hero Member
*****
Posts: 435


View Profile
« Reply #1 on: November 11, 2010, 12:49:46 AM »

"The Design View" is only for jsLinb Class.
---------------------
// The first line
Class('App', 'linb.Com',{
    // Ensure that all the value of "key/value pair" does not refer to external variables
    Instance:{
iniComponents : function(){
            // [[code created by jsLinb UI Builder
            var host=this, children=[], append=function(child){children.push(child.get(0))};
           
          // UI Code must be here
 
            return children;
            // ]]code created by jsLinb UI Builder
        }
         //,
        // Your instance functions have to be here
    },
    Static:{
        // Your static functions have to be here
    }
// the last line
});
---------------------


Maybe, you should read this post: http://sigmawidgets.com/forum/visual-ajax-gui-builder/functions-and-global-variables/
« Last Edit: November 11, 2010, 12:55:53 AM by linb » Logged
rodericksmith
Jr. Member
**
Posts: 10


View Profile WWW
« Reply #2 on: November 11, 2010, 04:50:07 PM »

Thanks for that extra information about what goes where.  So I guess the constructor function must be the first item in the GUbuilder code window.

It's odd that the paste then run operations can actually corrupt the (supposedly fixed) text that tops and tails the window content, though.
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!