<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Way of Spark</title>
	<atom:link href="http://wayofspark.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://wayofspark.com</link>
	<description>problèmes et solutions de l&#039;informatique de tous les jours, pour nous, les devs.</description>
	<lastBuildDate>Mon, 30 Aug 2010 07:29:29 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>Comment on Naissance de Way Of Spark by Spark</title>
		<link>http://wayofspark.com/2008/07/11/hello-world/comment-page-1/#comment-2321</link>
		<dc:creator>Spark</dc:creator>
		<pubDate>Mon, 30 Aug 2010 07:29:29 +0000</pubDate>
		<guid isPermaLink="false">http://wayofspark.com/?p=1#comment-2321</guid>
		<description>Check for great cookbook review - &lt;a href=&quot;http://pressurecookercookbook.org/&quot; rel=&quot;nofollow&quot;&gt;Pressure Cooker Cookbook&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Check for great cookbook review &#8211; <a href="http://pressurecookercookbook.org/" rel="nofollow">Pressure Cooker Cookbook</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SmartTextBox by Sakuraba</title>
		<link>http://wayofspark.com/projects/smarttextbox/comment-page-1/#comment-2318</link>
		<dc:creator>Sakuraba</dc:creator>
		<pubDate>Wed, 25 Aug 2010 14:34:37 +0000</pubDate>
		<guid isPermaLink="false">http://wayofspark.com/#comment-2318</guid>
		<description>Another improvement would be to automatically select the first suggestion. That way one can type a few letters, hit enter, type a few letters, hit enter, etc without ever using the keyboard or the mouse. It works like that in Gmail&#039;s recipients-auto-suggestbox and is a very good/fast experience.

I hope I did not sound selfish, I looked through the source and I am willing to help wherever my skills are good enough ;)</description>
		<content:encoded><![CDATA[<p>Another improvement would be to automatically select the first suggestion. That way one can type a few letters, hit enter, type a few letters, hit enter, etc without ever using the keyboard or the mouse. It works like that in Gmail&#8217;s recipients-auto-suggestbox and is a very good/fast experience.</p>
<p>I hope I did not sound selfish, I looked through the source and I am willing to help wherever my skills are good enough <img src='http://wayofspark.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SmartTextBox by Sakuraba</title>
		<link>http://wayofspark.com/projects/smarttextbox/comment-page-1/#comment-2317</link>
		<dc:creator>Sakuraba</dc:creator>
		<pubDate>Wed, 25 Aug 2010 13:46:26 +0000</pubDate>
		<guid isPermaLink="false">http://wayofspark.com/#comment-2317</guid>
		<description>The only way to implement it cleanly is to separate both features.

1) Autoload or explicit flat values -  the default way - utilizes a flat data structure and will work fine for regular use cases just like it is now.

2) An explicit &quot;source&quot; (or any other name) option - advanced mode - that takes the described data structure at startup and does not support autoloading by input textbox. It &quot;persists&quot; the adding/removing just like the default way, but by using a hidden select-tag with selected option values to make it easy to submit a form with a SmartTextBox included. Or if one would go that route, one could add the feature of &quot;autoloading from a select-tag&quot; as well, but maybe that is too much to ask? ;)

