lasso and jQuery (editable plug in)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

lasso and jQuery (editable plug in)

Brian Loomis-3
I'm working on a project using the jQuery library http://www.appelsiini.net/projects/jeditable

for edit in place functions, seems to work fine with Lasso and I'm  
having success with the edit inplace up to a certain point.

I'm able to get the data written to MySQL (veriifed) and returned to  
the browser by calling a lasso page using JavaScript, however on a  
page reload the new changes are lost ( to the browser).

With two browsers open, safari and firefox, I can make changes to one  
- it returns the correct values to the browser asyncronously, and  
MySQL and the page mirror each other, however on a page reload neither  
browser picks up the new changes, instead displaying only the values  
shown the first time the page was called.

There's got to be some funky cache thing going on.  I'm just unsure of  
where to direct my attention here.

Any ideas? Does process cache stuff that would cause this?

Brian

/////////////////////////
editable custom tag:

<?LassoScript
        define_tag: 'my_editable', -priority='replace', -required='fields', -
required='id', -required='class';
       
        local('out')=String;
       
        #out += '<div class="' #class '" id="" style="width:
600px">[column(\'' #fields '\')]</div>
<script language="JavaScript" type="text/javascript">
                                [html_comment]
                                         $(document).ready(function() {
                                               
                                                $(".' #class '").editable("http://[server_name]/test/
work_this.lasso?ID=' #id '&field=' #fields '", {
                                                                cancel    : \'Cancel\',
                                                                name : \'content\',
                                                                submit    : \'OK\',
                                                                tooltip   : \'Click to edit...\',
                                                                type      : \'textarea\',
                                                                height    :    \'300px\',
                                                                width     : \'600px\',
                                        });
                        });
                        [/html_comment]
                        </script>';
       
       
        return:#out;
       
        /define_tag;


?>

//////////////////////////////////////////////

code before abstraction to custom tag:

                <div class="editable_textarea2" id="" style="width:600px">[rows: -
inlinename ='pgdata_search';
        column('Objectives21');
/rows;]</div>
<script language="JavaScript" type="text/javascript">
                                [html_comment]
                                         $(document).ready(function() {
                                               
                                                $(".editable_textarea2").editable("http://[server_name]/test/
work_this.lasso?ID=137&field=Objectives21", {
                                                                cancel    : 'Cancel',
                                                                name : 'content',
                                                                submit    : 'OK',
                                                                tooltip   : 'Click to edit...',
                                                                type      : 'textarea',
                                                                height    :    '300px',
                                                                width     : '600px',
                                        });
                        });
                        [/html_comment]
                        </script>
                        -->


//////////////////////////////

code .

        [rows: -inlinename ='pgdata_search']
                        [process((my_editable: -fields='Objectives11', -id=$id, -
class='editable_field'))]
                        <hr />
                        [process((my_editable: -fields='Objectives12', -id=$id, -
class='editable_field2'))]
                        <hr />
                        [process((my_editable: -fields='Objectives21', -id=$id, -
class='editable_field3'))]
                        <hr />
                        [process((my_editable: -fields='Objectives22', -id=$id, -
class='editable_field4'))]
                        <hr />
                        [process((my_editable: -fields='Objectives31', -id=$id, -
class='editable_field5'))]
                        <hr />
                        [process((my_editable: -fields='Objectives32', -id=$id, -
class='editable_field6'))]
                        <hr />
                [/rows]

////////////////////////////////////////
page called by javascript  (work_this.lasso)

