Dear Oleg,
first of all, sorry but you are negligent (or maybe stupid but I hope not).

In order to start asking questions about Trinidad framework (or any other JSF framework) you should be familiar with JSF technology no mater which JSF components you will use later. In your case you are not even close to familiar because reading your posts and seeing mistakes you make it looks like this is your first project with JSF. So if you want to understand what Martin, Scott, Richard are trying explain to you, you should start from basics and after that just read the previous responses to your questions and you will see that everything is crystal clear explained more then once.

The only thing you should consider is that facelets in trinidad 2 still don't work with some app servers (I can't generalize the problem but in my case with glassfish 3.1 final) and that's the reason why I'm moving from Trinidad (and JSF generaly to Vaadin). Since you are using JSP (?! which is kinda obsolete for JSF2 - please someone correct me if I'm wrong) instead of facelets, you shouldn't be worried about this problems.

I take this opportunity also to express my opinion about Trinidad.
In my last 5 years of experience with Trinidad (I'm using it since version 1.0-m2-incubating) this is the most powerful and best framework for JSF (yes PrimeFaces has better and nicer components, but it's not a framework and that is much more important!) and for that thank you Trinidad community from the bottom of my heart.

Regards,

Luka Surija

+385 1 61 99 140
+385 98 434 061
[email protected]

I.Y. tim d.o.o.
Nova cesta 171a, HR-10000 Zagreb
www.iytim.hr
[email protected]


On 06/18/2011 07:22 PM, jitechno wrote:
Ok. This is a full Netbean project.
Please add trinidad-api-2.0.0.jar and trinidad-impl-2.0.0.jar, I have
excluded them to reduce ip file size.
And I have cleaned "build " folder.
Also, you can download full project with jars and build from here, it is
aipped and uploaded as is.

http://www.zshare.net/download/91596447f44ad027/

I am using Tomcat 6.0.30
Index. jsp is working fine for upload, temp upload folder set to C:/TEMP/.
Try download.jsp, download1. jsp (this is a mirror of your example)
Thanks
Oleg

http://old.nabble.com/file/p31876159/TrinidadUpload1.zip TrinidadUpload1.zip

Martin Koci-2 wrote:
Well, it looks like the same issue for me: please post (attach or
upload) full project if possible including: faces-config.xml,
trinidad-config.xml, web.xml etc. Did you compare those config files
with trinidad demo config files? What app server do you use?

Again: if possible, try trinidad demo, if is it working for you!

jitechno píše v So 18. 06. 2011 v 09:43 -0700:
Martin, for this example  I have mext result, Loot at
http://old.nabble.com/file/p31875986/result.jpg  printscreen
regards



Martin Koci-2 wrote:
jitechno píše v So 18. 06. 2011 v 07:05 -0700:
Martin,
my problem that example with tr:document and tr:form is not working.
i am looked for example how to use tr:fileDownloadActionListener,
nothing
more.
that was answered: trinidad demo/examples:


https://svn.apache.org/repos/asf/myfaces/trinidad/trunk/trinidad-examples/trinidad-demo/src/main/webapp/demos/tags/fileDownloadActionListener.jspx
please try that example.

It seemed were simply to implement..Other word, I have used th
is jsp
and my question whta is wrong here, why doesnot start file dialog,
nothing
more.
What is/was wrong with your code:
1) no form tag (in first version): without form tag, HTML cannot create
POST request. That's nature of HTML and no framework can solve it.
2) no tag for resource incuding (current version). Again, your latest
view has strucure unsuitable for handling resource, please read [1].
You
are providing own html/head/body structure, JSF have no chance to
insert
resource like .js or .css in<head>  element. Please use tr:document as
root element or use trh:html/head/body or convert our view to facelets
and use h:head/body.

[1]

http://andyschwartz.wordpress.com/2009/07/31/whats-new-in-jsf-2/#resource-loading
I had not idea to satrt discussion, it seemed very natural, authors
might
recognize problem.
Ok, if it neesd debugging, no problem, I have an other approach.
best regards
Oleg

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/html"; prefix="h"%>
<%@taglib uri="http://java.sun.com/jsf/core"; prefix="f"%>
<%@taglib uri="http://myfaces.apache.org/trinidad/html"; prefix="trh"%>
<%@taglib uri="http://myfaces.apache.org/trinidad"; prefix="tr"%>

