@@ -648,7 +648,8 @@ apf.DataBinding = function(){
648648 * that is used to load data into the xmlRoot of this component.
649649 */
650650 this . $loadSubData = function ( xmlRootNode ) {
651- if ( this . $hasLoadStatus ( xmlRootNode ) ) return ;
651+ if ( this . $hasLoadStatus ( xmlRootNode ) && ! this . $hasLoadStatus ( xmlRootNode , "potential" ) )
652+ return ;
652653
653654 //var loadNode = this.$applyBindRule("load", xmlRootNode);
654655 var rule = this . $getBindRule ( "load" , xmlRootNode ) ;
@@ -769,15 +770,20 @@ apf.DataBinding = function(){
769770 /**
770771 * @private
771772 */
773+ //@todo optimize this
772774 this . $setLoadStatus = function ( xmlNode , state , remove ) {
773- //remove old status if any
774- var ostatus = xmlNode . getAttribute ( "a_loaded" ) ;
775- ostatus = ostatus
776- ? ostatus . replace ( new RegExp ( "\\|\\w+\\:" + this . $uniqueId + "\\|" , "g" ) , "" )
777- : "" ;
775+ var group = this . loadgroup || "default" ;
776+ var re = new RegExp ( "\\|(\\w+)\\:" + group + ":(\\d+)\\|" ) ;
777+ var loaded = xmlNode . getAttribute ( "a_loaded" ) || "" ;
778778
779+ var m ;
780+ if ( ! remove && ( m = loaded . match ( re ) ) && m [ 1 ] != "potential" && m [ 2 ] != this . $uniqueId )
781+ return ;
782+
783+ //remove old status if any
784+ var ostatus = loaded . replace ( re , "" )
779785 if ( ! remove )
780- ostatus += "|" + state + ":" + this . $uniqueId + "|" ;
786+ ostatus += "|" + state + ":" + group + ":" + this . $uniqueId + "|" ;
781787
782788 xmlNode . setAttribute ( "a_loaded" , ostatus ) ;
783789 } ;
@@ -792,11 +798,13 @@ apf.DataBinding = function(){
792798 /**
793799 * @private
794800 */
795- this . $hasLoadStatus = function ( xmlNode , state ) {
801+ this . $hasLoadStatus = function ( xmlNode , state , unique ) {
796802 var ostatus = xmlNode . getAttribute ( "a_loaded" ) ;
797803 if ( ! ostatus ) return false ;
798-
799- return ( ostatus . indexOf ( ( state || "" ) + ":" + this . $uniqueId + "|" ) != - 1 )
804+
805+ var group = this . loadgroup || "default" ;
806+ var re = new RegExp ( "\\|" + ( state || "\\w+" ) + ":" + group + ":" + ( unique ? this . $uniqueId : "\\d+" ) + "\\|" ) ;
807+ return ostatus . match ( re ) ? true : false ;
800808 } ;
801809
802810 /**
0 commit comments