<?LassoScript
        library:'/config/database.inc';
        local('params'=array);
        local('table'='PGdata');
        local('field'=(action_param:'field'));
        local('ID'=(integer:(action_param:'ID')));
        #params->Insert(#field=(action_param:'content'));
       
        if:#ID > 0 && (action_param:'content');
                inline:
                                #dbconn, #params,
                                -table=#table,
                                -keyfield='ID',
                                -KeyValue=#ID,
                                -update;
                                //error_currenterror;
                                //action_statement;
                               
                                //*
                                        inline:
                                                #dbconn,
                                                -table=#table,
                                                -keyfield='ID',
                                                -KeyValue=#ID,
                                                -search;
                                                (field:#field);
                                        /inline;
// */
                                       
                        /inline;
                /if;
?>

Brian Loomis
http://www.virtualrelations.us
(208) 639-2569 - 208 NEW BLOX


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: lasso and jQuery (editable plug in)

jasonhuck
If you want to make sure Lasso isn't hanging onto an outdated cache,
try sticking this in the page:

http://tagswap.net/compiler_nocache

- jason



On Sun, Aug 17, 2008 at 5:49 PM, Brian Loomis <[hidden email]> wrote:

> I'm working on a project using the jQuery library
> http://www.appelsiini.net/projects/jeditable
>
> for edit in place functions, seems to work fine with Lasso and I'm having
> success with the edit inplace up to a certain point.
>
> I'm able to get the data written to MySQL (veriifed) and returned to the
> browser by calling a lasso page using JavaScript, however on a page reload
> the new changes are lost ( to the browser).
>
> With two browsers open, safari and firefox, I can make changes to one - it
> returns the correct values to the browser asyncronously, and MySQL and the
> page mirror each other, however on a page reload neither browser picks up
> the new changes, instead displaying only the values shown the first time the
> page was called.
>
> There's got to be some funky cache thing going on.  I'm just unsure of where
> to direct my attention here.
>
> Any ideas? Does process cache stuff that would cause this?
>
> Brian
>
> /////////////////////////
> editable custom tag:
>
> <?LassoScript
>        define_tag: 'my_editable', -priority='replace', -required='fields',
> -required='id', -required='class';
>
>        local('out')=String;
>
>        #out +=                 '<div class="' #class '" id=""
> style="width:600px">[column(\'' #fields '\')]</div>
> <script language="JavaScript" type="text/javascript">
>                                [html_comment]
>                                         $(document).ready(function() {
>
>                                                $(".' #class
> '").editable("http://[server_name]/test/work_this.lasso?ID=' #id '&field='
> #fields '", {
>                                                                cancel    :
> \'Cancel\',
>                                                                name :
> \'content\',
>                                                                submit    :
> \'OK\',
>                                                                tooltip   :
> \'Click to edit...\',
>                                                                type      :
> \'textarea\',
>                                                                height    :
>  \'300px\',
>                                                                width     :
> \'600px\',
>                                        });
>                        });
>                        [/html_comment]
>                        </script>';
>
>
>        return:#out;
>
>        /define_tag;
>
>
> ?>
>
> //////////////////////////////////////////////
>
> code before abstraction to custom tag:
>
>                <div class="editable_textarea2" id=""
> style="width:600px">[rows:        -inlinename              ='pgdata_search';
>        column('Objectives21');
> /rows;]</div>
> <script language="JavaScript" type="text/javascript">
>                                [html_comment]
>                                         $(document).ready(function() {
>
>
>  $(".editable_textarea2").editable("http://[server_name]/test/work_this.lasso?ID=137&field=Objectives21",
> {
>                                                                cancel    :
> 'Cancel',
>                                                                name
>            : 'content',
>                                                                submit    :
> 'OK',
>                                                                tooltip   :
> 'Click to edit...',
>                                                                type      :
> 'textarea',
>                                                                height    :
>  '300px',
>                                                                width     :
> '600px',
>                                        });
>                        });
>                        [/html_comment]
>                        </script>
>                        -->
>
>
> //////////////////////////////
>
> code .
>
>        [rows:  -inlinename             ='pgdata_search']
>                        [process((my_editable: -fields='Objectives11',
> -id=$id, -class='editable_field'))]
>                        <hr />
>                        [process((my_editable: -fields='Objectives12',
> -id=$id, -class='editable_field2'))]
>                        <hr />
>                        [process((my_editable: -fields='Objectives21',
> -id=$id, -class='editable_field3'))]
>                        <hr />
>                        [process((my_editable: -fields='Objectives22',
> -id=$id, -class='editable_field4'))]
>                        <hr />
>                        [process((my_editable: -fields='Objectives31',
> -id=$id, -class='editable_field5'))]
>                        <hr />
>                        [process((my_editable: -fields='Objectives32',
> -id=$id, -class='editable_field6'))]
>                        <hr />
>                [/rows]
>
> ////////////////////////////////////////
> page called by javascript  (work_this.lasso)
>
> <?LassoScript
>        library:'/config/database.inc';
>        local('params'=array);
>        local('table'='PGdata');
>        local('field'=(action_param:'field'));
>        local('ID'=(integer:(action_param:'ID')));
>        #params->Insert(#field=(action_param:'content'));
>
>        if:#ID > 0 && (action_param:'content');
>                inline:
>                                #dbconn, #params,
>                                -table=#table,
>                                -keyfield='ID',
>                                -KeyValue=#ID,
>                                -update;
>                                //error_currenterror;
>                                //action_statement;
>
>                                //*
>                                        inline:
>                                                #dbconn,
>                                                -table=#table,
>                                                -keyfield='ID',
>                                                -KeyValue=#ID,
>                                                -search;
>                                                (field:#field);
>                                        /inline;
> // */
>
>                        /inline;
>                /if;
> ?>
>
> Brian Loomis
> http://www.virtualrelations.us
> (208) 639-2569 - 208 NEW BLOX
>
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>
>



--
tagSwap.net :: Open Source Lasso Code
<http://tagSwap.net/>

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: lasso and jQuery (editable plug in)

Tim Taplin
In reply to this post by Brian Loomis-3
Check the Apache mod_cache settings. I recently came across a  
situation where files with extensions other than .html were being  
marked for client-side caching. This caused some really wierd  
file_write behaviors. Its possible you are seeing another  
manifestation of this issue.

Before that got figured out, one short term workaround (one shot  
each) was to attach a time stamp to the query string so that it  
wasn't the exact same request each time. This might tell you if it is  
a page cache issue.

Out of curiosity, what happens if you open the page, edit the fields  
and then open the other browser and open the page.  Does it still  
show up with the old values? or does it show the correct information?

Tim Taplin

On Aug 17, 2008, at 3:49 PM, Brian Loomis wrote:

> I'm working on a project using the jQuery library http://
> www.appelsiini.net/projects/jeditable
>
> for edit in place functions, seems to work fine with Lasso and I'm  
> having success with the edit inplace up to a certain point.
>
> I'm able to get the data written to MySQL (veriifed) and returned  
> to the browser by calling a lasso page using JavaScript, however on  
> a page reload the new changes are lost ( to the browser).
>
> With two browsers open, safari and firefox, I can make changes to  
> one - it returns the correct values to the browser asyncronously,  
> and MySQL and the page mirror each other, however on a page reload  
> neither browser picks up the new changes, instead displaying only  
> the values shown the first time the page was called.
>
> There's got to be some funky cache thing going on.  I'm just unsure  
> of where to direct my attention here.
>
> Any ideas? Does process cache stuff that would cause this?
>
> Brian
>
> /////////////////////////
> editable custom tag:
>
> <?LassoScript
> define_tag: 'my_editable', -priority='replace', -
> required='fields', -required='id', -required='class';
>
> local('out')=String;
>
> #out += '<div class="' #class '" id="" style="width:600px">
> [column(\'' #fields '\')]</div>
> <script language="JavaScript" type="text/javascript">
> [html_comment]
> $(document).ready(function() {
>
> $(".' #class '").editable("http://[server_name]/test/
> work_this.lasso?ID=' #id '&field=' #fields '", {
> cancel    : \'Cancel\',
> name : \'content\',
> submit    : \'OK\',
> tooltip   : \'Click to edit...\',
> type      : \'textarea\',
> height    :    \'300px\',
> width     : \'600px\',
> });
> });
> [/html_comment]
> </script>';
>
>
> return:#out;
>
> /define_tag;
>
>
> ?>
>
> //////////////////////////////////////////////
>
> code before abstraction to custom tag:
>
> <div class="editable_textarea2" id="" style="width:600px">[rows: -
> inlinename ='pgdata_search';
> column('Objectives21');
> /rows;]</div>
> <script language="JavaScript" type="text/javascript">
> [html_comment]
> $(document).ready(function() {
>
> $(".editable_textarea2").editable("http://[server_name]/test/
> work_this.lasso?ID=137&field=Objectives21", {
> cancel    : 'Cancel',
> name : 'content',
> submit    : 'OK',
> tooltip   : 'Click to edit...',
> type      : 'textarea',
> height    :    '300px',
> width     : '600px',
> });
> });
> [/html_comment]
> </script>
> -->
>
>
> //////////////////////////////
>
> code .
>
> [rows: -inlinename ='pgdata_search']
> [process((my_editable: -fields='Objectives11', -id=$id, -
> class='editable_field'))]
> <hr />
> [process((my_editable: -fields='Objectives12', -id=$id, -
> class='editable_field2'))]
> <hr />
> [process((my_editable: -fields='Objectives21', -id=$id, -
> class='editable_field3'))]
> <hr />
> [process((my_editable: -fields='Objectives22', -id=$id, -
> class='editable_field4'))]
> <hr />
> [process((my_editable: -fields='Objectives31', -id=$id, -
> class='editable_field5'))]
> <hr />
> [process((my_editable: -fields='Objectives32', -id=$id, -
> class='editable_field6'))]
> <hr />
> [/rows]
>
> ////////////////////////////////////////
> page called by javascript  (work_this.lasso)
>
> <?LassoScript
> library:'/config/database.inc';
> local('params'=array);
> local('table'='PGdata');
> local('field'=(action_param:'field'));
> local('ID'=(integer:(action_param:'ID')));
> #params->Insert(#field=(action_param:'content'));
>
> if:#ID > 0 && (action_param:'content');
> inline:
> #dbconn, #params,
> -table=#table,
> -keyfield='ID',
> -KeyValue=#ID,
> -update;
> //error_currenterror;
> //action_statement;
>
> //*
> inline:
> #dbconn,
> -table=#table,
> -keyfield='ID',
> -KeyValue=#ID,
> -search;
> (field:#field);
> /inline;
> // */
>
> /inline;
> /if;
> ?>
>
> Brian Loomis
> http://www.virtualrelations.us
> (208) 639-2569 - 208 NEW BLOX
>
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: lasso and jQuery (editable plug in)

Brian Loomis-3
In reply to this post by jasonhuck
Thanks Jason.

WIll try.

On Aug 17, 2008, at 4:41 PM, Jason Huck wrote:

> If you want to make sure Lasso isn't hanging onto an outdated cache,
> try sticking this in the page:
>
> http://tagswap.net/compiler_nocache
>
> - jason
>
>
>
> On Sun, Aug 17, 2008 at 5:49 PM, Brian Loomis <[hidden email]
> > wrote:
>> I'm working on a project using the jQuery library
>> http://www.appelsiini.net/projects/jeditable
>>
>> for edit in place functions, seems to work fine with Lasso and I'm  
>> having
>> success with the edit inplace up to a certain point.
>>
>> I'm able to get the data written to MySQL (veriifed) and returned  
>> to the
>> browser by calling a lasso page using JavaScript, however on a page  
>> reload
>> the new changes are lost ( to the browser).
>>
>> With two browsers open, safari and firefox, I can make changes to  
>> one - it
>> returns the correct values to the browser asyncronously, and MySQL  
>> and the
>> page mirror each other, however on a page reload neither browser  
>> picks up
>> the new changes, instead displaying only the values shown the first  
>> time the
>> page was called.
>>
>> There's got to be some funky cache thing going on.  I'm just unsure  
>> of where
>> to direct my attention here.
>>
>> Any ideas? Does process cache stuff that would cause this?
>>
>> Brian
>>
>> /////////////////////////
>> editable custom tag:
>>
>> <?LassoScript
>>       define_tag: 'my_editable', -priority='replace', -
>> required='fields',
>> -required='id', -required='class';
>>
>>       local('out')=String;
>>
>>       #out +=                 '<div class="' #class '" id=""
>> style="width:600px">[column(\'' #fields '\')]</div>
>> <script language="JavaScript" type="text/javascript">
>>                               [html_comment]
>>                                        $(document).ready(function() {
>>
>>                                               $(".' #class
>> '").editable("http://[server_name]/test/work_this.lasso?ID=' #id  
>> '&field='
>> #fields '", {
>>                                                                
>> cancel    :
>> \'Cancel\',
>>                                                               name :
>> \'content\',
>>                                                                
>> submit    :
>> \'OK\',
>>                                                                
>> tooltip   :
>> \'Click to edit...\',
>>                                                                
>> type      :
>> \'textarea\',
>>                                                                
>> height    :
>> \'300px\',
>>                                                                
>> width     :
>> \'600px\',
>>                                       });
>>                       });
>>                       [/html_comment]
>>                       </script>';
>>
>>
>>       return:#out;
>>
>>       /define_tag;
>>
>>
>> ?>
>>
>> //////////////////////////////////////////////
>>
>> code before abstraction to custom tag:
>>
>>               <div class="editable_textarea2" id=""
>> style="width:600px">[rows:        -inlinename              
>> ='pgdata_search';
>>       column('Objectives21');
>> /rows;]</div>
>> <script language="JavaScript" type="text/javascript">
>>                               [html_comment]
>>                                        $(document).ready(function() {
>>
>>
>> $(".editable_textarea2").editable("http://[server_name]/test/
>> work_this.lasso?ID=137&field=Objectives21",
>> {
>>                                                                
>> cancel    :
>> 'Cancel',
>>                                                               name
>>           : 'content',
>>                                                                
>> submit    :
>> 'OK',
>>                                                                
>> tooltip   :
>> 'Click to edit...',
>>                                                                
>> type      :
>> 'textarea',
>>                                                                
>> height    :
>> '300px',
>>                                                                
>> width     :
>> '600px',
>>                                       });
>>                       });
>>                       [/html_comment]
>>                       </script>
>>                       -->
>>
>>
>> //////////////////////////////
>>
>> code .
>>
>>       [rows:  -inlinename             ='pgdata_search']
>>                       [process((my_editable: -fields='Objectives11',
>> -id=$id, -class='editable_field'))]
>>                       <hr />
>>                       [process((my_editable: -fields='Objectives12',
>> -id=$id, -class='editable_field2'))]
>>                       <hr />
>>                       [process((my_editable: -fields='Objectives21',
>> -id=$id, -class='editable_field3'))]
>>                       <hr />
>>                       [process((my_editable: -fields='Objectives22',
>> -id=$id, -class='editable_field4'))]
>>                       <hr />
>>                       [process((my_editable: -fields='Objectives31',
>> -id=$id, -class='editable_field5'))]
>>                       <hr />
>>                       [process((my_editable: -fields='Objectives32',
>> -id=$id, -class='editable_field6'))]
>>                       <hr />
>>               [/rows]
>>
>> ////////////////////////////////////////
>> page called by javascript  (work_this.lasso)
>>
>> <?LassoScript
>>       library:'/config/database.inc';
>>       local('params'=array);
>>       local('table'='PGdata');
>>       local('field'=(action_param:'field'));
>>       local('ID'=(integer:(action_param:'ID')));
>>       #params->Insert(#field=(action_param:'content'));
>>
>>       if:#ID > 0 && (action_param:'content');
>>               inline:
>>                               #dbconn, #params,
>>                               -table=#table,
>>                               -keyfield='ID',
>>                               -KeyValue=#ID,
>>                               -update;
>>                               //error_currenterror;
>>                               //action_statement;
>>
>>                               //*
>>                                       inline:
>>                                               #dbconn,
>>                                               -table=#table,
>>                                               -keyfield='ID',
>>                                               -KeyValue=#ID,
>>                                               -search;
>>                                               (field:#field);
>>                                       /inline;
>> // */
>>
>>                       /inline;
>>               /if;
>> ?>
>>
>> Brian Loomis
>> http://www.virtualrelations.us
>> (208) 639-2569 - 208 NEW BLOX
>>
>>
>> --
>> This list is a free service of LassoSoft: http://www.LassoSoft.com/
>> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>> Manage your subscription: http://www.ListSearch.com/Lasso/
>>
>>
>
>
>
> --
> tagSwap.net :: Open Source Lasso Code
> <http://tagSwap.net/>
>
> --
> This list is a free service of LassoSoft: http://www.LassoSoft.com/
> Search the list archives: http://www.ListSearch.com/Lasso/Browse/
> Manage your subscription: http://www.ListSearch.com/Lasso/
>

Brian Loomis
http://www.virtualrelations.us
(208) 639-2569 - 208 NEW BLOX


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/

Reply | Threaded
Open this post in threaded view
|

Re: lasso and jQuery (editable plug in)

Brian Loomis-3
In reply to this post by Tim Taplin
all browsers on windows and mac show no changes, Navicat and Cocoa My  
SQL show changes.

On Aug 17, 2008, at 8:04 PM, Tim Taplin wrote:

> Out of curiosity, what happens if you open the page, edit the fields  
> and then open the other browser and open the page.  Does it still  
> show up with the old values? or does it show the correct information

Brian Loomis
http://www.virtualrelations.us
(208) 639-2569 - 208 NEW BLOX


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/