<!DOCTYPE html>
<html>
     <head>
         <LINK href="<%= request.getContextPath()
%>/Resources/css/styles.css" rel="stylesheet" type="text/css">
         <LINK href="<%= request.getContextPath()
%>/Resources/css/background.css" rel="stylesheet" type="text/css">
         <LINK href="<%= request.getContextPath()
%>/Resources/css/stylesheet.css" rel="stylesheet" type="text/css">
    </head>
         <title>JSF + Trinidad</title>

     </head>
     <body>

        <f:view>
             <h1><h:outputText value="JSF 2.0 + Trinidad 2.0"/></h1>
             <tr:document>
                 <tr:form styleClass="submit_button">
                     <tr:commandButton text="Download file">
             <tr:fileDownloadActionListener
filename="#{downloadBean.fileName}"

contentType="#{downloadBean.contentType}"

method="#{downloadBean.sayHello}"/>
                     </tr:commandButton>
                 </tr:form>
             </tr:document>
    <%--
     <tr:document id="document" title="Doc" onload="onload()"
onunload="onunload()">
        <tr:commandLink text="Download file">
        <tr:fileDownloadActionListener
                                 filename="hello.txt"
                                 contentType="text/plain;
charset=utf-8"
                                 method="#{downloadBean.sayHello}"/>
        </tr:commandLink>
        </tr:document>
    --%>
        </f:view>
     </body>
</html>





Martin Koci-2 wrote:
I don't understand (and I'm not the only one) what you want really.

1) with tr:document and tr:form is your example working. If you
still
has problem, please provide full project with - I guess it can be
configuration issue - or you can compare your configuration with
trinidad examples

2) examples (demo) are available from download pages [1] or from svn
[2]
3) working example you can see at live demo [3]

Richard, do you realize, you are able see how create link to file
under standard HTML? without any payments?
4) link != download. If you want link to static file, use link.
command(Link,Button,...) and provided example has another purpose:
to
serve (download) content dynamically, based on current state in
application

5) there is still room for improvements in logging area.
JSF/trinidad
should warn user if structure of view is not suitable for basic
functionality (like missing form). Please create issue for this.
I've
created a umbrella issue already for such cases [4]

[1] http://myfaces.apache.org/trinidad/download.html
[2] https://svn.apache.org/repos/asf/myfaces/trinidad/trunk
[3]

http://www.irian.at/trinidad-demo/faces/demos/tags/fileDownloadActionListener.jspx
[4] https://issues.apache.org/jira/browse/MYFACES-3053

jitechno píše v Pá 17. 06. 2011 v 08:30 -0700:
Richard, do you realize, you are able see how create link to file
under standard HTML? without any payments?
I am asking to point to elementary but completed constriuction, not
to
complex example.
Do you realize the difference between support and basic feature's
description?


Richard Yee-3 wrote:
Jitechno,
Do you realize you are using open source software and a mailing
list
that
consists of users? If you hand holding and someone to host an
example
site
for you, I suggest you try a commercial  product and pay for
support.
Richard

Sent from my iPhone

On Jun 17, 2011, at 8:00 AM, jitechno<[email protected]>  wrote:

Scott, I am questioning about REAL WORKING example all time.
Point me to this example and I will not take your time.


Scott O'Bryan wrote:
Right, that's what I figured.  The example is correct, but it's
just
a
fragment and assumes the rest of your page is correct.  Without
the
form
tag, I can all but guarentee that your page IS NOT correct.

This is why I suggested using the demo source as a starting
point.
The problem here is that we told you multiple times what to
try.
Myself
and others said to add the tr;form and you argued that it
wasn't
needed.
I then suggested ways to debug your current JSP and you told me
that
you
didn't need help in debugging you jus wanted it to work.

Finally, I even asked you look at the demo source which has a
real
working
example, and you tell me that you shouldn't have to do that..

At this point, I'm not sure what other help you expect?

Scott

Sent from my iPhone

On Jun 17, 2011, at 8:47 AM, jitechno<[email protected]>
wrote:

