[mochikit] How to get Signal.connect code rendered via .innerHTML replacement to work?

2007-10-05 Thread John Lorance

The Problem:
I have a button on a page that results in getting HTML back from the
server which contains something like the following (result['content']
(below) contains the following):


input src=/static/images/btn_left.png name=mybutton
type=image id=mybutton_id value=somevalue class=imagebutton
script type=text/javascript

onclick_mybutton= function(e)
{
return myJavaScriptFunction(this.form, target_id, e);
}
MochiKit.Signal.connect(mybutton_id, onclick,
onclick_mybutton);

/script

This is then rendered to the page via something like:
getElement(target_id).innerHTML = result['content'];

Now, I get everything rendered just fine (so I can see the button
represented by btn_left.png)... however, the browser doesn't execute
the new function (seen above) on click... .  I know the above block of
code works fine as I have nearly identical blocks of code hooked up to
other buttons that are rendered on the initial page load.

What am I missing here?  Does .innerHTML not render the HTML in the
same way as the original page load (in other words, ignoring the
Mochikit.Signal.connect.. call?)

Any help would be greatly appreciated.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] Re: How to get Signal.connect code rendered via .innerHTML replacement to work?

2007-10-05 Thread wavydavy

On Oct 5, 7:05 am, John Lorance [EMAIL PROTECTED] wrote:
 The Problem:
 onclick_mybutton= function(e)
 {
 return myJavaScriptFunction(this.form, target_id, e);
 }

 Now, I get everything rendered just fine (so I can see the button
 represented by btn_left.png)... however, the browser doesn't execute
 the new function (seen above) on click... .

Not sure, but:

 - IIRC, 'this' in the context of the event handler is bound to the
object that fired the event (your input). If not it's bound to the
'onclick_mybutton' function. Either way, neither have a 'form'
attribute AFAICS.

 - where's target_id come from?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] Re: How to get Signal.connect code rendered via .innerHTML replacement to work?

2007-10-05 Thread Bob Ippolito

On 10/4/07, John Lorance [EMAIL PROTECTED] wrote:

 The Problem:
 I have a button on a page that results in getting HTML back from the
 server which contains something like the following (result['content']
 (below) contains the following):


innerHTML doesn't execute script. You could try something like this:

var elem = getElement(target_id);
elem.innerHTML = result['content'];
var script_tags = getElementsByTagAndClassName(script, null, elem);
for (var i = 0; i  script_tags.length; i++) {
eval(scrapeText(script_tags[i]));
}

I'm not sure if that works in all of the browsers, make sure to give
it a try in the ones you care about.

-bob

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] Re: examples of filterable tables using mochikit?

2007-10-05 Thread tphyahoo

Extremely helpful.

Thanks a lot.

On Sep 26, 7:10 pm, Morten Barklund [EMAIL PROTECTED] wrote:
 tphyahoo wrote:
  I'm trying to leverage mochikit to build an app that allows both
  sorting and filtering of tables.

  There's a nice example of sorting using mochikit at

   http://mochikit.com/examples/ajax_tables/index.html

  I found an example of using javascript to do a dynamic filter at

   http://snippets.dzone.com/posts/show/1824(source)
   http://snippets.dzone.com/posts/show/1824(demo)

 The links seem similar :)

 I guess the second one should have been:

 http://leparlement.org/filterTable

  Is there any baked-in functionality, ideally with examples, to do this
  sort of thing using mochikit?

 Nothing baked-in, but all of the above functions could be done several
 times shorter and easier using mochikit.

 I've cooked together an example described in this blog-post:

 http://www.barklund.org/blog/2007/09/27/filterable-tables-mochikit-st...

 It not only re-creates the above code in a much simpler, slicker way, it
 also fixes errors in the above script as well as extend the script with
 some very simple features.

 --
 Morten Barklund


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] Re: Activity

2007-10-05 Thread scipio



On Aug 18, 11:59 am, Beau Hartshorne [EMAIL PROTECTED] wrote:
 On 18-Aug-07, at 8:44 AM, Lee Connell wrote:

  Mochikit hasn't seen any activity in the revision history at least
  since 06, is mochikit fading?

 We're pretty busy with our own projects, and haven't had much time to
 tag a release. /trunk is very stable, and is updated with features
 and bugfixes regularly:

 http://trac.mochikit.com/browser/mochikit/trunk

Desparately short sighted: if you leave a web site
untouched for a year, most people will assume its
dead and move on.   In discussions about JS client
frameworks I've already seen several comments suggesting
that MK development is dead.

How hard can it be to tag the repository and
update a couple lines of text on a web page?




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] Re: Activity

2007-10-05 Thread Bob Ippolito

On 10/3/07, scipio [EMAIL PROTECTED] wrote:



 On Aug 18, 11:59 am, Beau Hartshorne [EMAIL PROTECTED] wrote:
  On 18-Aug-07, at 8:44 AM, Lee Connell wrote:
 
   Mochikit hasn't seen any activity in the revision history at least
   since 06, is mochikit fading?
 
  We're pretty busy with our own projects, and haven't had much time to
  tag a release. /trunk is very stable, and is updated with features
  and bugfixes regularly:
 
  http://trac.mochikit.com/browser/mochikit/trunk

 Desparately short sighted: if you leave a web site
 untouched for a year, most people will assume its
 dead and move on.   In discussions about JS client
 frameworks I've already seen several comments suggesting
 that MK development is dead.

 How hard can it be to tag the repository and
 update a couple lines of text on a web page?


It's enough of a hassle. Honestly, I don't care if anyone uses
MochiKit or anything else, they should pick whatever works for them.
MochiKit is not a marketing exercise, I don't do consulting and I'm
not terribly interested in speaking about JavaScript at conferences
right now. We use it, it works great for us. I'd like to do a release,
but I care a lot more about what my company is actually working on
right now. MochiKit hasn't changed much lately because we got it to
the point where it does what we want it to do and we haven't needed a
whole lot else from it. The big mistake that I made was accepting a
bunch of functionality that we had no intention of using internally,
which is what's holding up the release because it doesn't pass quality
control as far as code audit and docs go. I'm not really comfortable
tagging what's in there as a release in its current state.

If someone is truly interested in being the release manager for
MochiKit they can step up and I'd be more than happy to give them full
reign. I'll even give them a job (interview, anyway) if they want to
move to San Francisco and do front-end work for us also :)

-bob

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---



[mochikit] Conceptual assistance on periodically updating table contents from database

2007-10-05 Thread onmountain

Hi. New to Turbogears and Mochikit (did I just hear everyone clicking
the back key? :-)
I am teaching myself by doing an in/out sign in board, which I have
gotten to the point where I have a table that I can sort, as well as
update by clicking on the edit button for the inout_status field.
Really think TG and Mochikit are cool
My stumbling point now is how to keep the table contents up-to-date
(showing all the correct inout_status values as people update their
own status) without doing a page refresh.  Is there a timer function
(I think that calllater might be it???).  I have two ideas here:

1) Have TG maintain a variable (change_flag) that the edit button(s)
on all the user screens will set as TRUE when the user changes
inout_status.  Each screen could then periodically check for that
change_flag == true, and if so, the table value could all be updated?

2) Just have a timer in Mochikit that would trigger periodic updates
to ALL the table contents.

Any suggestions as to how to set up timers and also how to reload all
the table values woudl be appreciated.
Thanks!
Jamie


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
MochiKit group.
To post to this group, send email to mochikit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~--~~~~--~~--~--~---