You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jan Fröhlich <Ja...@infomotion.de> on 2009/07/07 16:55:00 UTC

[S2.1.2] sx:div targets

Hi all,

I've seen this topic beeing discussed several times already, but I didn't find a solution that works for me.

What I already got:
I invoke an action with a sx:a (targets="dialogContainer"). The action opens a document and has two possible return values: "prompt" and "download".
"prompt" means, that there are several information necessary before the document can be downloaded. It is type="tiles".
"download" means, that the document is ready for download. It is type="stream".

On the "prompt" page is a finish button, that has no targets set, so the download starts fine.
If the action returns "download" immediately it shows the stream in the specified "dialogContainer".

What I need is to modify the targets value out of my action.

I tried it from within the action and with an interceptor, but it seems like I can't access the "targets" in the ValueStack.
Another way I tried, was to use afterNotifyTopics and redirect the data to what I want - but that didn't work either. (Problem with the stream result)

Can someone give me a hint, how I can possibly solve it?
I even thought about modifying the freemarker template for the anchor tag - but I couldn't find the right spot, where to do it.

Any help appreciated!

Kind regards
Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


AW: AW: [S2.1.2] sx:div targets AKA sx:a targets

Posted by Jan Fröhlich <Ja...@infomotion.de>.
Hi musachy,

oops - I thought I sent the mail just to Martin. :D

However with that mail I just wanted to explained to him, what my problem is - cause I thought he might have misunderstood what I mean.
What I think is, that there is no way to achieve what I want to do.

Guess that's what you are telling me too!

Thanks so far!

Jan

-----Ursprüngliche Nachricht-----
Von: Musachy Barroso [mailto:musachy@gmail.com] 
Gesendet: Mittwoch, 8. Juli 2009 16:52
An: Struts Users Mailing List
Betreff: Re: AW: [S2.1.2] sx:div targets AKA sx:a targets

Trust me, it is not a language problem.

musachy

