On Fri, Nov 29, 2013 at 8:43 AM, Stephan Hradek <[email protected]>wrote:

> Hi Jeremy,
>
> Am Freitag, 29. November 2013 08:39:05 UTC+1 schrieb Jeremy Ruston:
>
>>
>> Tiddler names are not unique enough. All it takes is for a tiddler to be
>> displayed twice, which could happen with a hover-preview of a tiddler.
>>
>
> But it's the same tiddler so the same radio buttons? Anyhow… Could you
> please explain about what you meant with  this:
>

But wouldn't that mean that if I've got two sets of radio buttons displayed
as part of two separate renderings of the same tiddler, then the browser
would enforce a restriction such that only one radio button is selected at
once?

The <<qualify>> macro takes a base state tiddler title such as
$:/state/tabs/ and then appends a string that is unique to the combination
of templates and transclusions that led to the display of the current
tiddler. On alpha.15 and earlier, the appended string is a long sequence of
punctuation and tiddler titles. On alpha.16 and above the appended string
is a shortish sequence of digits.

So, your radio buttons would need an optional "group" attribute that would
be set as:

<$radio field="fieldname" value="value" tiddler="title" group=<<qualify
"radio1">>>

The qualified tiddler titles would never actually be created as tiddlers.


>> You should use the same state qualifier mechanism as the other widgets.
>>
>
> It's just that we need to have the same, unique name as many times as we
> have the group of radiobuttons displayed in this one instance of the
> tiddler.
>

A macro to encapsulate creating a group of radio buttons along the lines of
the tabs macro would be useful.


> It would be great could you tell me how I would get such a unique name, as
> I already messed up your checkbox.js to support radio buttons too… Take a
> look at my playground ;)
>
>  Firstly, don't forget that TW5 is a work in progress. Frequently I
>> refactor or add methods to the wiki object to capture common idioms.
>>
>> Here, we probably need to add a method like:
>>
>> wiki.setField(title,fieldName,value)
>>
>
> Would be perfect. Will I be allowed to keep setTextReference as long as we
> don't have it?
>

No, just include the wiki.setField method in your pull request.


> Anyhow, it doesn't duplicate the functionality of text references. Don't
>> forget that text references allow indexed property references. Your code
>> would allow me to pass a tiddler title "##likeThis" which would then get
>> treated wrongly by setTextReference.
>>
>
> Okay… So I think I'll add a "tiddler" attribute and assume the "field"
> attribute is set properly.
>

Cool. I'll add some comments to your pull request. At a quick glance there
is a fair bit of cleaning up to do, I hope you'll not mind being patient
while we get things into shape,

Best wishes

Jeremy



-- 
Jeremy Ruston
mailto:[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to