From gotcha at bubblenet.be Sun Mar 4 15:04:53 2007 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Sun, 04 Mar 2007 15:04:53 +0100 Subject: [Kss-devel] Save inline form on pressing Escape Message-ID: <45EAD205.2050403@bubblenet.be> Hi I just checked in some code for inline form without save cancel buttons. I have built basic support for Cancel on pressing Escape. Currently, pressing Escape will cancel only if the input has the focus. This might not be enough : I have the feeling that pressing Escape should globally cancel edit forms. It is currently possible to have two (or more) inline forms activated. If we do not want Escape to cancel all inline forms, we need a way to discriminate which form to cancel. I'd like to hear opinions. -- Godefroid Chapelle (aka __gotcha)- BubbleNet http://bubblenet.be From gotcha at bubblenet.be Sun Mar 4 15:14:27 2007 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Sun, 04 Mar 2007 15:14:27 +0100 Subject: [Kss-devel] Global state; was Re: Save inline form on pressing Escape In-Reply-To: <45EAD205.2050403@bubblenet.be> References: <45EAD205.2050403@bubblenet.be> Message-ID: <45EAD443.1090709@bubblenet.be> Godefroid Chapelle wrote: > Hi > > I just checked in some code for inline form without save cancel buttons. > > I have built basic support for Cancel on pressing Escape. > > Currently, pressing Escape will cancel only if the input has the focus. > > This might not be enough : I have the feeling that pressing Escape > should globally cancel edit forms. > > It is currently possible to have two (or more) inline forms activated. > If we do not want Escape to cancel all inline forms, we need a way to > discriminate which form to cancel. > > I'd like to hear opinions. > I have the feeling that we need our events to trigger on stuff more specific than just the node. Jeroen needed to setup some global state like (shift pressed). I wonder if we could not have stuff like this: input:keypress { evt-keypress-keycodes : 27; global-state-inlineform: active; action-server : cancelForm; } This event would trigger only if the right global state is set. This feels like generic functions. This mail is meant to start brainstorming. /me waiting for feedback -- Godefroid Chapelle (aka __gotcha)- BubbleNet http://bubblenet.be From ree at ree.hu Sun Mar 4 15:59:19 2007 From: ree at ree.hu (Balazs Ree) Date: Sun, 4 Mar 2007 15:59:19 +0100 Subject: [Kss-devel] Global state; was Re: Save inline form on pressing Escape References: <45EAD205.2050403@bubblenet.be> <45EAD443.1090709@bubblenet.be> Message-ID: Sun, 04 Mar 2007 15:14:27 +0100 keltez?ssel Godefroid Chapelle azt ?rta: > Godefroid Chapelle wrote: >> Hi >> >> I just checked in some code for inline form without save cancel >> buttons. >> >> I have built basic support for Cancel on pressing Escape. >> >> Currently, pressing Escape will cancel only if the input has the focus. >> >> This might not be enough : I have the feeling that pressing Escape >> should globally cancel edit forms. >> >> It is currently possible to have two (or more) inline forms activated. >> If we do not want Escape to cancel all inline forms, we need a way to >> discriminate which form to cancel. >> >> I'd like to hear opinions. >> >> > I have the feeling that we need our events to trigger on stuff more > specific than just the node. > > Jeroen needed to setup some global state like (shift pressed). > > I wonder if we could not have stuff like this: > > input:keypress { > evt-keypress-keycodes : 27; > global-state-inlineform: active; > action-server : cancelForm; > } > > This event would trigger only if the right global state is set. This > feels like generic functions. The feature is obviously useful, however we may find a better syntax. But in general the following dilemma raises. Do we want to allow this functionality from kss (thus making it more and more complicated), or do we say that for this usage you need advanced plugins? There is a possibility to program this in javascript and it's pretty simple. You can store the "inlineform" variable into "this" from a default action of your event. Then you decide if you trigger another event or not from the code. Then from the kss you can bind the server action to the event it triggers. I admit there is not any useful documentation for this, but there is at least three similar examples. To decide if this given case should be implemented in the kss level (actions, statevars) or in a plugin (custom event and this.xxx) mainly decides if this is a one-time feature or rather a component. If it is a component we should make it as a component or we'll end up copypasting long kss rules from one file to another. (A more lightweight way of doing it would be just make a generic condition possible, and that condition would be evaluated in the same way as parameters are, using the provider functions. But this has other disadvantages in terms of complicating things. Then we really end up with expressions as parameter values.) Maybe, Jeroen would end up making it as an event plugin anyway and we would not need the new feature then? Maybe we could turn this into a generic "condition" event? -- Balazs Ree From jc at upfrontsystems.co.za Tue Mar 6 11:53:20 2007 From: jc at upfrontsystems.co.za (JCBrand) Date: Tue, 06 Mar 2007 12:53:20 +0200 Subject: [Kss-devel] Anchor tag with an image and no text is ignored by kss. Message-ID: <45ED4820.7030902@upfrontsystems.co.za> Hi all, I'm using Azax for plone. http://plone.org/products/PloneAzax I have the following kss declaration in my *.kss file: a.remove-buddy:click { evt-click-preventdefault: True; action-client: alert; } and in my page template I have the following: . Contact My problem is that if I don't have any text in the anchor tag, then kukit/kss doesn't replace the default event with the action-client alert event as specified in my kss file. What I think is happening is that the anchor isn't registered or parsed correctly by the kss parser. I'm guessing that this is a bug, since I would expect kss to work on an anchor if it contains just an image and not any text. My javascript skills aren't that great but I would be happy to try and fix this. Can anyone direct me to a file and/or function that is responsible for making this work? I'm guessing it's one of the javascript files in Products/azax/kukit/kukit/ . Thanks in advance for any help. JC Brand From gotcha at bubblenet.be Tue Mar 6 12:00:51 2007 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 06 Mar 2007 12:00:51 +0100 Subject: [Kss-devel] Anchor tag with an image and no text is ignored by kss. In-Reply-To: <45ED4820.7030902@upfrontsystems.co.za> References: <45ED4820.7030902@upfrontsystems.co.za> Message-ID: <45ED49E3.1000801@bubblenet.be> JCBrand wrote: > Hi all, > > I'm using Azax for plone. http://plone.org/products/PloneAzax > > I have the following kss declaration in my *.kss file: > > a.remove-buddy:click { > evt-click-preventdefault: True; > action-client: alert; > } > > and in my page template I have the following: > > > . > Contact > > > My problem is that if I don't have any text in the anchor tag, then > kukit/kss doesn't replace the default event > with the action-client alert event as specified in my kss file. What I > think is happening is that the anchor isn't registered or parsed > correctly by the kss parser. I'm guessing that this is a bug, since I > would expect kss > to work on an anchor if it contains just an image and not any text. > > My javascript skills aren't that great but I would be happy to try and > fix this. Can anyone direct me to a file and/or > function that is responsible for making this work? I'm guessing it's one > of the javascript files in Products/azax/kukit/kukit/ . > > Thanks in advance for any help. > JC Brand > Is this happening in all browsers ? It feels like a browser bug at first sight... -- Godefroid Chapelle (aka __gotcha)- BubbleNet http://bubblenet.be From jc at upfrontsystems.co.za Tue Mar 6 12:41:38 2007 From: jc at upfrontsystems.co.za (JCBrand) Date: Tue, 06 Mar 2007 13:41:38 +0200 Subject: [Kss-devel] Anchor tag with an image and no text is ignored by kss. In-Reply-To: <45ED49E3.1000801@bubblenet.be> References: <45ED4820.7030902@upfrontsystems.co.za> <45ED49E3.1000801@bubblenet.be> Message-ID: <45ED5372.6040704@upfrontsystems.co.za> Godefroid Chapelle wrote: > > Is this happening in all browsers ? > > It feels like a browser bug at first sight... I tested it in epiphany 2.16.1, firefox 2.0 and Internet explorer 6. They're all consistent, so I don't think it's a browser bug. From jc at upfrontsystems.co.za Tue Mar 6 14:33:31 2007 From: jc at upfrontsystems.co.za (JCBrand) Date: Tue, 06 Mar 2007 15:33:31 +0200 Subject: [Kss-devel] Anchor tag with an image and no text is ignored by kss. In-Reply-To: <91b13c310703060420q371fbe01x7ec412fcbe4866af@mail.gmail.com> References: <45ED4820.7030902@upfrontsystems.co.za> <91b13c310703060420q371fbe01x7ec412fcbe4866af@mail.gmail.com> Message-ID: <45ED6DAB.4020403@upfrontsystems.co.za> rae l wrote: > I think you could try this and omit the font tag: > > a.remove-buddy img:click { > evt-click-preventdefault: True; > action-client: alert; > } Thanks a lot, it worked! You made my day. :-) From hedley at upfrontsystems.co.za Wed Mar 7 13:57:29 2007 From: hedley at upfrontsystems.co.za (Hedley Roos) Date: Wed, 07 Mar 2007 14:57:29 +0200 Subject: [Kss-devel] Trigger onchange event on an input programattically Message-ID: <45EEB6B9.6060001@upfrontsystems.co.za> I have a case where using KSS would be overengineering. Basically I have on a form Test and the KSS reacts to a change event for the class someclass. Clicking Test fires the alert 'hello', but the event is not picked up by azax. Manually changing the contents of input foo results in the alert 'hello' and it is picked up by azax. So, how do I get it to work when clicking Test? Hedley From gotcha at bubblenet.be Wed Mar 7 14:24:33 2007 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Wed, 07 Mar 2007 14:24:33 +0100 Subject: [Kss-devel] Trigger onchange event on an input programattically In-Reply-To: <45EEB6B9.6060001@upfrontsystems.co.za> References: <45EEB6B9.6060001@upfrontsystems.co.za> Message-ID: <45EEBD11.8090107@bubblenet.be> Hedley Roos wrote: > I have a case where using KSS would be overengineering. Then why do you want half KSS hereunder ? > > Basically I have on a form > > > > href="#">Test > > and the KSS reacts to a change event for the class someclass. > > Clicking Test fires the alert 'hello', but the event is not picked up by > azax. This is normal : document.getElementById('bar').onchange() explicitely call the onchange function that you defined; it does not trigger the browser event. IOW, it cannot trigger the KSS event handler that has been registered on the event itself > > Manually changing the contents of input foo results in the alert 'hello' > and it is picked up by azax. > > So, how do I get it to work when clicking Test? > > Hedley > _______________________________________________ > Kss-devel mailing list > Kss-devel at codespeak.net > http://codespeak.net/mailman/listinfo/kss-devel -- Godefroid Chapelle (aka __gotcha)- BubbleNet http://bubblenet.be From hedley at upfrontsystems.co.za Wed Mar 7 14:57:03 2007 From: hedley at upfrontsystems.co.za (Hedley Roos) Date: Wed, 07 Mar 2007 15:57:03 +0200 Subject: [Kss-devel] Trigger onchange event on an input programattically In-Reply-To: <45EEBD11.8090107@bubblenet.be> References: <45EEB6B9.6060001@upfrontsystems.co.za> <45EEBD11.8090107@bubblenet.be> Message-ID: <45EEC4AF.8010803@upfrontsystems.co.za> > Then why do you want half KSS hereunder ? Touche :) > explicitely call the onchange function that you defined; it does not > trigger the browser event. > > IOW, it cannot trigger the KSS event handler that has been registered on > the event itself Thanks. I'll try another approach. From hedley at upfrontsystems.co.za Wed Mar 7 15:46:25 2007 From: hedley at upfrontsystems.co.za (Hedley Roos) Date: Wed, 07 Mar 2007 16:46:25 +0200 Subject: [Kss-devel] Trigger onchange event on an input programattically In-Reply-To: <45EEBD11.8090107@bubblenet.be> References: <45EEB6B9.6060001@upfrontsystems.co.za> <45EEBD11.8090107@bubblenet.be> Message-ID: <45EED041.5070208@upfrontsystems.co.za> > > IOW, it cannot trigger the KSS event handler that has been registered on > the event itself > Is there a way to fire the onChange on an html input element from within a Python Script? From gotcha at bubblenet.be Thu Mar 8 12:59:12 2007 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Thu, 8 Mar 2007 05:59:12 -0600 Subject: [Kss-devel] Trigger onchange event on an input programattically In-Reply-To: <45EED041.5070208@upfrontsystems.co.za> References: <45EEB6B9.6060001@upfrontsystems.co.za> <45EEBD11.8090107@bubblenet.be> <45EED041.5070208@upfrontsystems.co.za> Message-ID: Hedley Roos wrote: > > > > > IOW, it cannot trigger the KSS event handler that has been registered on > > the event itself > > > Is there a way to fire the onChange on an html input element from within > a Python Script? No Could you explain your use case with more details so that we can maybe help you ? Godefroid From lewicki at provider.pl Fri Mar 9 00:17:02 2007 From: lewicki at provider.pl (Pawel Lewicki) Date: Fri, 09 Mar 2007 00:17:02 +0100 Subject: [Kss-devel] kss.core + Plone2.5 (zope3.2) Message-ID: Hi, How deeply kss trunk depend on recent Plone/Zope version? I tried to add it to Plone2.5 with pythonproducts support but I get File "D:\Aplikacje\z296\plone\lib\python\kss\core\__init__.py", line 30, in ? from kss.core.azaxview import KSSView, CommandSet File "D:\Aplikacje\z296\plone\lib\python\kss\core\azaxview.py", line 44, in ? from zope.interface.adapter import VerifyingAdapterRegistry ZopeXMLConfigurationError: File "D:\Aplikacje\z296\plone\etc\site.zcml", line 13.2-13.50 ZopeXMLConfigurationError: File "D:\Aplikacje\z296\plone\etc\package-includes\kss.core-meta.zcml", line 2.0-2.47 ImportError: cannot import name VerifyingAdapterRegistry error. Is it one of the few items to fix or backporting requires a lot of work? Pawel From ree at ree.hu Fri Mar 9 07:26:11 2007 From: ree at ree.hu (Balazs Ree) Date: Fri, 9 Mar 2007 07:26:11 +0100 Subject: [Kss-devel] kss.core + Plone2.5 (zope3.2) References: Message-ID: On Fri, 09 Mar 2007 00:17:02 +0100 Pawel Lewicki wrote: > How deeply kss trunk depend on recent Plone/Zope version? I tried to add > it to Plone2.5 with pythonproducts support but I get It is not possible. The main problems why it won't work: - different Zope version, changes in API - totally different version of Archetypes, all templates need to be changed one after the other - there was a full kss namespace change meanwhile You can use the "PloneAzax" 1.1 bundle (kss 1.1 works with Zope 2.9 and Plone 2.5). That is the backport we made once. The svn branch links to the newest javascript code, so you get all client side improvements, however some server side functionality (like server side events) has not existed at the time of the backport. At one point we plan to do a new backport of the development version to Plone 2.5. There is nothing that would disable kss working on Plone 2.5, it's only a lot of work to do the backport and then maintain the branch. In case you'd like to help with backporting the new version (for which, I believe, we should wait at least till beta2) I'd be glad to accept your help. (p.s. the 1.1 branch is used in production servers so at least the core framework is considered to be stable. However we don't have enough free time to do the necessary maintenance.) -- Balazs Ree From lewicki at provider.pl Mon Mar 12 12:48:46 2007 From: lewicki at provider.pl (Pawel Lewicki) Date: Mon, 12 Mar 2007 12:48:46 +0100 Subject: [Kss-devel] kss.core + Plone2.5 (zope3.2) In-Reply-To: References: Message-ID: <45F53E1E.9070801@provider.pl> Balazs Ree napisa?(a): > On Fri, 09 Mar 2007 00:17:02 +0100 Pawel Lewicki wrote: > >> How deeply kss trunk depend on recent Plone/Zope version? I tried to add >> it to Plone2.5 with pythonproducts support but I get > > It is not possible. The main problems why it won't work: > > - different Zope version, changes in API > - totally different version of Archetypes, all templates need to be > changed one after the other > - there was a full kss namespace change meanwhile Hi, I'm aware of all these changes. IMO it would be great if at least backport to Zope2.9/zope3.2 would be available. I guess that there is a number of people who'd be glad to use the most recent kss version inside Plone2.5 (no ajaxification of Plone itself but own products) > > You can use the "PloneAzax" 1.1 bundle (kss 1.1 works with Zope 2.9 and > Plone 2.5). That is the backport we made once. The svn branch links to > the newest javascript code, so you get all client side improvements, > however some server side functionality (like server side events) has not > existed at the time of the backport. > > At one point we plan to do a new backport of the development version to > Plone 2.5. There is nothing that would disable kss working on Plone 2.5, > it's only a lot of work to do the backport and then maintain the branch. > In case you'd like to help with backporting the new version (for which, I > believe, we should wait at least till beta2) I'd be glad to accept your > help. I'm glad to help if capable. Pawel From ree at ree.hu Mon Mar 12 13:26:25 2007 From: ree at ree.hu (Balazs Ree) Date: Mon, 12 Mar 2007 13:26:25 +0100 Subject: [Kss-devel] kss.core + Plone2.5 (zope3.2) References: <45F53E1E.9070801@provider.pl> Message-ID: On Mon, 12 Mar 2007 12:48:46 +0100 Pawel Lewicki wrote: >> It is not possible. The main problems why it won't work: >> >> - different Zope version, changes in API - totally different version of >> Archetypes, all templates need to be changed one after the other >> - there was a full kss namespace change meanwhile > > Hi, > I'm aware of all these changes. IMO it would be great if at least > backport to Zope2.9/zope3.2 would be available. The development trunk should be usable with newest Zope3, as of today. The azax 1.1 branch, although it lacks some functionality, is usable with Zope 2.9 for custom products. This is currently the version that goes deployed in the sites that use it in production. > I guess that there is a > number of people who'd be glad to use the most recent kss version inside > Plone2.5 (no ajaxification of Plone itself but own products) I agree. It will happen one day and we'll look for ways to speed up this process. -- Balazs Ree From hedley at upfrontsystems.co.za Tue Mar 13 10:05:25 2007 From: hedley at upfrontsystems.co.za (Hedley Roos) Date: Tue, 13 Mar 2007 11:05:25 +0200 Subject: [Kss-devel] Trigger onchange event on an input programattically In-Reply-To: References: <45EEB6B9.6060001@upfrontsystems.co.za> <45EEBD11.8090107@bubblenet.be> <45EED041.5070208@upfrontsystems.co.za> Message-ID: <45F66955.1060401@upfrontsystems.co.za> > Could you explain your use case with more details so that we can maybe help > you ? > I have a form which I automatically save upon data entry into a field. The situation is similar to a calendar popup widget and a form field combo, except my widget does not pop up but renders inline. As soon as the user makes a selection on the selection widget my input is visually updated via KSS and a Python script (say foo.py), but then I also want to fire the change event on the input to persist the data. I cannot just call the save code from foo.py since it is not supposed to have knowledge of the application using the widget. Any ideas? From gotcha at bubblenet.be Tue Mar 13 10:41:37 2007 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Tue, 13 Mar 2007 10:41:37 +0100 Subject: [Kss-devel] Trigger onchange event on an input programattically In-Reply-To: <45F66955.1060401@upfrontsystems.co.za> References: <45EEB6B9.6060001@upfrontsystems.co.za> <45EEBD11.8090107@bubblenet.be> <45EED041.5070208@upfrontsystems.co.za> <45F66955.1060401@upfrontsystems.co.za> Message-ID: <45F671D1.3050000@bubblenet.be> Hedley Roos wrote: >> Could you explain your use case with more details so that we can maybe help >> you ? >> > > I have a form which I automatically save upon data entry into a field. > The situation is similar to a calendar popup widget and a form field > combo, except my widget does not pop up but renders inline. As soon as > the user makes a selection on the selection widget my input is visually > updated via KSS and a Python script (say foo.py), but then I also want > to fire the change event on the input to persist the data. > > I cannot just call the save code from foo.py since it is not supposed to > have knowledge of the application using the widget. I am not sure I understand this last sentence... do you mean you are writing a widget, iow generic code that should not know which other widget it collaborates with ? > > Any ideas? -- Godefroid Chapelle (aka __gotcha)- BubbleNet http://bubblenet.be From hedley at upfrontsystems.co.za Tue Mar 13 10:59:24 2007 From: hedley at upfrontsystems.co.za (Hedley Roos) Date: Tue, 13 Mar 2007 11:59:24 +0200 Subject: [Kss-devel] Trigger onchange event on an input programattically In-Reply-To: <45F671D1.3050000@bubblenet.be> References: <45EEB6B9.6060001@upfrontsystems.co.za> <45EEBD11.8090107@bubblenet.be> <45EED041.5070208@upfrontsystems.co.za> <45F66955.1060401@upfrontsystems.co.za> <45F671D1.3050000@bubblenet.be> Message-ID: <45F675FC.3070609@upfrontsystems.co.za> > I am not sure I understand this last sentence... do you mean you are > writing a widget, iow generic code that should not know which other > widget it collaborates with ? Correct From lewicki at provider.pl Tue Mar 13 15:32:46 2007 From: lewicki at provider.pl (Pawel Lewicki) Date: Tue, 13 Mar 2007 15:32:46 +0100 Subject: [Kss-devel] kss.core + Plone2.5 (zope3.2) In-Reply-To: References: <45F53E1E.9070801@provider.pl> Message-ID: <45F6B60E.9010604@provider.pl> Balazs Ree napisa?(a): > On Mon, 12 Mar 2007 12:48:46 +0100 Pawel Lewicki wrote: >>> It is not possible. The main problems why it won't work: >>> >>> - different Zope version, changes in API - totally different version of >>> Archetypes, all templates need to be changed one after the other >>> - there was a full kss namespace change meanwhile >> Hi, >> I'm aware of all these changes. IMO it would be great if at least >> backport to Zope2.9/zope3.2 would be available. > > The development trunk should be usable with newest Zope3, as of today. > > The azax 1.1 branch, although it lacks some functionality, is usable with > Zope 2.9 for custom products. This is currently the version that goes > deployed in the sites that use it in production. > >> I guess that there is a >> number of people who'd be glad to use the most recent kss version inside >> Plone2.5 (no ajaxification of Plone itself but own products) > > I agree. It will happen one day and we'll look for ways to speed up this > process. > Did anyone try to use azax 1.1 bundle for Plone2.5/Zope2.9 with 'pythonproducts' product? I get that error when use both products. Pawel -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: error.txt Url: http://codespeak.net/pipermail/kss-devel/attachments/20070313/561b9822/attachment-0001.txt From ree at ree.hu Tue Mar 13 17:01:49 2007 From: ree at ree.hu (Balazs Ree) Date: Tue, 13 Mar 2007 17:01:49 +0100 Subject: [Kss-devel] kss.core + Plone2.5 (zope3.2) References: <45F53E1E.9070801@provider.pl> <45F6B60E.9010604@provider.pl> Message-ID: Tue, 13 Mar 2007 15:32:46 +0100 keltez?ssel Pawel Lewicki azt ?rta: > Did anyone try to use azax 1.1 bundle for Plone2.5/Zope2.9 with > 'pythonproducts' product? > I get that error when use both products. It seems Products.azax's configure.zcml and meta.zcml is not loaded? The missing directives are defined from there. -- Balazs Ree From ree at ree.hu Mon Mar 19 08:03:34 2007 From: ree at ree.hu (Balazs Ree) Date: Mon, 19 Mar 2007 08:03:34 +0100 Subject: [Kss-devel] the getUtility acquisition issue, fix Message-ID: Hi all, I just posted an article on plone-devel http://thread.gmane.org/gmane.comp.web.zope.plone.devel/14861/focus=14915 about how I fixed the getUtility acquisition error. In short, it's a big problem. The fix itself is a big hack and obviously the problem needs to be addressed properly on the right level, but since this is not a kss related issue (only it manifested here), this is not our main responsibility. The fix itself is here: https://svn.plone.org/svn/collective/plonekss/five.localsitemanager/registry.py Please test it out! (You have to overwrite the relevant file with it.) The problem is, I have no access to the zope svn so I cannot commit it there, maybe someone can help? Don't forget, another sprint is coming in one week and people need to be able to work. The issue opens another question. Obviously, at one point someone committed something to Five / Plone without realizing that it is broken code. This should not have happened at the first place. Did it or did it not break our tests? If no, we need tests against this. If yes, how could this happen, ie. why do people check in code that break tests, and how can we make sure this cannot happen again? -- Balazs Ree From jeroen.vloothuis at xs4all.nl Mon Mar 19 08:59:32 2007 From: jeroen.vloothuis at xs4all.nl (Jeroen Vloothuis) Date: Mon, 19 Mar 2007 08:59:32 +0100 Subject: [Kss-devel] the getUtility acquisition issue, fix In-Reply-To: References: Message-ID: <45FE42E4.3060706@xs4all.nl> Balazs Ree wrote: > The fix itself is here: > https://svn.plone.org/svn/collective/plonekss/five.localsitemanager/registry.py > > Please test it out! (You have to overwrite the relevant file with it.) > Great work, I tested it out and it works a lot better then before the patch. I encountered a few problems though which might not be related to the patch. Reloading of the recent changes portlet does not work anymore. This means that if you edit the description or title of a page (tested with the front page) it no longer reloads itself. Inline editing works but only saves if I change the focus of the field (pressing enter does not change the field). > The issue opens another question. Obviously, at one point someone > committed something to Five / Plone without realizing that it is broken > code. This should not have happened at the first place. > Did it or did it not break our tests? If no, we need tests against this. > If yes, how could this happen, ie. why do people check in code that break > tests, and how can we make sure this cannot happen again? We cannot expect Zope/CMF core people to run the Plone tests when they change things (although in this case a few involved where Plone devs as well). Maybe it would be best to detect changes like this as early as possible? Using the buildbot setup it should be possible to get notifications about breakage a bit sooner then we did now? Also creating selenium tests or other more complete functional tests should help a lot. From kg6hum at gmail.com Tue Mar 20 19:58:57 2007 From: kg6hum at gmail.com (Rob Campbell) Date: Tue, 20 Mar 2007 11:58:57 -0700 Subject: [Kss-devel] Problems changing form fields in Firefox Message-ID: <9c0a06d70703201158h45829963s3fe765114711b9a9@mail.gmail.com> Hello, I have been trying out KSS with Plone 3.0. I would like to have information entered into one field of the join form trigger the population of other fields. I am currently using core.setAttribute() to make the changes. I seem to be having a problem with Firefox showing the updates. Some of the time it does change the value of the fields, but most of the time it doesn't work. Using Firebug I can see that the changes are happening to the HTML, but it doesn't display in the browser and it doesn't show up when 'view page source' is used. Does anyone know why this is happening? Thank you. -- Rob Campbell KG6HUM From ree at ree.hu Wed Mar 21 08:58:57 2007 From: ree at ree.hu (Balazs Ree) Date: Wed, 21 Mar 2007 08:58:57 +0100 Subject: [Kss-devel] Problems changing form fields in Firefox References: <9c0a06d70703201158h45829963s3fe765114711b9a9@mail.gmail.com> Message-ID: On Tue, 20 Mar 2007 11:58:57 -0700 Rob Campbell wrote: > I have been trying out KSS with Plone 3.0. I would like to have > information entered into one field of the join form trigger the > population of other fields. I am currently using core.setAttribute() to > make the changes. I seem to be having a problem with Firefox showing > the updates. Some of the time it does change the value of the fields, > but most of the time it doesn't work. Using Firebug I can see that the > changes are happening to the HTML, but it doesn't display in the browser > and it doesn't show up when 'view page source' is used. Does anyone know > why this is happening? Thank you. It's difficult to tell if we don't know exactly what you are doing. Is it possible to see an example? I'd be further interested in your OS and exact browser version, and if the same error can be reproduced in other browsers. (We can help you checking that if we can install your example ourselves.) -- Balazs Ree From kg6hum at gmail.com Wed Mar 21 21:35:11 2007 From: kg6hum at gmail.com (Rob Campbell) Date: Wed, 21 Mar 2007 13:35:11 -0700 Subject: [Kss-devel] Problems changing form fields in Firefox In-Reply-To: References: <9c0a06d70703201158h45829963s3fe765114711b9a9@mail.gmail.com> Message-ID: <9c0a06d70703211335h33575d40h4f849c05ec3084c4@mail.gmail.com> On 3/21/07, Balazs Ree wrote: > > It's difficult to tell if we don't know exactly what you are doing. Is it > possible to see an example? > > I'd be further interested in your OS and exact browser version, and if > the same error can be reproduced in other browsers. (We can help you > checking that if we can install your example ourselves.) > > -- > Balazs Ree Ok, here is the server side script that I am using. # import Through-The-Web(TTW) API from kss.core.ttwapi import startKSSCommands from kss.core.ttwapi import getKSSCommandSet from kss.core.ttwapi import renderKSSCommands # start a view for commands startKSSCommands(context, context.REQUEST) # add a command core = getKSSCommandSet('core') callsign = form['Callsign'] core.setAttribute('input#fullname', 'value', 'Bob') core.setAttribute('input#email', 'value', 'bob at example.net') content = '

