Finally I found the matching chapter in the Dojo documentation.
So for everybody's info and completion of this thread:

You can pass parameters to topics with something like

<a onclick="dojo.event.topic.publish('documentSelected', {ID: ${ID}, Kind: 
'${Kind}' }); return false">
        <s:property value="Name" />
</a>

With that call you can access the properties, of the object passed to the 
notified function like
dojo.event.topic.subscribe("documentSelected", function documentSelected(doc) {
        dojo.io.bind({
            url: "<s:url value='DocumentViewer.action' 
/>?DocumentId="+doc.ID+"&DocumentType="+doc.Kind,
            load: function(type, data, evt) {
                var divDisplay = dojo.byId("documentContent");
                divDisplay.innerHTML=data;
            },
            mimeType: "text/html"
        });
    });

Maybe that helps someone else and thanks again Musachy!
Regards
Jan

-----Ursprüngliche Nachricht-----
Von: Musachy Barroso [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 18. Juni 2008 16:55
An: Struts Users Mailing List
Betreff: Re: Notify topics in struts2.1.2

Pushing my memory to the limit: I think it is the DOM object (in this
case the anchor), that triggered the topic. You can also pass
parameters to topics, check Dojo's documentation.

musachy

On Wed, Jun 18, 2008 at 10:51 AM, Jan Froehlich
<[EMAIL PROTECTED]> wrote:
> Perfect, that solves most of the problems I had.
> Thank you!!!
> - but one thing is finally left. ;)
>
> When I subscribe to a topic with something like
> dojo.event.topic.subscribe("documentSelected", function documentSelected(doc) 
> {
>        alert(doc);
> });
> then doc is a object. What kind of object is that, when I notify the topic 
> from a common <a ...> tag?
>
> Kind regards
> Jan
>
> -----Ursprüngliche Nachricht-----
> Von: Musachy Barroso [mailto:[EMAIL PROTECTED]
> Gesendet: Mittwoch, 18. Juni 2008 16:26
> An: Struts Users Mailing List
> Betreff: Re: Notify topics in struts2.1.2
>
> Well, now I see something I missed before. notifyTopics are triggered
> when an "ajax" request is done, which is not the case here (there is
> no href), so I think the topics won't be triggered in that case. One
> of the many things you can do is:
>
> <a onclick="dojo.event.topic.publish('documentSelected'); return false">....
>
> You are not really taking advantage of the functionality of the <sx:a
> tag, so you can use a regular anchor for that part.
>
> musachy
>
> On Wed, Jun 18, 2008 at 9:58 AM, Jan Froehlich
> <[EMAIL PROTECTED]> wrote:
>> Hi Musachy,
>>
>> thanks for that hint, I tried both, but if you say that it doesn't matter I 
>> might have another problem - it worked with neither solution.
>>
>> Do you think that
>> <sx:a notifyTopics="documentSelected"><s:property value="Name" /></sx:a>
>> should be enough to trigger that topic update??
>>
>> Thanks in advance!
>> Regards
>> Jan Froehlich
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Musachy Barroso [mailto:[EMAIL PROTECTED]
>> Gesendet: Mittwoch, 18. Juni 2008 15:21
>> An: Struts Users Mailing List
>> Betreff: Re: Notify topics in struts2.1.2
>>
>> I don't think it really matters where you put the code (topic
>> subscription), but it will be easier to put it in the main page that
>> has the tree.
>>
>> musachy
>>
>> On Wed, Jun 18, 2008 at 5:32 AM, Jan Froehlich
>> <[EMAIL PROTECTED]> wrote:
>>> Hi,
>>>
>>> I need a little hint how I can achieve the following...
>>> Right now I got a page with a <sx:tree ...> where the user can browse
>>> categories. When a node is clicked a <div id="documentList" ...> loads
>>> another page with a listing of documents in that category. (Just like in
>>> the showcase example but with a little more information in the div)
>>> Every document(-link) should notify another topic that forces a third
>>> <div id="documentContent" ..."> in the page to show the content of the
>>> document.
>>>
>>> And thats where my problem occurs. In the document list I got the
>>> following link for every document
>>>
>>> <sx:a notifyTopics="documentSelected"><s:property value="Name" /></sx:a>
>>>
>>> Where should I place the code? In the page where the tree and the divs
>>> are, or in the page that is loaded after selecting a node?
>>>
>>>    dojo.event.topic.subscribe("documentSelected", function
>>> documentSelected(node) {
>>>                alert(node);
>>>    });
>>>
>>> And maybe more important - I derived the subscribe code from the
>>> nodeSelected example - is it correct that this function has also just
>>> one parameter???
>>>
>>> Any help apreciated!
>>>
>>> Regards
>>> Jan Froehlich
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to