t:selectitems query

2007-01-22 Thread CarlHowarth

Hiello,

Does anybody know if there are plans to amend the tomahawk selectitems tag
so that it will call the 'tostring' method on items that are not strings in
the itemValue field? Currently the IDs on my beans are Integers, so I need
to provide an additional method on the beans to expose the IDs as strings
too. Not a major problem of course!

Cheers, Carl
-- 
View this message in context: 
http://www.nabble.com/t%3Aselectitems-query-tf3052665.html#a8485975
Sent from the My Faces - Dev mailing list archive at Nabble.com.



commandButton behaviour differs to commandLink

2006-10-05 Thread CarlHowarth

Hello there,

Hopefully someone can help - I have looked through the existing queries and
can't just find what I'm after. I have posted this to users but to no avail,
please could somebody confirm if this is a bug in the software or if I'm
doing something incorrectly?

I have a main record with asociated files - the files are uploaded through
my web app and are downloaded from the same page that lists the files in a
dataTable. I have a series of commandLinks that display the file names - a
user selects the file and it downloads.

The problem I have is that when a user downloads a file then immediately
trys to upload another, they are prompted to download the file that they
have already previously downloaded. If however I replace the commandLinks
for commandButtons the application behaves correctly.

I have seen an associated link that mentions similar behaviour
(http://blogs.sun.com/tor/entry/creating_downloadable_files), however I do
not want to use the command buttons in this manner, and I use an
actionListener rather than an action so I may retrieve information from the
list of dynamically created files. I am not receiving any errors, just the
strange behaviour with commandLinks.

My code is as follows:

 public void downloadFile(ActionEvent ev) {
UIData fileList = findParentHtmlDataTable(ev.getComponent());
AssociatedFile associatedFile = (AssociatedFile)
fileList.getRowData();
String downloadPath = download path retrieved here...;

try {
byte[] fileData = InternalUtil.readFile(downloadPath);
HttpServletResponse response =
(HttpServletResponse)
getFacesContext().getExternalContext().getResponse();

response.setHeader(Content-disposition, attachment;
filename=\ +
associatedFile.getName() +
\);


response.setContentLength(fileData.length);
response.setContentType(associatedFile.getContentType());
ServletOutputStream out = response.getOutputStream();
out.write(fileData);

   
getFacesContext().getApplication().getStateManager().saveSerializedView(getFacesContext());
getFacesContext().responseComplete();


} catch (FileSystemException e) {
getFacesContext().addMessage(null, new FacesMessage(Error
downloading file:  +
e.getMessage()));
} catch (IOException e) {
getFacesContext().addMessage(null, new FacesMessage(Error
downloading file:  +
e.getMessage()));
}
}

Any help would be greatly appreciated!

Thanks in anticipation, Carl 
-- 
View this message in context: 
http://www.nabble.com/commandButton-behaviour-differs-to-commandLink-tf2387145.html#a6654728
Sent from the My Faces - Dev mailing list archive at Nabble.com.



f:convertDateTime within t:dataTable

2006-08-23 Thread CarlHowarth

Hello all,

Apologies if this has already been  covered, I have not been able to find a
suitable response to help me with this issue.

I have a page that displays data in a datatable, and also displays a couple
of dates independent of the table. All information is being drawn from the
same backing bean. When I display a date field independent to the table and
use the following code:

h:outputText value=#{BackingBean.dateField}f:convertDateTime
type=date dateStyle=short //h:outputText

... the date is being displayed as I would expect for my locale
(dd/MM/), however when I use the same convertDateTime statement in an
outputted field in the dataTable the date is being displayed differently
(incorrectly) as dd-mmm-.

Is these a simple way to get the data displayed in the table outputted
correctly?

Any help would be much appreciated.

Thanks, Carl


-- 
View this message in context: 
http://www.nabble.com/%3Cf%3AconvertDateTime%3E-within-%3Ct%3AdataTable%3E-tf2151931.html#a5942859
Sent from the My Faces - Dev forum at Nabble.com.