2009/7/8 Jan Fröhlich <Ja...@infomotion.de>:
> Hallo Martin,
>
> if I see that right, you speak german too - so lets make it a little easier - if not - just ignore the rest of the message! ;)
>
> Das Ganze ist ein bisschen komplizierter als das Ändern des Mime Types.
>
> Um das ganze mal ein bisschen detailierter zu umreißen - ist mir im englischen zu kompliziert:
>
> Ich rufe eine Action auf, die sich solange selbst aufruft und ein tiles Ergebnis zurückliefert bis alle notwendigen Eingaben vorgenommen sind.
> Im Code sieht der Aufruf etwa so aus:
> <s:iterator value="documents" var="document">
>        <s:url var="urlOpenDoc" action>
>                <s:param name="documentId" value="#document.id" />
>        </s:url>
>        <sx:a href="${urlOpenDoc}" targets="dialogContainer"><s:property value="#document.name" /></s:a>
> </s:iterator>
>
> Solange ich ein Tile als Ergebnis bekomme ist alles schön und gut. Das wird korrekt dargestellt.
> Wenn aber alle Eingaben erledigt sind, liefert die Action ein Stream result zurück.
>                        <result name="download" type="stream">
>                                <param name="contentType">application/octet-stream</param>
>                                <param name="inputName">inputStream</param>
>                                <param name="contentDisposition">filename="${fileName}"</param>
>                                <param name="bufferSize">1024</param>
>                        </result>
> Das ist schon entsprechend Konfiguriert um eine Datei zum Download anzubieten.
> Problem an der Stelle ist dann nur, dass der Aufruf über Ajax erfolgt und als Target immer noch den dialogContainer hat.
> Der Stream wird also im dialogContainer angezeigt, aber nicht als Download.
>
> Ich muss also irgendwie aus der Action heraus sagen - hey - das ist kein tile, das ist ein Download - also geh nicht in das Target, sondern geh in das "Fenster" und zeig mir den Download Dialog.
>
> Ist glaube ich immer noch recht chaotisch und unverständlich, aber vielleicht wird jetzt etwas deutlicher, was genau ich für ein Problem hab.
>
> Vielen Dank auf jeden Fall!!
>
> Viele Grüße
> Jan
>
> -----Ursprüngliche Nachricht-----
> Von: Martin Gainty [mailto:mgainty@hotmail.com]
> Gesendet: Mittwoch, 8. Juli 2009 15:05
> An: Struts Users Mailing List
> Betreff: RE: AW: [S2.1.2] sx:div targets AKA sx:a targets
>
>
> early here in EDT so I'll make the suggestion for the Action class changing the ContentType
> FileUploadAction.setContentType("application/octet-stream");
>
> mit freundlichen Grüßen
> Martin
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>
>
>
>
>
>> Subject: AW: [S2.1.2] sx:div targets AKA sx:a targets
>> Date: Wed, 8 Jul 2009 12:08:26 +0200
>> From: Jan.Froehlich@infomotion.de
>> To: user@struts.apache.org
>>
>> Martin & Musachy, thank you for your replies.
>>
>> @Martin, sorry that I couldn't make it that clear - "dialogContainer" is a div that is embedded in my page.
>>
>> @Musachy
>> I did some more research, and I guess I can't solve it in any way.
>> If my action returns "prompt" (tiles) it works like a charm and updates my "dialogContainer" with the specified tile.
>> But when it returns "download" (stream) it doesn't matter (afaik) which targets I define, cause an ajax request wont start a file download in any case.
>>
>> What could solve my problem is something like a javascript, that takes the returned stream from the action and instead of updating the targets-component it should change the mime type to application/octet-stream and writes it (maybe) to a new window.
>>
>> Hope its now understandable what I need to do! ;)
>>
>> Thanks again!
>>
>> Kind regards
>> Jan
>>
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Musachy Barroso [mailto:musachy@gmail.com]
>> Gesendet: Dienstag, 7. Juli 2009 20:14
>> An: Struts Users Mailing List
>> Betreff: Re: [S2.1.2] sx:div targets AKA sx:a targets
>>
>> targets can be set like anything else, with an ognl expression, like
>>
>> <s:a .... targets="%{targets}" ..
>>
>> then you need a getTargets() method in your action. Is that what you
>> need? or you need to modify the targets on the client side, meaning in
>> javascript?
>>
>> musachy
>>
>> 2009/7/7 Jan Fröhlich <Ja...@infomotion.de>:
>> > Wrong subject! ;)
>> >
>> > ________________________________
>> >
>> > Von: Jan Fröhlich [mailto:Jan.Froehlich@infomotion.de]
>> > Gesendet: Di 07.07.2009 16:55
>> > An: Struts Users Mailing List
>> > Betreff: [S2.1.2] sx:div targets
>> >
>> >
>> >
>> > Hi all,
>> >
>> > I've seen this topic beeing discussed several times already, but I didn't find a solution that works for me.
>> >
>> > What I already got:
>> > I invoke an action with a sx:a (targets="dialogContainer"). The action opens a document and has two possible return values: "prompt" and "download".
>> > "prompt" means, that there are several information necessary before the document can be downloaded. It is type="tiles".
>> > "download" means, that the document is ready for download. It is type="stream".
>> >
>> > On the "prompt" page is a finish button, that has no targets set, so the download starts fine.
>> > If the action returns "download" immediately it shows the stream in the specified "dialogContainer".
>> >
>> > What I need is to modify the targets value out of my action.
>> >
>> > I tried it from within the action and with an interceptor, but it seems like I can't access the "targets" in the ValueStack.
>> > Another way I tried, was to use afterNotifyTopics and redirect the data to what I want - but that didn't work either. (Problem with the stream result)
>> >
>> > Can someone give me a hint, how I can possibly solve it?
>> > I even thought about modifying the freemarker template for the anchor tag - but I couldn't find the right spot, where to do it.
>> >
>> > Any help appreciated!
>> >
>> > Kind regards
>> > Jan
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>> >
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
> _________________________________________________________________
> Windows Live(tm) SkyDrive(tm): Get 25 GB of free online storage.
> http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: AW: [S2.1.2] sx:div targets AKA sx:a targets