%s

' % (callsign,) core.replaceInnerHTML('#portal-siteactions', content) # render the commands return renderKSSCommands() And in the kss file I have this. div#archetypes-fieldname-Callsign input:blur { action-server: response1; response1-form: currentForm(); } I can tell that it's running response1 since portal-siteactions is being replaced. I can also see in Firebug that the HTML for the page is being changed. I just don't see the change happening on the page, most of the time. It does work from time to time, but the same code doesn't work again later. The browser I am using is Firefox 2.0 on both Windows and Linux. I don't have access to any other browsers right now, but I can try it in IE tonight. I might also download Opera to try it tonight. -- Rob Campbell KG6HUM From hedley at upfrontsystems.co.za Thu Mar 22 10:22:26 2007 From: hedley at upfrontsystems.co.za (Hedley Roos) Date: Thu, 22 Mar 2007 11:22:26 +0200 Subject: [Kss-devel] Problems changing form fields in Firefox In-Reply-To: <9c0a06d70703211335h33575d40h4f849c05ec3084c4@mail.gmail.com> References: <9c0a06d70703201158h45829963s3fe765114711b9a9@mail.gmail.com> <9c0a06d70703211335h33575d40h4f849c05ec3084c4@mail.gmail.com> Message-ID: <46024AD2.2@upfrontsystems.co.za> > content = '