Scott, I am mentioned this page, where example is located:

http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_fileDownloadActionListener.html
Oleg


Scott O'Bryan wrote:
Oleg, what "Official" page are you talking about?  The docs
or
the
fully
functional example in the demo project?  If you're talking
about
the
docs,
understand that they assume you have a fully and correctly
constructed
page AROUND the listener.

Scott

Sent from my iPhone

On Jun 17, 2011, at 8:27 AM, jitechno<[email protected]>
wrote:
Scott, I dont ask you or other person do my work. I dont
think,
adding
download link reuires researches? manuals and debugging.

But, if I got example from "official" page, I want to rely
on
it.
So,
now
I
really dont understand situation.
I put a lot of efforts to write application and I want to
complete
it.
It is not a question of testing  functionality. I am not
able
(and
I
dont
want ) to learn product without  functional examples. I did
not
find
any
working example how to download file with
tr:fileDownloadActionListener.
Better, I will put standard links to files, so user will
download
files
with
standard browser's dialog.
regards



Scott O'Bryan wrote:
Yeah Oleg,

I'm certainly willing to help but I'm not willing to write
your
application for you or, necessarily, debug it.  If there is
a
problem
with
Trinidad, then we certainly want tp know about it, but
short
of
that,
my
goal is to teach you how to work within the Trindad
framework
so
that
you
can overcome obsticals on your own.

If your intention is just to test out this functionality, I
invite
you
to
try out the 'feature demo' of the Trinidad Demo
application.
I
believe
there are instructions for running it under jetty using a
single
maven
command and you'll be up and running in no time.

Further you can use the example as a template for writing
your
own
pages
if you wish.

Hope that helps.
Scott

Sent from my iPhone

On Jun 17, 2011, at 5:20 AM, Martin Koci
<[email protected]>
wrote:

Hi,

jitechno píše v Pá 17. 06. 2011 v 01:41 -0700:
Scott, may be, there is a little misunderstanding. My
question
is
not
about
debugging and reverse engineering, but about general
approach.
I am trying realize example from "official" Trinidad's
page.
At
least,
I
am
considering as official. Am I right?


http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_fileDownloadActionListener.html
Usually, such examples give a good base to start with
more
deep
development. In this case, it is no.
This example doesnot cover complete solution, or
obsolete,
or
belongs
to
other version.
That example is ok, we use it over 4 years in many
production
systems.

I have not time to explore ans investigate basic
elementary
construction,
it is not a subject of research for programmer. May be, I
am
wrong
or
my
understanding of myfaces.apache's policy is incorrect?

I dont know which tag is giving the problems, because I
dont
see
any
action
after clicking on commandLink or button, inside form or
outside.
Also
I
dont
see any exceptions/messages form Tomcat.
Firefox ->  Tools ->  Error Console. You'll see javascripts
errors.
The
main probem is that you have no tag for including
resources
in
your
view. In case of JSP, use tr:document as Scott suggests. I
case
of
facelets, you can use tr:document too or new h:head/h:body
tags.
Anyway,
please read this resource:

http://andyschwartz.wordpress.com/2009/07/31/whats-new-in-jsf-2/#resource-loading
Regards,

Kočičák

Regards
Oleg


Scott O'Bryan wrote:
Oleg, events usually require a form in order to submit
the
data
needed
to process the event.  Additionally, which tag is giving
you
the
problems?  To debug this problem, I would start by
trying a
simpler
page without mixing render kits and then go from there.
Use
the
<tr:document>  tag at the root, include to form, and so
on.
Once
you
do this, you can reverse engineer your app to see what's
happening.
Understand also that JSF and TRINIDAD also have
replacements
for
some
elements that you usually use with HTML.  You need to
use
these
replacements for things to get inserted properly.

Scott

Sent from my iPad

On Jun 16, 2011, at 2:18 AM, jitechno
<[email protected]>
wrote:
Cedric, why I need form tag here?
I dont think so. because no need to use form and submit
for
download
file
in
browser.
But tr:form is not solution, still the same behavior.
<body>

   <f:view>
        <h1><h:outputText value="JSF 2.0 + Trinidad