Posted by Musachy Barroso <mu...@gmail.com>.
Trust me, it is not a language problem.

musachy

2009/7/8 Jan Fröhlich <Ja...@infomotion.de>:
> Hallo Martin,
>
> if I see that right, you speak german too - so lets make it a little easier - if not - just ignore the rest of the message! ;)
>
> Das Ganze ist ein bisschen komplizierter als das Ändern des Mime Types.
>
> Um das ganze mal ein bisschen detailierter zu umreißen - ist mir im englischen zu kompliziert:
>
> Ich rufe eine Action auf, die sich solange selbst aufruft und ein tiles Ergebnis zurückliefert bis alle notwendigen Eingaben vorgenommen sind.
> Im Code sieht der Aufruf etwa so aus:
> <s:iterator value="documents" var="document">
>        <s:url var="urlOpenDoc" action>
>                <s:param name="documentId" value="#document.id" />
>        </s:url>
>        <sx:a href="${urlOpenDoc}" targets="dialogContainer"><s:property value="#document.name" /></s:a>
> </s:iterator>
>
> Solange ich ein Tile als Ergebnis bekomme ist alles schön und gut. Das wird korrekt dargestellt.
> Wenn aber alle Eingaben erledigt sind, liefert die Action ein Stream result zurück.
>                        <result name="download" type="stream">
>                                <param name="contentType">application/octet-stream</param>
>                                <param name="inputName">inputStream</param>
>                                <param name="contentDisposition">filename="${fileName}"</param>
>                                <param name="bufferSize">1024</param>
>                        </result>
> Das ist schon entsprechend Konfiguriert um eine Datei zum Download anzubieten.
> Problem an der Stelle ist dann nur, dass der Aufruf über Ajax erfolgt und als Target immer noch den dialogContainer hat.
> Der Stream wird also im dialogContainer angezeigt, aber nicht als Download.
>
> Ich muss also irgendwie aus der Action heraus sagen - hey - das ist kein tile, das ist ein Download - also geh nicht in das Target, sondern geh in das "Fenster" und zeig mir den Download Dialog.
>
> Ist glaube ich immer noch recht chaotisch und unverständlich, aber vielleicht wird jetzt etwas deutlicher, was genau ich für ein Problem hab.
>
> Vielen Dank auf jeden Fall!!
>
> Viele Grüße
> Jan
>
> -----Ursprüngliche Nachricht-----
> Von: Martin Gainty [mailto:mgainty@hotmail.com]
> Gesendet: Mittwoch, 8. Juli 2009 15:05
> An: Struts Users Mailing List
> Betreff: RE: AW: [S2.1.2] sx:div targets AKA sx:a targets
>
>
> early here in EDT so I'll make the suggestion for the Action class changing the ContentType
> FileUploadAction.setContentType("application/octet-stream");
>
> mit freundlichen Grüßen
> Martin
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>
>
>
>
>
>> Subject: AW: [S2.1.2] sx:div targets AKA sx:a targets
>> Date: Wed, 8 Jul 2009 12:08:26 +0200
>> From: Jan.Froehlich@infomotion.de
>> To: user@struts.apache.org
>>
>> Martin & Musachy, thank you for your replies.
>>
>> @Martin, sorry that I couldn't make it that clear - "dialogContainer" is a div that is embedded in my page.
>>
>> @Musachy
>> I did some more research, and I guess I can't solve it in any way.
>> If my action returns "prompt" (tiles) it works like a charm and updates my "dialogContainer" with the specified tile.
>> But when it returns "download" (stream) it doesn't matter (afaik) which targets I define, cause an ajax request wont start a file download in any case.
>>
>> What could solve my problem is something like a javascript, that takes the returned stream from the action and instead of updating the targets-component it should change the mime type to application/octet-stream and writes it (maybe) to a new window.
>>
>> Hope its now understandable what I need to do! ;)
>>
>> Thanks again!
>>
>> Kind regards
>> Jan
>>
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Musachy Barroso [mailto:musachy@gmail.com]
>> Gesendet: Dienstag, 7. Juli 2009 20:14
>> An: Struts Users Mailing List
>> Betreff: Re: [S2.1.2] sx:div targets AKA sx:a targets
>>
>> targets can be set like anything else, with an ognl expression, like
>>
>> <s:a .... targets="%{targets}" ..
>>
>> then you need a getTargets() method in your action. Is that what you
>> need? or you need to modify the targets on the client side, meaning in
>> javascript?
>>
>> musachy
>>
>> 2009/7/7 Jan Fröhlich <Ja...@infomotion.de>:
>> > Wrong subject! ;)
>> >
>> > ________________________________
>> >
>> > Von: Jan Fröhlich [mailto:Jan.Froehlich@infomotion.de]
>> > Gesendet: Di 07.07.2009 16:55
>> > An: Struts Users Mailing List
>> > Betreff: [S2.1.2] sx:div targets
>> >
>> >
>> >
>> > Hi all,
>> >
>> > I've seen this topic beeing discussed several times already, but I didn't find a solution that works for me.
>> >
>> > What I already got:
>> > I invoke an action with a sx:a (targets="dialogContainer"). The action opens a document and has two possible return values: "prompt" and "download".
>> > "prompt" means, that there are several information necessary before the document can be downloaded. It is type="tiles".
>> > "download" means, that the document is ready for download. It is type="stream".
>> >
>> > On the "prompt" page is a finish button, that has no targets set, so the download starts fine.
>> > If the action returns "download" immediately it shows the stream in the specified "dialogContainer".
>> >
>> > What I need is to modify the targets value out of my action.
>> >
>> > I tried it from within the action and with an interceptor, but it seems like I can't access the "targets" in the ValueStack.
>> > Another way I tried, was to use afterNotifyTopics and redirect the data to what I want - but that didn't work either. (Problem with the stream result)
>> >
>> > Can someone give me a hint, how I can possibly solve it?
>> > I even thought about modifying the freemarker template for the anchor tag - but I couldn't find the right spot, where to do it.
>> >
>> > Any help appreciated!
>> >
>> > Kind regards
>> > Jan
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>> >
>> >
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
> _________________________________________________________________
> Windows Live(tm) SkyDrive(tm): Get 25 GB of free online storage.
> http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