%s

' % (callsign,) > core.replaceInnerHTML('#portal-siteactions', content) I was under the impression you had to do core.replaceInnerHTML(core.getHtmlIdSelector('portal-siteactions'), content) Does that work? From gotcha at bubblenet.be Thu Mar 22 10:26:29 2007 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Thu, 22 Mar 2007 10:26:29 +0100 Subject: [Kss-devel] Problems changing form fields in Firefox In-Reply-To: <46024AD2.2@upfrontsystems.co.za> References: <9c0a06d70703201158h45829963s3fe765114711b9a9@mail.gmail.com> <9c0a06d70703211335h33575d40h4f849c05ec3084c4@mail.gmail.com> <46024AD2.2@upfrontsystems.co.za> Message-ID: <46024BC5.7090507@bubblenet.be> Hedley Roos wrote: >> content = '

%s

' % (callsign,) >> core.replaceInnerHTML('#portal-siteactions', content) > > I was under the impression you had to do > > core.replaceInnerHTML(core.getHtmlIdSelector('portal-siteactions'), content) > > Does that work? Both will work. if you specify a string, it is considered a css selector. What you propose is however slightly more performant in the client as it call getElementById directly. -- Godefroid Chapelle (aka __gotcha)- BubbleNet http://bubblenet.be From crquan at gmail.com Thu Mar 22 11:53:49 2007 From: crquan at gmail.com (rae l) Date: Thu, 22 Mar 2007 18:53:49 +0800 Subject: [Kss-devel] A bug report and the patch about the parentnode selector (a more test included) Message-ID: <91b13c310703220353j64d45d81xa19fa500c77c4b7c@mail.gmail.com> I found the the class in plugins/core/commands.py did not agree with its interface defined in plugins/core/interfaces.py, this is an appreant error. here follows the patch. Index: plugins/core/commands.py =================================================================== --- plugins/core/commands.py (revision 40871) +++ plugins/core/commands.py (working copy) @@ -19,11 +19,11 @@ def getHtmlIdSelector(self, selector): return HtmlIdSelector(selector) - def getSameNodeSelector(self, selector): - return SameNodeSelector(selector) + def getSameNodeSelector(self): + return SameNodeSelector() - def getParentNodeSelector(self): - return ParentNodeSelector() + def getParentNodeSelector(self, selector): + return ParentNodeSelector(selector) # XXX the list is not full: maybe complete them? Index: tests/test_azaxview_core.py =================================================================== --- tests/test_azaxview_core.py (revision 40871) +++ tests/test_azaxview_core.py (working copy) @@ -125,6 +125,20 @@ ''' self.assertCommandsEqual(result, awaited) + def test_parentNode(self): + view = self.createView() + core = view.getCommandSet('core') + selector = core.getParentNodeSelector('div') + core.replaceInnerHTML(selector, 'OK') + result = view.render() + awaited = u'''\ + + OK + +''' + self.assertCommandsEqual(result, awaited) + def afterSetUp(self): KssViewTestCase.afterSetUp(self) self.setDebugRequest() -- ??? ??????????????(http://zopen.cn) ??Zope???(http://czug.org) Tel: 021-22818213 From hedley at upfrontsystems.co.za Thu Mar 22 15:01:43 2007 From: hedley at upfrontsystems.co.za (Hedley Roos) Date: Thu, 22 Mar 2007 16:01:43 +0200 Subject: [Kss-devel] Checkboxes and their passed values Message-ID: <46028C47.7040605@upfrontsystems.co.za> I noticed that a value of a checkbox is always either true or false, instead of the value="bla" attribute. Is this the intended behaviour? From gotcha at bubblenet.be Thu Mar 22 16:24:22 2007 From: gotcha at bubblenet.be (Godefroid Chapelle) Date: Thu, 22 Mar 2007 16:24:22 +0100 Subject: [Kss-devel] Checkboxes and their passed values In-Reply-To: <46028C47.7040605@upfrontsystems.co.za> References: <46028C47.7040605@upfrontsystems.co.za> Message-ID: <46029FA6.8010006@bubblenet.be> Hedley Roos wrote: > I noticed that a value of a checkbox is always either true or false, > instead of the value="bla" attribute. Is this the intended behaviour? This feels like a bug. Can you explain more ? and tell us which version you use ? -- Godefroid Chapelle (aka __gotcha)- BubbleNet http://bubblenet.be From hedley at upfrontsystems.co.za Thu Mar 22 16:31:03 2007 From: hedley at upfrontsystems.co.za (Hedley Roos) Date: Thu, 22 Mar 2007 17:31:03 +0200 Subject: [Kss-devel] Checkboxes and their passed values In-Reply-To: <46029FA6.8010006@bubblenet.be> References: <46028C47.7040605@upfrontsystems.co.za> <46029FA6.8010006@bubblenet.be> Message-ID: <4602A137.20403@upfrontsystems.co.za> Version 1.1.alpha1 In kukit/forms.js grep for checkbox. It occurs only once. You'll see that the radio button handling code is directly below it. I believe checkboxes should be handled exactly the same as radios. From kg6hum at gmail.com Thu Mar 22 19:49:29 2007 From: kg6hum at gmail.com (Rob Campbell) Date: Thu, 22 Mar 2007 11:49:29 -0700 Subject: [Kss-devel] Changing a form selection Message-ID: <9c0a06d70703221149q4b07af59nc2851b3af6badfa8@mail.gmail.com> Hello, What is the best way to change the selected option in a form? Here is an example of the form I am using. The form is being generated by ReMember. Is there a way to change the selection using the licenseClass id? Thank you. -- Rob Campbell KG6HUM From chengrenquan at zopen.cn Fri Mar 23 02:20:17 2007 From: chengrenquan at zopen.cn (=?BIG5?B?tXul9KX+?=) Date: Fri, 23 Mar 2007 09:20:17 +0800 Subject: [Kss-devel] Fwd: A bug report and the patch about the parentnode selector (a more test included) In-Reply-To: <91b13c310703220353j64d45d81xa19fa500c77c4b7c@mail.gmail.com> References: <91b13c310703220353j64d45d81xa19fa500c77c4b7c@mail.gmail.com> Message-ID: <91b13c310703221820u36dd1ea4yac5c6483b7c928d0@mail.gmail.com> I found the the class in plugins/core/commands.py did not agree with its interface defined in plugins/core/interfaces.py, this is an appreant error. here follows the little patch. Index: plugins/core/commands.py =================================================================== --- plugins/core/commands.py (revision 40871) +++ plugins/core/commands.py (working copy) @@ -19,11 +19,11 @@ def getHtmlIdSelector(self, selector): return HtmlIdSelector(selector) - def getSameNodeSelector(self, selector): - return SameNodeSelector(selector) + def getSameNodeSelector(self): + return SameNodeSelector() - def getParentNodeSelector(self): - return ParentNodeSelector() + def getParentNodeSelector(self, selector): + return ParentNodeSelector(selector) # XXX the list is not full: maybe complete them? Index: tests/test_azaxview_core.py =================================================================== --- tests/test_azaxview_core.py (revision 40871) +++ tests/test_azaxview_core.py (working copy) @@ -125,6 +125,20 @@ ''' self.assertCommandsEqual(result, awaited) + def test_parentNode(self): + view = self.createView() + core = view.getCommandSet('core') + selector = core.getParentNodeSelector('div') + core.replaceInnerHTML(selector, 'OK') + result = view.render() + awaited = u'''\ + + OK + +''' + self.assertCommandsEqual(result, awaited) + def afterSetUp(self): KssViewTestCase.afterSetUp(self) self.setDebugRequest() From ree at ree.hu Fri Mar 23 07:29:24 2007 From: ree at ree.hu (Balazs Ree) Date: Fri, 23 Mar 2007 07:29:24 +0100 Subject: [Kss-devel] Changing a form selection References: <9c0a06d70703221149q4b07af59nc2851b3af6badfa8@mail.gmail.com> Message-ID: On Thu, 22 Mar 2007 11:49:29 -0700 Rob Campbell wrote: > What is the best way to change the selected option in a form? Here is > an example of the form I am using. > > > > The form is being generated by ReMember. Is there a way to change the > selection using the licenseClass id? Thank you. I don't understand how the changing of the id could do anything with the selection. But answering to the question, no, I don't remember that we have tried this actually. (Maybe, Christian Klinger did something similar?) Now I just looked up the html specifications, and it says that the initial selection can be set by setting the "selected" attribute on the option tag (or tags) that are selected. However, to see if that works if you change it on an already rendered page, you must try that, and what's more, you need to try it in all the different supported browsers. Because without that you may never know if it would actually work. For example, in IE we run into the problem that if we replace or add one or more option tags (as in the second kss demo), they would not change in the page. So for example on IE the only way to change the options is to replace the entire select, including the select tag itself. It took a long time to figure out this. I am not saying that changing just the selection would raise similar issues but testing this would be essential. Also once it works it would be worth to make a new demo page in the kss demo product, for being able to test this in the automated tests. -- Balazs Ree From cklinger at novareto.de Fri Mar 23 08:50:57 2007 From: cklinger at novareto.de (Christian Klinger) Date: Fri, 23 Mar 2007 08:50:57 +0100 Subject: [Kss-devel] Changing a form selection In-Reply-To: References: <9c0a06d70703221149q4b07af59nc2851b3af6badfa8@mail.gmail.com> Message-ID: <460386E1.2090307@novareto.de> Balazs Ree schrieb: > On Thu, 22 Mar 2007 11:49:29 -0700 Rob Campbell wrote: > > >> What is the best way to change the selected option in a form? Here is >> an example of the form I am using. >> >> >> >> The form is being generated by ReMember. Is there a way to change the >> selection using the licenseClass id? Thank you. >> > > Hi Rob, if i understand you correct, you want change your options in your select box triggerd by an KSS-Event, right? If thats your usecase you can do something like this: (it?s not tested) for x in YOUR_NEW_OPTIONS: result.extend(['' %(x[0],x[1])]) IKSSComands.replaceInnerHTML('licenseClass', ' '.join(result)) But i don?t know if it?s the right way to do it?? hth Christian > I don't understand how the changing of the id could do anything with the > selection. > > But answering to the question, no, I don't remember that we have tried > this actually. (Maybe, Christian Klinger did something similar?) Now I > just looked up the html specifications, and it says that the initial > selection can be set by setting the "selected" attribute on the option > tag (or tags) that are selected. > > However, to see if that works if you change it on an already rendered > page, you must try that, and what's more, you need to try it in all the > different supported browsers. Because without that you may never know if > it would actually work. > > For example, in IE we run into the problem that if we replace or add one > or more option tags (as in the second kss demo), they would not change in > the page. So for example on IE the only way to change the options is to > replace the entire select, including the select tag itself. It took a > long time to figure out this. > > I am not saying that changing just the selection would raise similar > issues but testing this would be essential. Also once it works it would > be worth to make a new demo page in the kss demo product, for being able > to test this in the automated tests. > > From ree at ree.hu Fri Mar 23 09:17:54 2007 From: ree at ree.hu (Balazs Ree) Date: Fri, 23 Mar 2007 09:17:54 +0100 Subject: [Kss-devel] Changing a form selection References: <9c0a06d70703221149q4b07af59nc2851b3af6badfa8@mail.gmail.com> <460386E1.2090307@novareto.de> Message-ID: Fri, 23 Mar 2007 08:50:57 +0100 keltez?ssel Christian Klinger azt ?rta: > Hi Rob, > > if i understand you correct, you want change your options in your select > box triggerd by an KSS-Event, right? > > If thats your usecase you can do something like this: (it?s not tested) > > for x in YOUR_NEW_OPTIONS: > result.extend(['' > %(x[0],x[1])]) > IKSSComands.replaceInnerHTML('licenseClass', ' > '.join(result)) Now, this is what *won't* work, as I just outlined in my previous letter. You must replace the select tag as well, or IE will punish you. See the second kss demo pn how we solved this. But I understood that Rob does not want to do this, he does not want to change the list of actions, but instead he wants to change the current selection. If this is not so, then sorry, I misunderstood. The example that I brought was merely to demonstrate what terrible bugs we have to fight with in various browser implementations, just to be able to do even the most simple things in a cross compatible way. In other words, it seems that we have not tested this yet and since it is a new usecase, we cannot give any specific advice on it, besides that it needs to be tried, and even that if a solution works on one browser does not mean it will work on the others. -- Balazs Ree From joka at jokasis.de Fri Mar 23 13:12:45 2007 From: joka at jokasis.de (Joscha Krutzki) Date: Fri, 23 Mar 2007 13:12:45 +0100 Subject: [Kss-devel] summer of code proposal against Json/Exhibit support for Plone 3.5 Message-ID: <5ac588b10703230512u3e6c147ev7e899aee01d6124b@mail.gmail.com> Hello, I need some help for my google summer of code proposal against Json/Exhibit support for Plone 3.5. Exhibit is a javascript library that takes collective data from a Json file and make fancy stuff like filtering, sorting, timelines oder google maps views. Exhibit ( http://simile.mit.edu/exhibit/) is a subproject of haystack semantic desktop (http://haystack.lcs.mit.edu/). I would like to reuse the jsonserver Zope3 product to generate a Exhibit Json view of objects and to make a plone view with Exhibit filtering for objects. But you are the one who are making the plone javascript framwork, so I need your opinion. Are you planing to support json? Is it a good thing to integrate a json view of content objects in KSS? Is it possible to support the Exhibit library in KSS? greetings Joscha Krutzki -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kss-devel/attachments/20070323/7e63a9b5/attachment.htm From ree at ree.hu Fri Mar 23 16:07:03 2007 From: ree at ree.hu (Balazs Ree) Date: Fri, 23 Mar 2007 16:07:03 +0100 Subject: [Kss-devel] summer of code proposal against Json/Exhibit support for Plone 3.5 References: <5ac588b10703230512u3e6c147ev7e899aee01d6124b@mail.gmail.com> Message-ID: On Fri, 23 Mar 2007 13:12:45 +0100 Joscha Krutzki wrote: > I would like to reuse the jsonserver Zope3 product to generate a Exhibit > Json view of objects > and to make a plone view with Exhibit filtering for objects. > > But you are the one who are making the plone javascript framwork, so I > need your opinion. > Are you planing to support json? I don't have time now at all but I will react to your letter next week. I am also one author of the jsonserver product, I also followed and participated in the discussion of the new jsonrpc working draft's proposal on Zope's side. Json and jsonrpc are supported by kss from the very beginning. This means that if the jsonserver product is detected the transport changes from default xml to the jsonrpc protocol. This is different though from what you aim at. We had different reasons not to spend much time on this issue: 1. We wanted to be as much independent from server side components as possible in the framework, and at the moment XML seemeed a more widespread web standard than json. (This is actually not entirely true any more in my opinion.) 2. It is really totally transparent on the kss application level, what transport is used physically: json or xml. So noone really notices the difference. We could have the possibility to marshall more complex data types with json in the transport (kss commands), but then we would be locked to use json from that moment, and loose xml. If we wanted to add the handling of complex variables to xml otoh, we would end up reimplementing json which is pretty pointless so here is one point where json may come back. I believe recently we removed the json support from kss because it did not seem to have any interest to maintain it and it costed too much work. On the other hand using json on different other levels in kss may make lots of sense. > Is it a good thing to integrate a json view of content objects in KSS? > Is it possible to support the Exhibit library in KSS? I cannot react to this because I would need much more time to answer. Mainly I have to look at Exhibit. So please in case I forget to react, let me remember, and let's get back to this soon. -- Balazs Ree From joka at jokasis.de Fri Mar 23 16:53:57 2007 From: joka at jokasis.de (Joscha Krutzki) Date: Fri, 23 Mar 2007 16:53:57 +0100 Subject: [Kss-devel] summer of code proposal against Json/Exhibit support for Plone 3.5 In-Reply-To: References: <5ac588b10703230512u3e6c147ev7e899aee01d6124b@mail.gmail.com> Message-ID: <5ac588b10703230853s3da92dfcs25963425a12697f4@mail.gmail.com> Thanks for the quick answer, Joscha Krutzki 2007/3/23, Balazs Ree : > > On Fri, 23 Mar 2007 13:12:45 +0100 Joscha Krutzki wrote: > > > I would like to reuse the jsonserver Zope3 product to generate a Exhibit > > Json view of objects > > and to make a plone view with Exhibit filtering for objects. > > > > But you are the one who are making the plone javascript framwork, so I > > need your opinion. > > Are you planing to support json? > > I don't have time now at all but I will react to your letter next week. > > I am also one author of the jsonserver product, I also followed and > participated in the discussion of the new jsonrpc working draft's > proposal on Zope's side. Json and jsonrpc are supported by kss from the > very beginning. This means that if the jsonserver product is detected the > transport changes from default xml to the jsonrpc protocol. This is > different though from what you aim at. > > We had different reasons not to spend much time on this issue: > > 1. We wanted to be as much independent from server side components as > possible in the framework, and at the moment XML seemeed a more > widespread web standard than json. (This is actually not entirely true > any more in my opinion.) > > 2. It is really totally transparent on the kss application level, what > transport is used physically: json or xml. So noone really notices the > difference. We could have the possibility to marshall more complex data > types with json in the transport (kss commands), but then we would be > locked to use json from that moment, and loose xml. If we wanted to add > the handling of complex variables to xml otoh, we would end up > reimplementing json which is pretty pointless so here is one point where > json may come back. > > I believe recently we removed the json support from kss because it did > not seem to have any interest to maintain it and it costed too much work. > > On the other hand using json on different other levels in kss may make > lots of sense. > > > Is it a good thing to integrate a json view of content objects in KSS? > > Is it possible to support the Exhibit library in KSS? > > I cannot react to this because I would need much more time to answer. > Mainly I have to look at Exhibit. So please in case I forget to react, > let me remember, and let's get back to this soon. > > -- > Balazs Ree > > _______________________________________________ > Kss-devel mailing list > Kss-devel at codespeak.net > http://codespeak.net/mailman/listinfo/kss-devel > -- Joscha Krutzki Adalbertstr. 73 10997 Berlin 030/63226730 0179/7466360 [ Link zur Vcard: http://jokasis.de/Joscha_Krutzki.vcf ] -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kss-devel/attachments/20070323/11f7cbc1/attachment-0001.htm From kg6hum at gmail.com Fri Mar 23 17:39:29 2007 From: kg6hum at gmail.com (Rob Campbell) Date: Fri, 23 Mar 2007 09:39:29 -0700 Subject: [Kss-devel] Changing a form selection In-Reply-To: References: <9c0a06d70703221149q4b07af59nc2851b3af6badfa8@mail.gmail.com> Message-ID: <9c0a06d70703230939u3f619acfm3770c53c7ff4a5db@mail.gmail.com> On 3/22/07, Balazs Ree wrote: > > I don't understand how the changing of the id could do anything with the > selection. > > But answering to the question, no, I don't remember that we have tried > this actually. (Maybe, Christian Klinger did something similar?) Now I > just looked up the html specifications, and it says that the initial > selection can be set by setting the "selected" attribute on the option > tag (or tags) that are selected. > > However, to see if that works if you change it on an already rendered > page, you must try that, and what's more, you need to try it in all the > different supported browsers. Because without that you may never know if > it would actually work. > > For example, in IE we run into the problem that if we replace or add one > or more option tags (as in the second kss demo), they would not change in > the page. So for example on IE the only way to change the options is to > replace the entire select, including the select tag itself. It took a > long time to figure out this. > > I am not saying that changing just the selection would raise similar > issues but testing this would be essential. Also once it works it would > be worth to make a new demo page in the kss demo product, for being able > to test this in the automated tests. > > -- > Balazs Ree Thank you for the information. Is there a way to get the current options through kss? I could use replaceHtml(), but I wouldn't want to hardcode the options since they may change. I didn't see any commands in kss that could read in the options so I could modify them. -- Rob Campbell KG6HUM From hedley at upfrontsystems.co.za Sun Mar 25 14:13:15 2007 From: hedley at upfrontsystems.co.za (Hedley Roos) Date: Sun, 25 Mar 2007 14:13:15 +0200 Subject: [Kss-devel] Changing a form selection In-Reply-To: <9c0a06d70703230939u3f619acfm3770c53c7ff4a5db@mail.gmail.com> References: <9c0a06d70703221149q4b07af59nc2851b3af6badfa8@mail.gmail.com> <9c0a06d70703230939u3f619acfm3770c53c7ff4a5db@mail.gmail.com> Message-ID: <4606675B.90802@upfrontsystems.co.za> > Thank you for the information. Is there a way to get the current > options through kss? I could use replaceHtml(), but I wouldn't want > to hardcode the options since they may change. I didn't see any > commands in kss that could read in the options so I could modify them. > I assume you already use a tal:loop in your template to iterate over the options. As far as I know you cannot pass the entire html select snippet through KSS, and that is bad design in any case. What I do is to put a matal:macro around my tal:loop in the page template, then from within my Python script I call that macro to obtain the new options as html, and then I pass that html back with core.replaceInnerHTML for the select tag. The benefit is template re-use and you do not pollute your script with markup. If you need an example let me know.