From mymir.org at googlemail.com Tue Jun 3 14:57:05 2008 From: mymir.org at googlemail.com (Vladislav Vorobiev) Date: Tue, 3 Jun 2008 16:57:05 +0400 Subject: [Kss-devel] turn off ?kukitTimeStamp Message-ID: <604c02230806030557x6309fd97s8c33ff9100533d33@mail.gmail.com> Hello, How I can turn off the "?kukitTimeStamp=xxx" variable in the request to my Server. My Kss Statement looks like this .showConnection:click { evt-click-preventdefault: true; action-server: urlMethodAnotherAlias url(kssAttr(uri, true)); my kssattr uri already includes one question mark, and another question mark in the URL is not a good idea. Vlad From gotcha at bubblenet.be Tue Jun 3 15:09:55 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 03 Jun 2008 15:09:55 +0200 Subject: [Kss-devel] turn off ?kukitTimeStamp In-Reply-To: <604c02230806030557x6309fd97s8c33ff9100533d33@mail.gmail.com> References: <604c02230806030557x6309fd97s8c33ff9100533d33@mail.gmail.com> Message-ID: <484542A3.5040902@bubblenet.be> Vladislav Vorobiev wrote: > Hello, > > How I can turn off the "?kukitTimeStamp=xxx" variable in the request > to my Server. > My Kss Statement looks like this > > .showConnection:click { > evt-click-preventdefault: true; > action-server: urlMethodAnotherAlias url(kssAttr(uri, true)); > > my kssattr uri already includes one question mark, and another > question mark in the URL is not a good idea. > > Vlad > _______________________________________________ > Kss-devel mailing list > Kss-devel at codespeak.net > http://codespeak.net/mailman/listinfo/kss-devel You should ask the parameters to the URL through KSS like this : .showConnection:click { evt-click-preventdefault: true; action-server: urlMethodAnotherAlias url(kssAttr(uri, true)); urlMethodAnotherAlias-myparameter: kssAttr(myparameter, true); } and avoid to inline your parameter in your uri... HTH -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From gotcha at bubblenet.be Tue Jun 3 15:36:20 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 03 Jun 2008 15:36:20 +0200 Subject: [Kss-devel] turn off ?kukitTimeStamp In-Reply-To: <484542A3.5040902@bubblenet.be> References: <604c02230806030557x6309fd97s8c33ff9100533d33@mail.gmail.com> <484542A3.5040902@bubblenet.be> Message-ID: <484548D4.6030901@bubblenet.be> Godefroid Chapelle wrote: > > You should ask the parameters to the URL through KSS like this : I meant "add the parameters" > > .showConnection:click { > evt-click-preventdefault: true; > action-server: urlMethodAnotherAlias url(kssAttr(uri, true)); > urlMethodAnotherAlias-myparameter: kssAttr(myparameter, true); > } > > and avoid to inline your parameter in your uri... > > HTH -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From mymir.org at googlemail.com Tue Jun 3 15:41:39 2008 From: mymir.org at googlemail.com (Vladislav Vorobiev) Date: Tue, 3 Jun 2008 17:41:39 +0400 Subject: [Kss-devel] turn off ?kukitTimeStamp In-Reply-To: <484548D4.6030901@bubblenet.be> References: <604c02230806030557x6309fd97s8c33ff9100533d33@mail.gmail.com> <484542A3.5040902@bubblenet.be> <484548D4.6030901@bubblenet.be> Message-ID: <604c02230806030641r4c7e48e7xd459814a37970689@mail.gmail.com> Hi Goodfroid! It's a fact, that one can add parameters. But I'd like to know, if turning off the 'TimeStamp' in the URL is possible, too. Thanks Vlad 2008/6/3 Godefroid Chapelle : > Godefroid Chapelle wrote: >> >> You should ask the parameters to the URL through KSS like this : > > I meant "add the parameters" > >> >> .showConnection:click { >> evt-click-preventdefault: true; >> action-server: urlMethodAnotherAlias url(kssAttr(uri, true)); >> urlMethodAnotherAlias-myparameter: kssAttr(myparameter, true); >> } >> >> and avoid to inline your parameter in your uri... >> >> HTH > > -- > Godefroid Chapelle (aka __gotcha) http://bubblenet.be > -- Best Regards Vlad Vorobiev http://www.mymir.org From gotcha at bubblenet.be Tue Jun 3 16:59:02 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 03 Jun 2008 16:59:02 +0200 Subject: [Kss-devel] turn off ?kukitTimeStamp In-Reply-To: <604c02230806030641r4c7e48e7xd459814a37970689@mail.gmail.com> References: <604c02230806030557x6309fd97s8c33ff9100533d33@mail.gmail.com> <484542A3.5040902@bubblenet.be> <484548D4.6030901@bubblenet.be> <604c02230806030641r4c7e48e7xd459814a37970689@mail.gmail.com> Message-ID: <48455C36.2020204@bubblenet.be> Vladislav Vorobiev wrote: > Hi Goodfroid! > > It's a fact, that one can add parameters. But I'd like to know, if > turning off the 'TimeStamp' in the URL is possible, too. > > Thanks > Vlad For now, you cannot. There are vague plans to improve this timestamp issue. Will come later. -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From ree at ree.hu Tue Jun 3 17:08:00 2008 From: ree at ree.hu (Balazs Ree) Date: Tue, 3 Jun 2008 17:08:00 +0200 Subject: [Kss-devel] turn off ?kukitTimeStamp References: <604c02230806030557x6309fd97s8c33ff9100533d33@mail.gmail.com> <484542A3.5040902@bubblenet.be> <484548D4.6030901@bubblenet.be> <604c02230806030641r4c7e48e7xd459814a37970689@mail.gmail.com> Message-ID: On Tue, 03 Jun 2008 17:41:39 +0400, Vladislav Vorobiev wrote: > Hi Goodfroid! > > It's a fact, that one can add parameters. But I'd like to know, if > turning off the 'TimeStamp' in the URL is possible, too. > > I am not sure if Godefroid has understood the question. This is the way I understood it: ?kukitTimeStamp is something that we add as an always changing query parameter to the POST request. Originally, we added this because we simply wanted to make sure that the requests are never cached. However this is coming from the very first piece of kss code, and thought to serve no purpose any more (as it does not seem to do any harm either). Actually, you could probably remove it and still experience no change: as POST requests are never supposed to be cached anyway. You need to change the code in line 129 of serveraction.js. There is no other way to do it at the moment then change it in the code for yourself. In the close future, we will be able to have both non-cachable (POST) and cachable (GET) requests, as well as the kss parameter to set the caching strategy on the action. This is in a very advanced state of implementation, as the necessary changes on the framework are already developed and waiting for review and merge. This means there is good chance that this feature arrives in kss 1.5. (p.s. the kukittimestamp will disappear in any case, because we can implement caching in a better way, with CacheFu or whatever other method.) This is the generic backround of ?kukitTimeStanp. Perhaps if you tell a bit more about your use case, we can help you with more specific advice. Best wishes, -- Balazs Ree From mymir.org at googlemail.com Tue Jun 3 17:48:23 2008 From: mymir.org at googlemail.com (Vladislav Vorobiev) Date: Tue, 3 Jun 2008 19:48:23 +0400 Subject: [Kss-devel] turn off ?kukitTimeStamp In-Reply-To: References: <604c02230806030557x6309fd97s8c33ff9100533d33@mail.gmail.com> <484542A3.5040902@bubblenet.be> <484548D4.6030901@bubblenet.be> <604c02230806030641r4c7e48e7xd459814a37970689@mail.gmail.com> Message-ID: <604c02230806030848m557f72d8y185931dcfcad48ee@mail.gmail.com> > I am not sure if Godefroid has understood the question. This is the way I > understood it: > > ?kukitTimeStamp is something that we add as an always changing query > parameter to the POST request. Originally, we added this because we > simply wanted to make sure that the requests are never cached. However > this is coming from the very first piece of kss code, and thought to > serve no purpose any more (as it does not seem to do any harm either). > > Actually, you could probably remove it and still experience no change: as > POST requests are never supposed to be cached anyway. You need to change > the code in line 129 of serveraction.js. There is no other way to do it > at the moment then change it in the code for yourself. > > In the close future, we will be able to have both non-cachable (POST) and > cachable (GET) requests, as well as the kss parameter to set the caching > strategy on the action. This is in a very advanced state of > implementation, as the necessary changes on the framework are already > developed and waiting for review and merge. This means there is good > chance that this feature arrives in kss 1.5. > > (p.s. the kukittimestamp will disappear in any case, because we can > implement caching in a better way, with CacheFu or whatever other method.) > > This is the generic backround of ?kukitTimeStanp. Perhaps if you tell a > bit more about your use case, we can help you with more specific advice. Thanks. Yes, cache is the task of server. Best regards Vlad From mymir.org at googlemail.com Tue Jun 3 18:25:29 2008 From: mymir.org at googlemail.com (Vladislav Vorobiev) Date: Tue, 3 Jun 2008 20:25:29 +0400 Subject: [Kss-devel] turn off ?kukitTimeStamp In-Reply-To: <484542A3.5040902@bubblenet.be> References: <604c02230806030557x6309fd97s8c33ff9100533d33@mail.gmail.com> <484542A3.5040902@bubblenet.be> Message-ID: <604c02230806030925w72dbe941sd6f350d004544dbd@mail.gmail.com> 2008/6/3 Godefroid Chapelle : > Vladislav Vorobiev wrote: >> >> Hello, >> >> How I can turn off the "?kukitTimeStamp=xxx" variable in the request >> to my Server. >> My Kss Statement looks like this >> >> .showConnection:click { >> evt-click-preventdefault: true; >> action-server: urlMethodAnotherAlias url(kssAttr(uri, true)); >> >> my kssattr uri already includes one question mark, and another >> question mark in the URL is not a good idea. >> >> Vlad >> _______________________________________________ >> Kss-devel mailing list >> Kss-devel at codespeak.net >> http://codespeak.net/mailman/listinfo/kss-devel > > You should ask the parameters to the URL through KSS like this : > > .showConnection:click { > evt-click-preventdefault: true; > action-server: urlMethodAnotherAlias url(kssAttr(uri, true)); > urlMethodAnotherAlias-myparameter: kssAttr(myparameter, true); > } > > and avoid to inline your parameter in your uri... > > HTH > > -- > Godefroid Chapelle (aka __gotcha) http://bubblenet.be > If a question mark in the URL is not how it works before. Whether it is a bug or so extra made no idea. I climb onto your proposal. From ree at ree.hu Wed Jun 4 06:18:20 2008 From: ree at ree.hu (Balazs Ree) Date: Wed, 4 Jun 2008 06:18:20 +0200 Subject: [Kss-devel] turn off ?kukitTimeStamp References: <604c02230806030557x6309fd97s8c33ff9100533d33@mail.gmail.com> <484542A3.5040902@bubblenet.be> <604c02230806030925w72dbe941sd6f350d004544dbd@mail.gmail.com> Message-ID: On Tue, 03 Jun 2008 20:25:29 +0400, Vladislav Vorobiev wrote: > If a question mark in the URL is not how it works before. Whether it is > a bug or so extra made no idea. I climb onto your proposal. I cannot understand your first sentence about the question mark in the url. I have the feeling that you are trying to do something with kss that it currently cannot do. On the other hand if you really told us about your use case (I mean not your implementation ideas and difficulties, but the original task that you want to achieve), it may turn out that there is a simple solution that does not require these hacks. We never encountered a use case in which it makes sense to use a dynamic url, so I would wonder what your use case is, and if this is really the best way to do it. -- Balazs Ree From gotcha at bubblenet.be Wed Jun 4 09:15:43 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Wed, 04 Jun 2008 09:15:43 +0200 Subject: [Kss-devel] turn off ?kukitTimeStamp In-Reply-To: <604c02230806030925w72dbe941sd6f350d004544dbd@mail.gmail.com> References: <604c02230806030557x6309fd97s8c33ff9100533d33@mail.gmail.com> <484542A3.5040902@bubblenet.be> <604c02230806030925w72dbe941sd6f350d004544dbd@mail.gmail.com> Message-ID: <4846411F.2000402@bubblenet.be> Vladislav Vorobiev wrote: > > > If a question mark in the URL is not how it works before. Whether it > is a bug or so extra made no idea. I climb onto your proposal. I do not understand the sentences hereabove. -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From ree at ree.hu Thu Jun 5 12:08:26 2008 From: ree at ree.hu (Balazs Ree) Date: Thu, 5 Jun 2008 12:08:26 +0200 Subject: [Kss-devel] API proposal References: <481AF0A3.3070302@pareto.nl> Message-ID: Hi Martijn and All, I was reconsidering all possibilities carefully in the recent period, and I came to the conclusion that we (or actually, mainly, I) ought to give way to the needs of the python developers and allow the access of commandsets in a "more pythonic" and "less kss-like" way, even if this means we loose advantages of centralized support. So according to this, the answer to my original three questions would be the following: 1. Yes, commandsets (and commands) remain a central concept in kss. 2. But: No, we do not support any more the implementation of commandsets in a centralized kss way. It's up to the server/language implementations how they implement commands at all. Python (kss.base) implements its own support, other systems like Zope will need to extend this with additional support. We attempt to give no guideline on implementing commandsets in a server side environment (other than, for example Zope will keep on needing view-like commandsets, so other systems that also need this, can choose to copypaste this code to support their own view-like commandsets.) This is a serious decision for kss, and as I expressed my opinion several times on this subject, it will result in a diversity of methods for defining and using commandsets across different server sides (even zope usage will be a little different from python one, to start with), which will make commandset code less readable for people that do not know that particular server side well, and it will be more difficult to document all kss commandsets in a uniform way (for example, we have to give up including commandsets into the long planned autogenerated documentation as well). I consider this a significant loss, but I cannot figure out any way to satisfy both this requirement and the raised pythonicity needs, at the same time. However I have no doubt either that despite this perceived loss, if we choose this way we will still be able to address all upcoming problems appropriately. 3. The namespace access issue: The commandsets (and commands) will be accessed from python exclusively by their python namespace, which, in return, will not necessarily correspond to the kss namespace (unless, the implementor chooses to follow convention). What's more, the commandsets won't be handled by the kss registry at all. I believe that if this is the road we are following, then we also need to settle about a few other actions (or non-actions): - The kss plugin registry remains placeless as it is currently (ie. a plugin is not forced to be in any specific module) (this makes sense for the javascript files anyway). - but the registry will not handle commandsets at all, so they will be imported directly from python (old commandset registry will be kept only for bbb) - plugin implementors can decide if they keep the commandsets (the plugin) in a subpackage under their application package, or follow the convention and move it to kss.plugin.mynamespace, only in the latter case will the import path of commands correspond to the kss namespace. So the definition of plugins remain the same as currently except we press people to move stuff under kss.plugin. - to lead the convention we suggest, we have to move the core plugin out of kss.base, into kss.plugin.core. This separation is, by the way, useful in general as well, however results in an extra dependency. - as a consequence the import paths in the original API proposal will change like this:: from kss.plugin.core.XXXX import core - as you see in the previous example (XXXX) we also have to create a convention for _where_ to place the commandset(s) inside the plugin module. This would ensure developers find the commandsets in the same location in each plugin. (Previously this problem did not exist because we used registry.) I am not suggesting a particular value for XXXX, just saying that we need a convention. - kss.zope will keep its view-based commandsets and to replace self.getCommandSet() to something similarly convenient but more clear, it can introduce an ICommandSetGetter (?) helper for instantiating the view-based commandsets as well as handle the python-ones in the same manner, so zope applications will keep on having a convenient way to issue commands without importing and instantiating them directly (unless they want) and without the need to differentiate usage between python and zope commandsets So basically: commands usage from Zope based systems won't change significantly although it will also be possible to use the python level API directly as well. However this question can be discussed separately from the main issue, because it will be an autonomous decision of kss.zope. As you see this solution almost entirely agrees the original kss.base commandset API proposal (except in one point, that the core plugin should move to kss.plugin.core) and satisfies several points of Martijn's argument. This makes me hope that it can be found acceptable by all of us. Best wishes, -- Balazs Ree From mymir.org at googlemail.com Tue Jun 17 13:42:16 2008 From: mymir.org at googlemail.com (Vladislav Vorobiev) Date: Tue, 17 Jun 2008 15:42:16 +0400 Subject: [Kss-devel] turn off ?kukitTimeStamp In-Reply-To: References: <604c02230806030557x6309fd97s8c33ff9100533d33@mail.gmail.com> <484542A3.5040902@bubblenet.be> <604c02230806030925w72dbe941sd6f350d004544dbd@mail.gmail.com> Message-ID: <604c02230806170442g4486c92bw2ff4215c30cd060b@mail.gmail.com> Sorry for my late answer. I've been enjoying my vacation. urlMethodAnotherAlias triggers a POST request. It would be great if I could trigger a Get request as well, so that I could code some parameter directly into the URL. In some cases, that would certainly be useful. Vlad 2008/6/4 Balazs Ree : > On Tue, 03 Jun 2008 20:25:29 +0400, Vladislav Vorobiev wrote: > >> If a question mark in the URL is not how it works before. Whether it is >> a bug or so extra made no idea. I climb onto your proposal. > > I cannot understand your first sentence about the question mark in the > url. > > I have the feeling that you are trying to do something with kss that it > currently cannot do. On the other hand if you really told us about your > use case (I mean not your implementation ideas and difficulties, but the > original task that you want to achieve), it may turn out that there is a > simple solution that does not require these hacks. > > We never encountered a use case in which it makes sense to use a dynamic > url, so I would wonder what your use case is, and if this is really the > best way to do it. > > -- > Balazs Ree > > _______________________________________________ > Kss-devel mailing list > Kss-devel at codespeak.net > http://codespeak.net/mailman/listinfo/kss-devel > -- Best Regards Vlad Vorobiev http://www.mymir.org From ree at ree.hu Wed Jun 18 09:36:33 2008 From: ree at ree.hu (Balazs Ree) Date: Wed, 18 Jun 2008 09:36:33 +0200 Subject: [Kss-devel] turn off ?kukitTimeStamp References: <604c02230806030557x6309fd97s8c33ff9100533d33@mail.gmail.com> <484542A3.5040902@bubblenet.be> <604c02230806030925w72dbe941sd6f350d004544dbd@mail.gmail.com> <604c02230806170442g4486c92bw2ff4215c30cd060b@mail.gmail.com> Message-ID: On Tue, 17 Jun 2008 15:42:16 +0400, Vladislav Vorobiev wrote: > Sorry for my late answer. I've been enjoying my vacation. > > urlMethodAnotherAlias triggers a POST request. It would be great if I > could trigger a Get request as well, so that I could code some parameter > directly into the URL. In some cases, that would certainly be useful. It is definitely in the short term plans to implement this, expected to arrive with version 1.5 or 1.6. The core of kss is already prepared for supporting what's needed for this on the level of the KSS syntax. Once the branches waiting for merge in to trunk are merged, I can provide the necessary code changes to make KSS support cacheable requests on a per-action basis. After GET requests will have become available, it will still take an additional effort to support caching strategies (CacheFu ?) for the dynamic KSS requests. -- Balazs Ree From ks.box at gmx.net Wed Jun 18 17:16:56 2008 From: ks.box at gmx.net (Katja Suess) Date: Wed, 18 Jun 2008 17:16:56 +0200 Subject: [Kss-devel] plugin, buildout Message-ID: <0B0B0575-8FCF-49EE-A0F7-D910A3F7C613@gmx.net> hi all i've setup a kss plugin for some action for inline editing the new actions are not available. in buildout.cfg i added the plugin name to [instance] eggs and zcml what did i miss? thanks, katja From gotcha at bubblenet.be Thu Jun 19 09:34:40 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Thu, 19 Jun 2008 09:34:40 +0200 Subject: [Kss-devel] plugin, buildout In-Reply-To: <0B0B0575-8FCF-49EE-A0F7-D910A3F7C613@gmx.net> References: <0B0B0575-8FCF-49EE-A0F7-D910A3F7C613@gmx.net> Message-ID: <485A0C10.6050205@bubblenet.be> Katja Suess wrote: > hi all > i've setup a kss plugin for some action for inline editing > the new actions are not available. in buildout.cfg i added the plugin > name to [instance] eggs and zcml > what did i miss? > thanks, katja I think we need more information... What do you mean by "not available" ? Do you get any error message ? -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From ramon_bartl at yahoo.de Fri Jun 20 11:11:24 2008 From: ramon_bartl at yahoo.de (Ramon Bartl) Date: Fri, 20 Jun 2008 11:11:24 +0200 Subject: [Kss-devel] insertHTMLAsFirstChild with tables Message-ID: Hi all, first of all, I'm not a KSS crack and I tried to KSS-ify a Browser view for the first time! yeah! It is really fun working with KSS, you guys rock! But I'm having a little problem..... I tried to insert a snippet into a table body with insertHTMLAsFirstChild. But unfortunately the tags always get stripped. So the table layout breaks:( My code looks like that: --------------------------------------------------------------------------------------- macros = ViewPageTemplateFile("results_macros.pt").macros wrapper = ViewPageTemplateFile("macro_wrapper.pt") @kssaction def update_live_table(self): ksscore = self.getCommandSet('core') rendered = self.wrapper.render( viewMacro = self.macros['live-table-row'], ) ksscore.insertHTMLAsFirstChild( ksscore.getHtmlIdSelector('live-table-body'), rendered) --------------------------------------------------------------------------------------- ree told me already that the browsers don't allow to do an innerHTML inside a table, but also told me that there is maybe a workaround from __gotcha? Godefroid?;) do you know how to do the browser-innerHTML-table-dance? Thanks a lot! -ramonski From sylvain at infrae.com Fri Jun 20 11:43:33 2008 From: sylvain at infrae.com (Sylvain Viollon) Date: Fri, 20 Jun 2008 11:43:33 +0200 Subject: [Kss-devel] insertHTMLAsFirstChild with tables In-Reply-To: References: Message-ID: <20080620114333.30dfccb7@reddwarf.infrae> On Fri, 20 Jun 2008 11:11:24 +0200 Ramon Bartl wrote: > Hi all, > Hello, > ree told me already that the browsers don't allow to do an innerHTML > inside a table, but also told me that there is maybe a workaround > from __gotcha? > I have done it one time. The trick is to build a table with the same layout (number of cols) containing the line you want to add. You should have the same width for columns as well, maybe, I think. After, you can move the line to the real table, and delete the temporary one. But I don't known howto to do it with KSS, it will be interesting to known. Sylvain, -- Sylvain Viollon -- Infrae t +31 10 243 7051 -- http://infrae.com Hoevestraat 10 3033GC Rotterdam -- The Netherlands From gotcha at bubblenet.be Fri Jun 20 11:45:05 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Fri, 20 Jun 2008 11:45:05 +0200 Subject: [Kss-devel] insertHTMLAsFirstChild with tables In-Reply-To: References: Message-ID: <485B7C21.5080605@bubblenet.be> Ramon Bartl wrote: > Hi all, > > first of all, I'm not a KSS crack and I tried to KSS-ify a Browser > view for the first time! yeah! It is really fun working with KSS, you > guys rock! > > But I'm having a little problem..... > > I tried to insert a snippet into a table body with > insertHTMLAsFirstChild. But unfortunately the tags always get > stripped. So the table layout breaks:( > > My code looks like that: > > --------------------------------------------------------------------------------------- > macros = ViewPageTemplateFile("results_macros.pt").macros > wrapper = ViewPageTemplateFile("macro_wrapper.pt") > > @kssaction > def update_live_table(self): > ksscore = self.getCommandSet('core') > > rendered = self.wrapper.render( > viewMacro = self.macros['live-table-row'], > ) > > ksscore.insertHTMLAsFirstChild( > ksscore.getHtmlIdSelector('live-table-body'), > rendered) > --------------------------------------------------------------------------------------- > > ree told me already that the browsers don't allow to do an innerHTML > inside a table, but also told me that there is maybe a workaround from > __gotcha? > > Godefroid?;) do you know how to do the browser-innerHTML-table-dance? > I have no magic wand for you now ;-) I think we will need to quit using innerHTML and go back to DOM construction. I am afraid that in the meanwhile, you'll need to refresh the full table :-S > Thanks a lot! > > -ramonski -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From ramon_bartl at yahoo.de Fri Jun 20 12:02:05 2008 From: ramon_bartl at yahoo.de (Ramon Bartl) Date: Fri, 20 Jun 2008 12:02:05 +0200 Subject: [Kss-devel] insertHTMLAsFirstChild with tables In-Reply-To: <485B7C21.5080605@bubblenet.be> References: <485B7C21.5080605@bubblenet.be> Message-ID: <8E54A42F-9B1C-4BEE-A59C-E40B97B3FA8A@yahoo.de> Hi Godefroid, > I have no magic wand for you now ;-) It's a pity;) > I think we will need to quit using innerHTML and go back to DOM > construction. > > I am afraid that in the meanwhile, you'll need to refresh the full > table :-S I'm using now div boxes to do the work, there it works fine:) Thanks for your quick response Ramon From gotcha at bubblenet.be Fri Jun 20 14:19:32 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Fri, 20 Jun 2008 14:19:32 +0200 Subject: [Kss-devel] insertHTMLAsFirstChild with tables In-Reply-To: <8E54A42F-9B1C-4BEE-A59C-E40B97B3FA8A@yahoo.de> References: <485B7C21.5080605@bubblenet.be> <8E54A42F-9B1C-4BEE-A59C-E40B97B3FA8A@yahoo.de> Message-ID: <485BA054.5070009@bubblenet.be> Ramon Bartl wrote: > Hi Godefroid, > >> I have no magic wand for you now ;-) > > It's a pity;) > >> I think we will need to quit using innerHTML and go back to DOM >> construction. >> >> I am afraid that in the meanwhile, you'll need to refresh the full >> table :-S > > I'm using now div boxes to do the work, there it works fine:) Much better, except when table is semantically needed ! > > Thanks for your quick response > Ramon -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From ramon_bartl at yahoo.de Fri Jun 20 14:48:04 2008 From: ramon_bartl at yahoo.de (Ramon Bartl) Date: Fri, 20 Jun 2008 14:48:04 +0200 Subject: [Kss-devel] insertHTMLAsFirstChild with tables In-Reply-To: <485BA054.5070009@bubblenet.be> References: <485B7C21.5080605@bubblenet.be> <8E54A42F-9B1C-4BEE-A59C-E40B97B3FA8A@yahoo.de> <485BA054.5070009@bubblenet.be> Message-ID: > Ramon Bartl wrote: >> Hi Godefroid, >>> I have no magic wand for you now ;-) >> It's a pity;) >>> I think we will need to quit using innerHTML and go back to DOM >>> construction. >>> >>> I am afraid that in the meanwhile, you'll need to refresh the full >>> table :-S >> I'm using now div boxes to do the work, there it works fine:) > > Much better, except when table is semantically needed ! A table would actually fit better, because I'm trying to display test results which have columns like: number, tests ok, tests failed, total time so I have to do some css magic now to display the test results exactly among each other.... .... but I have another question, if this is allowed in the kss developer list (probably more a plone users question): I made a
container which gets periodically filled with job results. the HTML looks like this: -----------------------------------------------------------------------
some job results
----------------------------------------------------------------------- The KSS looks like this: ----------------------------------------------------------------------- #job-container:timeout { evt-timeout-delay: 3000; evt-timeout-repeat: True; action-server: live_kss; } ------------------------------------------------------------------------ so every 3 seconds my live_kss gets called which inserts a new
as the first child into my job-container: Finally, here my question: Is it possible in KSS to count the child elements of my job-container to prevent an overflow? Maybe after 5 childs have been added to the container, we start to delete the last child for every new child added? something like: if ksscore.countNodes(ksscore.getHtmlIdSelector('job-container')) > 5: ksscore.deleteNodeBefore( ksscore.getHtmlIdSelector('last-node')) Thanks a lot and sorry if this question don't fits into this mailing list -ramonski From gotcha at bubblenet.be Fri Jun 20 15:37:30 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Fri, 20 Jun 2008 15:37:30 +0200 Subject: [Kss-devel] insertHTMLAsFirstChild with tables In-Reply-To: References: <485B7C21.5080605@bubblenet.be> <8E54A42F-9B1C-4BEE-A59C-E40B97B3FA8A@yahoo.de> <485BA054.5070009@bubblenet.be> Message-ID: <485BB29A.801@bubblenet.be> Ramon Bartl wrote: >> Ramon Bartl wrote: >>> Hi Godefroid, >>>> I have no magic wand for you now ;-) >>> It's a pity;) >>>> I think we will need to quit using innerHTML and go back to DOM >>>> construction. >>>> >>>> I am afraid that in the meanwhile, you'll need to refresh the full >>>> table :-S >>> I'm using now div boxes to do the work, there it works fine:) >> Much better, except when table is semantically needed ! > > A table would actually fit better, because I'm trying to display test > results which have columns like: > > number, tests ok, tests failed, total time > > so I have to do some css magic now to display the test results exactly > among each other.... > > > .... but I have another question, if this is allowed in the kss > developer list (probably more a plone users question): > > I made a
container which gets periodically filled with job > results. > > the HTML looks like this: > ----------------------------------------------------------------------- >
>
some job results
> >
> ----------------------------------------------------------------------- > > The KSS looks like this: > ----------------------------------------------------------------------- > #job-container:timeout { > evt-timeout-delay: 3000; > evt-timeout-repeat: True; > action-server: live_kss; > } > ------------------------------------------------------------------------ > > so every 3 seconds my live_kss gets called which inserts a new
> as the first child into my job-container: > > Finally, here my question: > > Is it possible in KSS to count the child elements of my job-container > to prevent an overflow? > Maybe after 5 childs have been added to the container, we start to > delete the last child for every new child added? > > something like: > > > if ksscore.countNodes(ksscore.getHtmlIdSelector('job-container')) > 5: > ksscore.deleteNodeBefore( > ksscore.getHtmlIdSelector('last-node')) > > > > Thanks a lot and sorry if this question don't fits into this mailing > list It does fit very well the list. With KSS, the server should always be in charge; the client is a view of the server. IOW, the server-side should maintain the number of divs and send back a delete command when it knows it has sent two many divs; > > -ramonski -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From ramon_bartl at yahoo.de Fri Jun 20 15:50:28 2008 From: ramon_bartl at yahoo.de (Ramon Bartl) Date: Fri, 20 Jun 2008 15:50:28 +0200 Subject: [Kss-devel] insertHTMLAsFirstChild with tables In-Reply-To: <485BB29A.801@bubblenet.be> References: <485B7C21.5080605@bubblenet.be> <8E54A42F-9B1C-4BEE-A59C-E40B97B3FA8A@yahoo.de> <485BA054.5070009@bubblenet.be> <485BB29A.801@bubblenet.be> Message-ID: Am 20.06.2008 um 15:37 schrieb Godefroid Chapelle: > Ramon Bartl wrote: >>> Ramon Bartl wrote: >>>> Hi Godefroid, >>>>> I have no magic wand for you now ;-) >>>> It's a pity;) >>>>> I think we will need to quit using innerHTML and go back to DOM >>>>> construction. >>>>> >>>>> I am afraid that in the meanwhile, you'll need to refresh the >>>>> full table :-S >>>> I'm using now div boxes to do the work, there it works fine:) >>> Much better, except when table is semantically needed ! >> A table would actually fit better, because I'm trying to display >> test results which have columns like: >> number, tests ok, tests failed, total time >> so I have to do some css magic now to display the test results >> exactly among each other.... >> .... but I have another question, if this is allowed in the kss >> developer list (probably more a plone users question): >> I made a
container which gets periodically filled with job >> results. >> the HTML looks like this: >> ----------------------------------------------------------------------- >>
>>
some job results
>> >>
>> ----------------------------------------------------------------------- >> The KSS looks like this: >> ----------------------------------------------------------------------- >> #job-container:timeout { >> evt-timeout-delay: 3000; >> evt-timeout-repeat: True; >> action-server: live_kss; >> } >> ------------------------------------------------------------------------ >> so every 3 seconds my live_kss gets called which inserts a new >>
as the first child into my job-container: >> Finally, here my question: >> Is it possible in KSS to count the child elements of my job- >> container to prevent an overflow? >> Maybe after 5 childs have been added to the container, we start to >> delete the last child for every new child added? >> something like: >> >> if ksscore.countNodes(ksscore.getHtmlIdSelector('job-container')) > >> 5: >> ksscore.deleteNodeBefore( >> ksscore.getHtmlIdSelector('last-node')) >> >> Thanks a lot and sorry if this question don't fits into this >> mailing list > > It does fit very well the list. > > With KSS, the server should always be in charge; the client is a > view of the server. > > IOW, the server-side should maintain the number of divs and send > back a delete command when it knows it has sent two many divs; Thanks Godefroid for the fast reply:) I made it now quite simple, I simply added empty div's at the end of my template;)
some job results
so I have stack hight of 5 items and can remove always the last node when I add one.... Maybe some kind of MacGyver solution, but works fine:) cheers ramonski From ree at ree.hu Fri Jun 20 16:30:18 2008 From: ree at ree.hu (Balazs Ree) Date: Fri, 20 Jun 2008 16:30:18 +0200 Subject: [Kss-devel] insertHTMLAsFirstChild with tables References: <485B7C21.5080605@bubblenet.be> Message-ID: On Fri, 20 Jun 2008 11:45:05 +0200, Godefroid Chapelle wrote: > Ramon Bartl wrote: >> ree told me already that the browsers don't allow to do an innerHTML >> inside a table, but also told me that there is maybe a workaround from >> __gotcha? >> >> Godefroid?;) do you know how to do the browser-innerHTML-table-dance? >> >> > I have no magic wand for you now ;-) > > I think we will need to quit using innerHTML and go back to DOM > construction. I think it's worth to elaborate this point a little. We can see from experience that both methods have their problems. There is no silver bullet, and we have to prepare for providing workarounds in the future as well, whichever method we choose - unless some radical change happens in the world of browsers. innerHTML has its merits: it works on all browsers (except for this case which is not covered by the standard), and it is the fastest way of content insertion, according to all benchmarks. For this reason, I believe that we should consider having two methods. Apply the faster innerHTML for most cases, and provide another (slower, but working) method for the special cases like the table rows and others. Best wishes, -- Balazs Ree From gotcha at bubblenet.be Fri Jun 20 16:46:08 2008 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Fri, 20 Jun 2008 16:46:08 +0200 Subject: [Kss-devel] insertHTMLAsFirstChild with tables In-Reply-To: References: <485B7C21.5080605@bubblenet.be> Message-ID: <485BC2B0.6000304@bubblenet.be> Balazs Ree wrote: > On Fri, 20 Jun 2008 11:45:05 +0200, Godefroid Chapelle wrote: > >> Ramon Bartl wrote: > >>> ree told me already that the browsers don't allow to do an innerHTML >>> inside a table, but also told me that there is maybe a workaround from >>> __gotcha? >>> >>> Godefroid?;) do you know how to do the browser-innerHTML-table-dance? >>> >>> >> I have no magic wand for you now ;-) >> >> I think we will need to quit using innerHTML and go back to DOM >> construction. > > I think it's worth to elaborate this point a little. > > We can see from experience that both methods have their problems. > There is no silver bullet, and we have to prepare for providing > workarounds in the future as well, whichever method we choose - unless > some radical change happens in the world of browsers. > > innerHTML has its merits: it works on all browsers (except for this case > which is not covered by the standard), and it is the fastest way of > content insertion, according to all benchmarks. I found benchmarks that show that DOM construction is actually slower but only 10%. Their claim being that most benchmarks forget to take escaping in account which needs to be done somewhere. > > For this reason, I believe that we should consider having two methods. > Apply the faster innerHTML for most cases, and provide another > (slower, but working) method for the special cases like the table rows > and others. In theory, I agree. I just wonder if we can think of all special cases. And if it would not be better to have a functioning system a little slower. You are not supposed to add enormous amount of HTML with Ajax. If you need to change so much HTML, it's maybe worth refreshing the whole page ! > > Best wishes, > > -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be From hedleyroos at gmail.com Sun Jun 22 11:53:37 2008 From: hedleyroos at gmail.com (Hedley Roos) Date: Sun, 22 Jun 2008 11:53:37 +0200 Subject: [Kss-devel] insertHTMLAsFirstChild with tables In-Reply-To: <485BC2B0.6000304@bubblenet.be> References: <485B7C21.5080605@bubblenet.be> <485BC2B0.6000304@bubblenet.be> Message-ID: <776caf8b0806220253l15e99537x7bab0769f468cb17@mail.gmail.com> >ree told me already that the browsers don't allow to do an innerHTML >inside a table, but also told me that there is maybe a workaround from >__gotcha? > >Godefroid?;) do you know how to do the browser-innerHTML-table-dance? > I do have a browser-innerHTML-table-dance that works on all browsers. I'm going to give a full example, but I'll keep it short. This is simplified from a product called Plone4Radio which I'm working on. If you need the source I'll gladly provide. Template chart_edit.pt --------------------------------
Song
browser/kss.py ---------------------- def addSong(self): context = aq_inner(self.context) newid = context.generateUniqueId('Song') context.invokeFactory('Song', newid) song = context._getOb(newid) # xxx: I have a problem with Plone viewlets for some reason, so I call the macro # with my own evalMacro script (which I do not supply in this posting). html = context.evalMacro( 'chart_edit', 'songrow', song=song, include_placeholder=1) """ You'll need to change this code to pass song parameter etc. I don't know how to do this right now :( html = self.wrapper.render( viewMacro = self.macros['live-table-row'], ) """ ksscore = self.getCommandSet('core') selector = ksscore.getHtmlIdSelector('chart-edit-songrow-placeholder') ksscore.replaceHTML(selector, html) return self.render() The only problem I see is that I have a placeholder with NO td's inside, which is technically a violation of HTML standards. And if I totally misunderstood what you were trying to accomplish then sorry! Hedley From hedleyroos at gmail.com Sun Jun 22 11:53:37 2008 From: hedleyroos at gmail.com (Hedley Roos) Date: Sun, 22 Jun 2008 11:53:37 +0200 Subject: [Kss-devel] insertHTMLAsFirstChild with tables In-Reply-To: <485BC2B0.6000304@bubblenet.be> References: <485B7C21.5080605@bubblenet.be> <485BC2B0.6000304@bubblenet.be> Message-ID: <776caf8b0806220253l15e99537x7bab0769f468cb17@mail.gmail.com> >ree told me already that the browsers don't allow to do an innerHTML >inside a table, but also told me that there is maybe a workaround from >__gotcha? > >Godefroid?;) do you know how to do the browser-innerHTML-table-dance? > I do have a browser-innerHTML-table-dance that works on all browsers. I'm going to give a full example, but I'll keep it short. This is simplified from a product called Plone4Radio which I'm working on. If you need the source I'll gladly provide. Template chart_edit.pt --------------------------------
Song
browser/kss.py ---------------------- def addSong(self): context = aq_inner(self.context) newid = context.generateUniqueId('Song') context.invokeFactory('Song', newid) song = context._getOb(newid) # xxx: I have a problem with Plone viewlets for some reason, so I call the macro # with my own evalMacro script (which I do not supply in this posting). html = context.evalMacro( 'chart_edit', 'songrow', song=song, include_placeholder=1) """ You'll need to change this code to pass song parameter etc. I don't know how to do this right now :( html = self.wrapper.render( viewMacro = self.macros['live-table-row'], ) """ ksscore = self.getCommandSet('core') selector = ksscore.getHtmlIdSelector('chart-edit-songrow-placeholder') ksscore.replaceHTML(selector, html) return self.render() The only problem I see is that I have a placeholder with NO td's inside, which is technically a violation of HTML standards. And if I totally misunderstood what you were trying to accomplish then sorry! Hedley