AW: AW: [S2.1.2] sx:div targets AKA sx:a targets

Posted by Jan Fröhlich <Ja...@infomotion.de>.
Hallo Martin,

if I see that right, you speak german too - so lets make it a little easier - if not - just ignore the rest of the message! ;)

Das Ganze ist ein bisschen komplizierter als das Ändern des Mime Types.

Um das ganze mal ein bisschen detailierter zu umreißen - ist mir im englischen zu kompliziert:

Ich rufe eine Action auf, die sich solange selbst aufruft und ein tiles Ergebnis zurückliefert bis alle notwendigen Eingaben vorgenommen sind.
Im Code sieht der Aufruf etwa so aus:
<s:iterator value="documents" var="document">
	<s:url var="urlOpenDoc" action>
		<s:param name="documentId" value="#document.id" />
	</s:url>
	<sx:a href="${urlOpenDoc}" targets="dialogContainer"><s:property value="#document.name" /></s:a>
</s:iterator>

Solange ich ein Tile als Ergebnis bekomme ist alles schön und gut. Das wird korrekt dargestellt.
Wenn aber alle Eingaben erledigt sind, liefert die Action ein Stream result zurück.
			<result name="download" type="stream">
				<param name="contentType">application/octet-stream</param>
				<param name="inputName">inputStream</param>
				<param name="contentDisposition">filename="${fileName}"</param>
				<param name="bufferSize">1024</param>
			</result>	
Das ist schon entsprechend Konfiguriert um eine Datei zum Download anzubieten.
Problem an der Stelle ist dann nur, dass der Aufruf über Ajax erfolgt und als Target immer noch den dialogContainer hat.
Der Stream wird also im dialogContainer angezeigt, aber nicht als Download.