I tried to implement the labelFormatter way. I advise against it, because you would need to reformat them not only for display, but also for searching, etc. It is too hairy and really only a bad hack. :)</description>
		<content:encoded><![CDATA[<p>The only way to implement it cleanly is to separate both features.</p>
<p>1) Autoload or explicit flat values &#8211;  the default way &#8211; utilizes a flat data structure and will work fine for regular use cases just like it is now.</p>
<p>2) An explicit &#8220;source&#8221; (or any other name) option &#8211; advanced mode &#8211; that takes the described data structure at startup and does not support autoloading by input textbox. It &#8220;persists&#8221; the adding/removing just like the default way, but by using a hidden select-tag with selected option values to make it easy to submit a form with a SmartTextBox included. Or if one would go that route, one could add the feature of &#8220;autoloading from a select-tag&#8221; as well, but maybe that is too much to ask? <img src='http://wayofspark.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I tried to implement the labelFormatter way. I advise against it, because you would need to reformat them not only for display, but also for searching, etc. It is too hairy and really only a bad hack. <img src='http://wayofspark.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SmartTextBox by Spark</title>
		<link>http://wayofspark.com/projects/smarttextbox/comment-page-1/#comment-2316</link>
		<dc:creator>Spark</dc:creator>
		<pubDate>Tue, 24 Aug 2010 15:31:02 +0000</pubDate>
		<guid isPermaLink="false">http://wayofspark.com/#comment-2316</guid>
		<description>@Sakuraka  : changing the data structure can indeed be tricky for compatibility with the &quot;autoload&quot; feature ( aka load the boxes values from an existing input&#039;s value )
I understand your concern ( and I agree that being able to identify the labels by id would be a nice feature ). But I&#039;m not sure about the best way to implement it without broking ( or making hard to use ) an existing feature.
The label formatter/parser is a solution, but I still find it a little &#039;dirty&#039;.
If you have any idea, I&#039;m listening :-)</description>
		<content:encoded><![CDATA[<p>@Sakuraka  : changing the data structure can indeed be tricky for compatibility with the &#8220;autoload&#8221; feature ( aka load the boxes values from an existing input&#8217;s value )<br />
I understand your concern ( and I agree that being able to identify the labels by id would be a nice feature ). But I&#8217;m not sure about the best way to implement it without broking ( or making hard to use ) an existing feature.<br />
The label formatter/parser is a solution, but I still find it a little &#8216;dirty&#8217;.<br />
If you have any idea, I&#8217;m listening <img src='http://wayofspark.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SmartTextBox by RossMerr</title>
		<link>http://wayofspark.com/projects/smarttextbox/comment-page-1/#comment-2315</link>
		<dc:creator>RossMerr</dc:creator>
		<pubDate>Tue, 24 Aug 2010 15:12:57 +0000</pubDate>
		<guid isPermaLink="false">http://wayofspark.com/#comment-2315</guid>
		<description>I altered the containsValue to this to work with jquery 1.4.1.

        containsValue: function (value) {
            return (jQuery.inArray(value, this.getBoxValues()) &gt; -1);
        },</description>
		<content:encoded><![CDATA[<p>I altered the containsValue to this to work with jquery 1.4.1.</p>
<p>        containsValue: function (value) {<br />
            return (jQuery.inArray(value, this.getBoxValues()) &gt; -1);<br />
        },</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SmartTextBox by Sakuraka</title>
		<link>http://wayofspark.com/projects/smarttextbox/comment-page-1/#comment-2312</link>
		<dc:creator>Sakuraka</dc:creator>
		<pubDate>Mon, 23 Aug 2010 09:15:35 +0000</pubDate>
		<guid isPermaLink="false">http://wayofspark.com/#comment-2312</guid>
		<description>My concern is multi-user-support. Say one users wants to use the smarttextbox to tag an entity while another user is renaming the tags in the administration interface.

In such a scenario the first user could end up with invalid labels and once he submits the tagging-form, the serverside wont &quot;know&quot; the tag names.

This issue is even more complicated in a multi-language environment, where the labels of the smarttextbox autocompletion are translated into different languages at runtime. 

All of this could be avoided if one could get the the Ids of the selected elements instead of the pure labels.

If changing the data structure is not feasible, how about some type of &quot;labelformatter&quot; callback?

$(“#myInput”).smartTextBox({
data: [&#039;1/label1&#039;,&#039;2/label2&#039;],
labelFormatter: function(item){ return item.substring(....)}
});


As a compromise, one could &quot;render the ids into the data&quot; and just format them differently for display in the autocompletion box.</description>
		<content:encoded><![CDATA[<p>My concern is multi-user-support. Say one users wants to use the smarttextbox to tag an entity while another user is renaming the tags in the administration interface.</p>
<p>In such a scenario the first user could end up with invalid labels and once he submits the tagging-form, the serverside wont &#8220;know&#8221; the tag names.</p>
<p>This issue is even more complicated in a multi-language environment, where the labels of the smarttextbox autocompletion are translated into different languages at runtime. </p>
<p>All of this could be avoided if one could get the the Ids of the selected elements instead of the pure labels.</p>
<p>If changing the data structure is not feasible, how about some type of &#8220;labelformatter&#8221; callback?</p>
<p>$(“#myInput”).smartTextBox({<br />
data: ['1/label1','2/label2'],<br />
labelFormatter: function(item){ return item.substring(&#8230;.)}<br />
});</p>
<p>As a compromise, one could &#8220;render the ids into the data&#8221; and just format them differently for display in the autocompletion box.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SmartTextBox by Spark</title>
		<link>http://wayofspark.com/projects/smarttextbox/comment-page-1/#comment-2311</link>
		<dc:creator>Spark</dc:creator>
		<pubDate>Mon, 23 Aug 2010 08:15:34 +0000</pubDate>
		<guid isPermaLink="false">http://wayofspark.com/#comment-2311</guid>
		<description>@sakuraka : I might misunderstand you, but I dont see the big advantage of a structure like 

$(“#myInput”).smartTextBox({
data: [{id:1, label:&#039;label1&#039;}{id:2, label:&#039;label2&#039;}]
});

on a structure like this 

$(“#myInput”).smartTextBox({
data: [&#039;label1&#039;,&#039;label2&#039;]
});

Knowing the only parameters for boxes are the label. Is there something I didnt see ?</description>
		<content:encoded><![CDATA[<p>@sakuraka : I might misunderstand you, but I dont see the big advantage of a structure like </p>
<p>$(“#myInput”).smartTextBox({<br />
data: [{id:1, label:'label1'}{id:2, label:'label2'}]<br />
});</p>
<p>on a structure like this </p>
<p>$(“#myInput”).smartTextBox({<br />
data: ['label1','label2']<br />
});</p>
<p>Knowing the only parameters for boxes are the label. Is there something I didnt see ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SmartTextBox by Sakuraka</title>
		<link>http://wayofspark.com/projects/smarttextbox/comment-page-1/#comment-2310</link>
		<dc:creator>Sakuraka</dc:creator>
		<pubDate>Mon, 23 Aug 2010 08:06:14 +0000</pubDate>
		<guid isPermaLink="false">http://wayofspark.com/#comment-2310</guid>
		<description>Would it be possible to seed your widget using a json data structure? I would love to get a list of selected IDs rather than the straight names.

Something like:

$(&quot;#myInput&quot;).smartTextBox({
 data: [{id:1, label:&#039;label1&#039;}{id:2, label:&#039;label2&#039;}]
});</description>
		<content:encoded><![CDATA[<p>Would it be possible to seed your widget using a json data structure? I would love to get a list of selected IDs rather than the straight names.</p>
<p>Something like:</p>
<p>$(&#8220;#myInput&#8221;).smartTextBox({<br />
 data: [{id:1, label:'label1'}{id:2, label:'label2'}]<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SmartTextBox by Spark</title>
		<link>http://wayofspark.com/projects/smarttextbox/comment-page-1/#comment-2309</link>
		<dc:creator>Spark</dc:creator>
		<pubDate>Sun, 22 Aug 2010 12:15:53 +0000</pubDate>
		<guid isPermaLink="false">http://wayofspark.com/#comment-2309</guid>
		<description>@Daniel Tenner: Wow, thanks for the feedbacks !
Gonna add your fixes on the 1.2.0-rc2.
Still surprised about the bug around containsValue though, I can&#039;t seem to reproduce. Does it appears on any browser ? which version of jQuery are you using ?</description>
		<content:encoded><![CDATA[<p>@Daniel Tenner: Wow, thanks for the feedbacks !<br />
Gonna add your fixes on the 1.2.0-rc2.<br />
Still surprised about the bug around containsValue though, I can&#8217;t seem to reproduce. Does it appears on any browser ? which version of jQuery are you using ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SmartTextBox by Daniel Tenner</title>
		<link>http://wayofspark.com/projects/smarttextbox/comment-page-1/#comment-2308</link>
		<dc:creator>Daniel Tenner</dc:creator>
		<pubDate>Sat, 21 Aug 2010 15:30:53 +0000</pubDate>
		<guid isPermaLink="false">http://wayofspark.com/#comment-2308</guid>
		<description>Alright, to fix the uniqueValues I had to do two things.

First of all, containsValue() was mysteriously broken. I simplified it to use standard javascript: 

  containsValue : function(value) {
    return (this.getBoxValues().include(value));
  },

This still works in IE6 - no need to go through the jQuery $(array), it seems.

Secondly, what still happened at this point was that if the item was already in the list, i.e. was not unique, and the user pressed enter anyway, the form got submitted once again. This was solved by changing onKeyDown on the InputElement class to:


  onKeyDown : function(event){
    if(!this.focused) return;
    if($.inArray(event.keyCode, this.stb.options.submitKeys)&gt;-1 &amp;&amp;
       !this.stb.options.onlyAutocomplete &amp;&amp;
       !(this.stb.options.uniqueValues &amp;&amp; this.stb.containsValue(this.getValue()))) {
      event.preventDefault();
      this.saveAsBox();
    } else {
      if (event.keyCode == 13) {
        event.preventDefault();
      }
    }
  },

(basically, preventDefault if the user presses enter and the item is already in the list).

One last thing I need to fix is to do with the formatting of the autocomplete results/prompt box, but that&#039;s probably purely a CSS fix.

Hope this helps!</description>
		<content:encoded><![CDATA[<p>Alright, to fix the uniqueValues I had to do two things.</p>
<p>First of all, containsValue() was mysteriously broken. I simplified it to use standard javascript: </p>
<p>  containsValue : function(value) {<br />
    return (this.getBoxValues().include(value));<br />
  },</p>
<p>This still works in IE6 &#8211; no need to go through the jQuery $(array), it seems.</p>
<p>Secondly, what still happened at this point was that if the item was already in the list, i.e. was not unique, and the user pressed enter anyway, the form got submitted once again. This was solved by changing onKeyDown on the InputElement class to:</p>
<p>  onKeyDown : function(event){<br />
    if(!this.focused) return;<br />
    if($.inArray(event.keyCode, this.stb.options.submitKeys)&gt;-1 &amp;&amp;<br />
       !this.stb.options.onlyAutocomplete &amp;&amp;<br />
       !(this.stb.options.uniqueValues &amp;&amp; this.stb.containsValue(this.getValue()))) {<br />
      event.preventDefault();<br />
      this.saveAsBox();<br />
    } else {<br />
      if (event.keyCode == 13) {<br />
        event.preventDefault();<br />
      }<br />
    }<br />
  },</p>
<p>(basically, preventDefault if the user presses enter and the item is already in the list).</p>
<p>One last thing I need to fix is to do with the formatting of the autocomplete results/prompt box, but that&#8217;s probably purely a CSS fix.</p>
<p>Hope this helps!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