2.0"/></h1>
        <tr:form id="downloadForm">
        <h:commandButton value="Download"
styleClass="submit_button">
        <tr:fileDownloadActionListener
filename="#{downloadBean.fileName}"

contentType="#{downloadBean.contentType}"

method="#{downloadBean.sayHello}"/>
        </h:commandButton>

   <tr:commandLink text="Download file">
   <tr:fileDownloadActionListener
                            filename="hello.txt"
                            contentType="text/plain;
charset=utf-8"

method="#{downloadBean.sayHello}"/>
   </tr:commandLink>
   </tr:form>
</f:view>
</body>
regards
Oleg

Cédric Durmont wrote:
Ooops, looks like<tr:form>  is missing...

Regards,
Cedric

2011/6/15 jitechno<[email protected]>:
Hello,
I tried this example,

http://myfaces.apache.org/trinidad/trinidad-api/tagdoc/tr_fileDownloadActionListener.html
Not with commandLine, not with commandButton I am nat
able
to
fire
file
save
dialog. No exceptions, no actions, nothing. Please,
advice
me,
what
is
wrong
here?
Thanks in advance

<f:view>
        <h:commandButton value="Download"
styleClass="submit_button">
          <tr:fileDownloadActionListener
filename="#{downloadBean.fileName}"

contentType="#{downloadBean.contentType}"

method="#{downloadBean.sayHello}"/>
        </h:commandButton>

   <tr:commandLink text="Download file">
   <tr:fileDownloadActionListener
                            filename="hello.txt"
                            contentType="text/plain;
charset=utf-8"

method="#{downloadBean.sayHello}"/>
   </tr:commandLink>
</f:view>

------------------------------------------------------------------
faces-config contains
<managed-bean>
<managed-bean-name>downloadBean</managed-bean-name>

<managed-bean-class>Beans.DownloadBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
        <property-name>text</property-name>
        <value>Hi there!</value>
    </managed-property>
    <managed-property>
        <property-name>contentType</property-name>
        <value>text/plain; charset=utf-8</value>
    </managed-property>
    <managed-property>
        <property-name>fileName</property-name>
        <value>hello.txt</value>
    </managed-property>
</managed-bean>

--------------------------------------------------------------------------------------------
DownloadBean is here:
package Beans;

import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import javax.faces.context.FacesContext;

public class DownloadBean  implements
java.io.Serializable{
public DownloadBean() {
}
private String text;
public void setText(String text){
this.text = text;
}
public String getText(){
return this.text;
}

private String fileName;
public void setFileName(String fileName){
this.fileName = fileName;
}
public String getFileName(){
return this.fileName;
}
private String contentType;
public void setContentType(String contentType){
this.contentType = contentType;
}
public String getContentType(){
return this.contentType;
}
public void sayHello(FacesContext context,
OutputStream
out)
throws
IOException
{
  System.out.println("sy Hello "+ getFileName()+"
"+getContentType());
  OutputStreamWriter w = new OutputStreamWriter(out,
"UTF-8");
  w.write(getText());
  // The stream is automatically closed, but since we
wrapped
it,
  // we'd better flush our writer
  w.flush();
}
}
--
View this message in context:

http://old.nabble.com/What-is-wrong-with-Trinidad%27s-download-example--tp31851629p31851629.html
Sent from the MyFaces - Users mailing list archive at
Nabble.com.



--
View this message in context:

http://old.nabble.com/What-is-wrong-with-Trinidad%27s-download-example--tp31851629p31858292.html
Sent from the MyFaces - Users mailing list archive at
Nabble.com.




--
View this message in context:

http://old.nabble.com/What-is-wrong-with-Trinidad%27s-download-example--tp31851629p31869477.html
Sent from the MyFaces - Users mailing list archive at
Nabble.com.

--
View this message in context:

http://old.nabble.com/What-is-wrong-with-Trinidad%27s-download-example--tp31851629p31869622.html
Sent from the MyFaces - Users mailing list archive at
Nabble.com.

--
View this message in context:

http://old.nabble.com/What-is-wrong-with-Trinidad%27s-download-example--tp31851629p31869742.html
Sent from the MyFaces - Users mailing list archive at
Nabble.com.










Reply via email to