Ich muss also irgendwie aus der Action heraus sagen - hey - das ist kein tile, das ist ein Download - also geh nicht in das Target, sondern geh in das "Fenster" und zeig mir den Download Dialog.

Ist glaube ich immer noch recht chaotisch und unverständlich, aber vielleicht wird jetzt etwas deutlicher, was genau ich für ein Problem hab.

Vielen Dank auf jeden Fall!!

Viele Grüße 
Jan

-----Ursprüngliche Nachricht-----
Von: Martin Gainty [mailto:mgainty@hotmail.com] 
Gesendet: Mittwoch, 8. Juli 2009 15:05
An: Struts Users Mailing List
Betreff: RE: AW: [S2.1.2] sx:div targets AKA sx:a targets


early here in EDT so I'll make the suggestion for the Action class changing the ContentType
FileUploadAction.setContentType("application/octet-stream");

mit freundlichen Grüßen
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.





> Subject: AW: [S2.1.2] sx:div targets AKA sx:a targets
> Date: Wed, 8 Jul 2009 12:08:26 +0200
> From: Jan.Froehlich@infomotion.de
> To: user@struts.apache.org
> 
> Martin & Musachy, thank you for your replies.
> 
> @Martin, sorry that I couldn't make it that clear - "dialogContainer" is a div that is embedded in my page.
> 
> @Musachy
> I did some more research, and I guess I can't solve it in any way.
> If my action returns "prompt" (tiles) it works like a charm and updates my "dialogContainer" with the specified tile.
> But when it returns "download" (stream) it doesn't matter (afaik) which targets I define, cause an ajax request wont start a file download in any case.
> 
> What could solve my problem is something like a javascript, that takes the returned stream from the action and instead of updating the targets-component it should change the mime type to application/octet-stream and writes it (maybe) to a new window.
> 
> Hope its now understandable what I need to do! ;)
> 
> Thanks again!
> 
> Kind regards
> Jan
> 
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Musachy Barroso [mailto:musachy@gmail.com] 
> Gesendet: Dienstag, 7. Juli 2009 20:14
> An: Struts Users Mailing List
> Betreff: Re: [S2.1.2] sx:div targets AKA sx:a targets
> 
> targets can be set like anything else, with an ognl expression, like
> 
> <s:a .... targets="%{targets}" ..
> 
> then you need a getTargets() method in your action. Is that what you
> need? or you need to modify the targets on the client side, meaning in
> javascript?
> 
> musachy
> 
> 2009/7/7 Jan Fröhlich <Ja...@infomotion.de>:
> > Wrong subject! ;)
> >
> > ________________________________
> >
> > Von: Jan Fröhlich [mailto:Jan.Froehlich@infomotion.de]
> > Gesendet: Di 07.07.2009 16:55
> > An: Struts Users Mailing List
> > Betreff: [S2.1.2] sx:div targets
> >
> >
> >
> > Hi all,
> >
> > I've seen this topic beeing discussed several times already, but I didn't find a solution that works for me.
> >
> > What I already got:
> > I invoke an action with a sx:a (targets="dialogContainer"). The action opens a document and has two possible return values: "prompt" and "download".
> > "prompt" means, that there are several information necessary before the document can be downloaded. It is type="tiles".
> > "download" means, that the document is ready for download. It is type="stream".
> >
> > On the "prompt" page is a finish button, that has no targets set, so the download starts fine.
> > If the action returns "download" immediately it shows the stream in the specified "dialogContainer".
> >
> > What I need is to modify the targets value out of my action.
> >
> > I tried it from within the action and with an interceptor, but it seems like I can't access the "targets" in the ValueStack.
> > Another way I tried, was to use afterNotifyTopics and redirect the data to what I want - but that didn't work either. (Problem with the stream result)
> >
> > Can someone give me a hint, how I can possibly solve it?
> > I even thought about modifying the freemarker template for the anchor tag - but I couldn't find the right spot, where to do it.
> >
> > Any help appreciated!
> >
> > Kind regards
> > Jan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Windows Live(tm) SkyDrive(tm): Get 25 GB of free online storage.
http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: AW: [S2.1.2] sx:div targets AKA sx:a targets

