ID:263412
 
Code:
mob/createchar
Login()
//DisplayHTML()
src << "<a href='?src=\ref[src];action=dwarf'>Dwarf</a>"
return ..()

Topic(href, href_list[]) // This will handle all of our links
if(usr != src) return
switch(href_list["action"])
if("dwarf")
usr << "You've selected a Dwarf."


Problem description: Here's a simplified version of my problem. And you'll notice that this is almost dead on how it's done in the reference. Anywho, it doesn't pick up that I clicked the link and display the message. I must be overlooking some detail.

The example you have shown should work perfectly fine. If you're displaying the link by using a datum function, make sure you still send the 'src' parameter reference to yourself, and not the actual datum.
Also, don't forget to call ..() at the end of any Topic() you override.
In response to Unknown Person
Well, I'm not using any self defined datums here if that's what you're asking. So I don't believe that's the problem? Or did you mean something else, if so, could you clarify?
In response to tenkuu
I added in the ..() at the end of the proc, and still no output. I hope I haven't found some awkward Topic bug.
In response to Prodigal Squirrel
That's what I meant. Could you show us what your actual implementation of the form is? Your simplified version has no problem, and the problem lies in your actual implementation.
In response to Prodigal Squirrel
Prodigal Squirrel wrote:
I added in the ..() at the end of the proc, and still no output.

What tenkuu meant was to make sure to call ..() in client/Topic(), since client/Topic() is the proc that calls datum/Topic(). If you have anything written in client/Topic(), ..() should be called.
In response to Unknown Person
I haven't yet touched client/Topic()

[EDIT] I've been at it for a while now, and came to the conclusion that it's most definitely not my links or Topic() that is the problem. I copied and pasted the reference's Topic example in, and not even that worked, but it worked when I added to a fresh, new environment. Even though I have no other code that modifies Topic(), not even for the client, could something else client related be affecting this?

I'm going to comment other code out, piece-by-piece, until I pinpoint the area of code that is causing this annoying behavior[/EDIT]
In response to Prodigal Squirrel
Well, commenting everything else out didn't help one bit.

So, I looked at my libraries, and the whole time it was Luduwijk's Key State library that was messing everything up. And I don't even use that library! Geez!

Excuse me while I go get sick.