Recently, I tried out KSS (formerly known as Kukit) for the second time. The first time is some time ago. At that time, I just played a little bit with it and I was already very positive about that.
Now, I have a special use case: Update one select field in dependency of another and after both select fields are selected do a search and show the results.
All I can say is: it is so easy, intuitive and non-invasive (just add some ids here and there in your HTML, but this may always a good idea.), so kudos to all involved peoples! As this will go into Plone 3.0, I’m sure it will be the next big milestone of Plone (alone the quick edit and realtime validation features, which will come – among others – with it).
To give you a taste of its ease, following is all I had to add to my kss file:
#form-select-1:change {   action-server: getSubCategories;   getSubCategories-category: currentFormVar();}
#form-select-2:change {   action-server : getResults;   getResults-form: currentForm();}
And here is one of the methods, which is called on the server (the fat is KSS stuff all others is needed anyway):
class AjaxView(AzaxBaseView):
   def getSubCategories(self, category):       """Returns sub categories of given category.       """              tool = getToolByName(self, "my_tool")       for top_category in tool.getTopCategories():           if top_category.id == category:               break                      cm = ICategoryManagement(top_category.getObject())       categories = cm.getCategories()              result = ['<select name="category-2" id="form-select-2">']        result.append('<option>Please Select a Subcategory</option>')                     result.extend(      ['<option value="%s">%s</option>' %       (item.id, item.Title) for item in categories])       result.append('</select>')       IKSSCoreCommands(self).replaceHTML( 'select#form-select-2',             ' '.join(result))       IKSSCoreCommands(self).replaceInnerHTML('div#result', '')              return self.render()
Here is all you need to get started:
- The main page
All stuff you need. Just browse. - The software
As the links on kukit.org seems to be broken. Please note also azazdemo. In the browse folder you will find a lot of helpful examples. - Tutorials
Be a KSS programmer within ten minutes. - Cheat sheet
Implement you own ideas.
Have fun!
Kai Diefenbach: Quick Tip 2: Give KSS a try
Originally from Planet Plone by