Posted by Martin Gainty <mg...@hotmail.com>.
early here in EDT so I'll make the suggestion for the Action class changing the ContentType
FileUploadAction.setContentType("application/octet-stream");

mit freundlichen Grüßen
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.





> Subject: AW: [S2.1.2] sx:div targets AKA sx:a targets
> Date: Wed, 8 Jul 2009 12:08:26 +0200
> From: Jan.Froehlich@infomotion.de
> To: user@struts.apache.org
> 
> Martin & Musachy, thank you for your replies.
> 
> @Martin, sorry that I couldn't make it that clear - "dialogContainer" is a div that is embedded in my page.
> 
> @Musachy
> I did some more research, and I guess I can't solve it in any way.
> If my action returns "prompt" (tiles) it works like a charm and updates my "dialogContainer" with the specified tile.
> But when it returns "download" (stream) it doesn't matter (afaik) which targets I define, cause an ajax request wont start a file download in any case.
> 
> What could solve my problem is something like a javascript, that takes the returned stream from the action and instead of updating the targets-component it should change the mime type to application/octet-stream and writes it (maybe) to a new window.
> 
> Hope its now understandable what I need to do! ;)
> 
> Thanks again!
> 
> Kind regards
> Jan
> 
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Musachy Barroso [mailto:musachy@gmail.com] 
> Gesendet: Dienstag, 7. Juli 2009 20:14
> An: Struts Users Mailing List
> Betreff: Re: [S2.1.2] sx:div targets AKA sx:a targets
> 
> targets can be set like anything else, with an ognl expression, like
> 
> <s:a .... targets="%{targets}" ..
> 
> then you need a getTargets() method in your action. Is that what you
> need? or you need to modify the targets on the client side, meaning in
> javascript?
> 
> musachy
> 
> 2009/7/7 Jan Fröhlich <Ja...@infomotion.de>:
> > Wrong subject! ;)
> >
> > ________________________________
> >
> > Von: Jan Fröhlich [mailto:Jan.Froehlich@infomotion.de]
> > Gesendet: Di 07.07.2009 16:55
> > An: Struts Users Mailing List
> > Betreff: [S2.1.2] sx:div targets
> >
> >
> >
> > Hi all,
> >
> > I've seen this topic beeing discussed several times already, but I didn't find a solution that works for me.
> >
> > What I already got:
> > I invoke an action with a sx:a (targets="dialogContainer"). The action opens a document and has two possible return values: "prompt" and "download".
> > "prompt" means, that there are several information necessary before the document can be downloaded. It is type="tiles".
> > "download" means, that the document is ready for download. It is type="stream".
> >
> > On the "prompt" page is a finish button, that has no targets set, so the download starts fine.
> > If the action returns "download" immediately it shows the stream in the specified "dialogContainer".
> >
> > What I need is to modify the targets value out of my action.
> >
> > I tried it from within the action and with an interceptor, but it seems like I can't access the "targets" in the ValueStack.
> > Another way I tried, was to use afterNotifyTopics and redirect the data to what I want - but that didn't work either. (Problem with the stream result)
> >
> > Can someone give me a hint, how I can possibly solve it?
> > I even thought about modifying the freemarker template for the anchor tag - but I couldn't find the right spot, where to do it.
> >
> > Any help appreciated!
> >
> > Kind regards
> > Jan
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Windows Live™ SkyDrive™: Get 25 GB of free online storage.
http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009

AW: [S2.1.2] sx:div targets AKA sx:a targets

Posted by Jan Fröhlich <Ja...@infomotion.de>.
Martin & Musachy, thank you for your replies.

@Martin, sorry that I couldn't make it that clear - "dialogContainer" is a div that is embedded in my page.

@Musachy
I did some more research, and I guess I can't solve it in any way.
If my action returns "prompt" (tiles) it works like a charm and updates my "dialogContainer" with the specified tile.
But when it returns "download" (stream) it doesn't matter (afaik) which targets I define, cause an ajax request wont start a file download in any case.

What could solve my problem is something like a javascript, that takes the returned stream from the action and instead of updating the targets-component it should change the mime type to application/octet-stream and writes it (maybe) to a new window.

Hope its now understandable what I need to do! ;)

Thanks again!

Kind regards
Jan



-----Ursprüngliche Nachricht-----
Von: Musachy Barroso [mailto:musachy@gmail.com] 
Gesendet: Dienstag, 7. Juli 2009 20:14
An: Struts Users Mailing List
Betreff: Re: [S2.1.2] sx:div targets AKA sx:a targets

targets can be set like anything else, with an ognl expression, like

<s:a .... targets="%{targets}" ..

then you need a getTargets() method in your action. Is that what you
need? or you need to modify the targets on the client side, meaning in
javascript?

musachy

2009/7/7 Jan Fröhlich <Ja...@infomotion.de>:
> Wrong subject! ;)
>
> ________________________________
>
> Von: Jan Fröhlich [mailto:Jan.Froehlich@infomotion.de]
> Gesendet: Di 07.07.2009 16:55
> An: Struts Users Mailing List
> Betreff: [S2.1.2] sx:div targets
>
>
>
> Hi all,
>
> I've seen this topic beeing discussed several times already, but I didn't find a solution that works for me.
>
> What I already got:
> I invoke an action with a sx:a (targets="dialogContainer"). The action opens a document and has two possible return values: "prompt" and "download".
> "prompt" means, that there are several information necessary before the document can be downloaded. It is type="tiles".
> "download" means, that the document is ready for download. It is type="stream".
>
> On the "prompt" page is a finish button, that has no targets set, so the download starts fine.
> If the action returns "download" immediately it shows the stream in the specified "dialogContainer".
>
> What I need is to modify the targets value out of my action.
>
> I tried it from within the action and with an interceptor, but it seems like I can't access the "targets" in the ValueStack.
> Another way I tried, was to use afterNotifyTopics and redirect the data to what I want - but that didn't work either. (Problem with the stream result)
>
> Can someone give me a hint, how I can possibly solve it?
> I even thought about modifying the freemarker template for the anchor tag - but I couldn't find the right spot, where to do it.
>
> Any help appreciated!
>
> Kind regards
> Jan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2.1.2] sx:div targets AKA sx:a targets

Posted by Musachy Barroso <mu...@gmail.com>.
targets can be set like anything else, with an ognl expression, like

<s:a .... targets="%{targets}" ..

then you need a getTargets() method in your action. Is that what you
need? or you need to modify the targets on the client side, meaning in
javascript?

musachy

2009/7/7 Jan Fröhlich <Ja...@infomotion.de>:
> Wrong subject! ;)
>
> ________________________________
>
> Von: Jan Fröhlich [mailto:Jan.Froehlich@infomotion.de]
> Gesendet: Di 07.07.2009 16:55
> An: Struts Users Mailing List
> Betreff: [S2.1.2] sx:div targets
>
>
>
> Hi all,
>
> I've seen this topic beeing discussed several times already, but I didn't find a solution that works for me.
>
> What I already got:
> I invoke an action with a sx:a (targets="dialogContainer"). The action opens a document and has two possible return values: "prompt" and "download".
> "prompt" means, that there are several information necessary before the document can be downloaded. It is type="tiles".
> "download" means, that the document is ready for download. It is type="stream".
>
> On the "prompt" page is a finish button, that has no targets set, so the download starts fine.
> If the action returns "download" immediately it shows the stream in the specified "dialogContainer".
>
> What I need is to modify the targets value out of my action.
>
> I tried it from within the action and with an interceptor, but it seems like I can't access the "targets" in the ValueStack.
> Another way I tried, was to use afterNotifyTopics and redirect the data to what I want - but that didn't work either. (Problem with the stream result)
>
> Can someone give me a hint, how I can possibly solve it?
> I even thought about modifying the freemarker template for the anchor tag - but I couldn't find the right spot, where to do it.
>
> Any help appreciated!
>
> Kind regards
> Jan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: [S2.1.2] sx:div targets AKA sx:a targets

Posted by Martin Gainty <mg...@hotmail.com>.
jan

the target refers to the component whose content will be updated
<img id="loadingImage" src="images/loadingAnimation.gif" style="display:none"/>
<s:div id="parentDiv">
    <s:form action="actionName">
        <sx:a targets="parentDiv" showLoadingText="false" indicator="loadingImage"/>

dialogContainer is too general and not a component per se
best to identify a div tag such as parentDiv
http://struts.apache.org/2.1.6/docs/dojo-anchor.html

Mit Freundlichen Grueben/
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.






> Subject: [S2.1.2] sx:div targets AKA sx:a targets
> Date: Tue, 7 Jul 2009 19:56:21 +0200
> From: Jan.Froehlich@infomotion.de
> To: user@struts.apache.org
> 
> Wrong subject! ;)
> 
> ________________________________
> 
> Von: Jan Fröhlich [mailto:Jan.Froehlich@infomotion.de]
> Gesendet: Di 07.07.2009 16:55
> An: Struts Users Mailing List
> Betreff: [S2.1.2] sx:div targets
> 
> 
> 
> Hi all,
> 
> I've seen this topic beeing discussed several times already, but I didn't find a solution that works for me.
> 
> What I already got:
> I invoke an action with a sx:a (targets="dialogContainer"). The action opens a document and has two possible return values: "prompt" and "download".
> "prompt" means, that there are several information necessary before the document can be downloaded. It is type="tiles".
> "download" means, that the document is ready for download. It is type="stream".
> 
> On the "prompt" page is a finish button, that has no targets set, so the download starts fine.
> If the action returns "download" immediately it shows the stream in the specified "dialogContainer".
> 
> What I need is to modify the targets value out of my action.
> 
> I tried it from within the action and with an interceptor, but it seems like I can't access the "targets" in the ValueStack.
> Another way I tried, was to use afterNotifyTopics and redirect the data to what I want - but that didn't work either. (Problem with the stream result)
> 
> Can someone give me a hint, how I can possibly solve it?
> I even thought about modifying the freemarker template for the anchor tag - but I couldn't find the right spot, where to do it.
> 
> Any help appreciated!
> 
> Kind regards
> Jan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> 

_________________________________________________________________
Windows Live™: Keep your life in sync. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009

[S2.1.2] sx:div targets AKA sx:a targets

Posted by Jan Fröhlich <Ja...@infomotion.de>.
Wrong subject! ;)

________________________________

Von: Jan Fröhlich [mailto:Jan.Froehlich@infomotion.de]
Gesendet: Di 07.07.2009 16:55
An: Struts Users Mailing List
Betreff: [S2.1.2] sx:div targets



Hi all,

I've seen this topic beeing discussed several times already, but I didn't find a solution that works for me.

What I already got:
I invoke an action with a sx:a (targets="dialogContainer"). The action opens a document and has two possible return values: "prompt" and "download".
"prompt" means, that there are several information necessary before the document can be downloaded. It is type="tiles".
"download" means, that the document is ready for download. It is type="stream".

On the "prompt" page is a finish button, that has no targets set, so the download starts fine.
If the action returns "download" immediately it shows the stream in the specified "dialogContainer".

What I need is to modify the targets value out of my action.

I tried it from within the action and with an interceptor, but it seems like I can't access the "targets" in the ValueStack.
Another way I tried, was to use afterNotifyTopics and redirect the data to what I want - but that didn't work either. (Problem with the stream result)

Can someone give me a hint, how I can possibly solve it?
I even thought about modifying the freemarker template for the anchor tag - but I couldn't find the right spot, where to do it.

Any help appreciated!

Kind regards
Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org