Ronald Johnson

Greenhorn
+ Follow
since Jan 15, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ronald Johnson

hi, i want the user to be able to change the langue of the website.
as default whatever the user defines in his browser should be used (if we support it).

I have read that to override the browser language, i could call setLocale on UIViewRoot.
How can I do this, I assume this is something that has to be set for each web page. How can that be done?

Any pointer would be very helpful!

cheers!
15 years ago
JSF
i am coding a "switch language" into an app,
and my idea is that i have a bean that stores the language setting.
as default, the Accept-language should be used,
i.e. in the bean, i would either returned the user defined lanuage or the value of Accept-language.

how can i read out the value of Accept-language from my java code?
15 years ago
JSF
Hi manuel, hmm, let me clarify, i have code like this:



and I want the myFunction() to be called, but only when the action #{someBean.itemClicked} has finished executing.

i can for example not use onComplete attribute since it is just looking at the client side and not on the server side....
[ February 12, 2008: Message edited by: Ronald Johnson ]
16 years ago
JSF
hi,

how can i make sure that a piece of javascript is executed after i called an action on the server?
any ideas how to achieve this (no matter how; jsf, ajax4jsf, rich faces...)

thanks for any tips
16 years ago
JSF
hi,

is it possible to define style class for selectItem / selectItems?

E.g.


i cannot get it to work, but yet i see code examples that uses a styleClass attribute.

Or is there some other way around it?
The problem i have is that i have a drop down where some entries should have a different color than others.
e.g.
16 years ago
JSF
e.g. i just wanna pass a parameter to any method i have in the backbean.
the problem with f:param etc is that i need to use post/get/ajax, which will not work if the person for example do a reload of the page
(when reloading, the parameter will be null, if i use for example parameter map)
17 years ago
JSF
i do not understand the strong coupling between layout and the data in JSF.
I want to display several rows of checkboxes,
like below where
C=a checkbox,
N= the displayed name of the checkbox
BAR=a column where some calculated values are displayed (e.g. a bar with the length corresponding to how many times the name display in some text)

C N BAR
C N BAR
C N BAR

I try to use t:selectManyCheckbox, but I does not seem to have any layout controls. I can do
<t:selectManyCheckbox id="alist" layout="pageDirection"
value="#{searchCriteria_backing.mediaTypes}"
border="0">

and will have the rows generated, but how can I add a column of my own?

any ideas how I can achieve this?
17 years ago
JSF
cheers for the reply, the nested elements seems to be a way to get what I want. It will be interesting to see how it goes when i receive the first batch of html docs from the designer.
17 years ago
JSF
before i have used xml and xslt to generate web pages, which is nice since i have 100% control over the result.

with jsf i have the feeling that it is great for generating functional websites where it is not important how the web page looks like.

With the tasks i have, i will recieve html templates from the designer, and i am supposed to generate the same html code (or at least that it looks the same on the screen for the end user), and here i have doubts that it is possible to (easily) do that with JSF.

Doesnt this mean that I have to create new custom components whenever i want some table with specific behaviour (e.g. the first 2 rows consist of 1 column each the third row consists of 4 columns).

or do i think it is more complex than it is?

please let me know your comments on this.

at the moment i am thinking about maybe forgetting about jsf and do xml/xslt to have full control (but of course missing the nice things that jsf brings: forgetting about handling post/get, ajax4jsf etc)

note: i am JSF newbie.

RJ
17 years ago
JSF
as far as i can see, i cannot control the output like that.
e.g. an entry would be

(1) JavaServer Faces Technology
(2) The Java Enterprise Community on java.net The Java Enterprise Community is a gathering place for developers ...
(3) java.sun.com/javaee/javaserverfaces/ - 30k - Cached - Similar pages - Note this

where (1) is a larger headerline, (2) is a description with smaller font size
(3) is a row that cointans different information, that will have different styles.

Is that possible to create with a datatable?

RJ
17 years ago
JSF
I want to create an output that is similar to a search result, e.g. the search results from google:

for each entry found in the list the output would be something like:

Title
description
date added, additional information

but with even more information, and sometimes an image shown or additional information shown depending on some data in the value object.

Is this possible in JSF? How?

I would appreciate any pointers in the right direction, since I cannot find anything on this topic...

cheers,

RJ
17 years ago
JSF
I got myself
The Complete Reference JavaServer Faces
which seems to cover all interesting bits.

Note: I have only been looking at JSF for 3 weeks.
17 years ago
JSF
ok, my solution was this:



I also found out that in Apache Tomahawk (from version 1.0.5) there exist a tag t:validateEqual that does exactly what i want.

cheers!
17 years ago
JSF
I want to have a page where a user can change his password
e.g. enter the password in one field, and then he has to enter the password again in a second field to make sure that he typed his password correctly.

So, my validation would be a simple comparision that the entries are identical.

I have a backing bean for the values of the fields.

What I want is when the user clicks a button I would simply like to call a verification method in the backing bean that compares the attributes and returns some error if they are not identical.

How can i achieve this? The commandbutton does not have a validator attribute, and calling a method over the action attribute does not seem to work.

All I can find in the internet are simple examples where the value of one field is checked, not that several fields are compared with one validation method.

cheers,

RJ
17 years ago
JSF
thanks for the replies, some more question:

is it possible to generate a basic stylesheet somehow?
(since i guess that different implementations could generate different html code)

or do I have to do the hard work of looking at the generated html and figure out which elements that are used?

or should i use the style attribute in all tags in the .jsp file?

questions, questions, questions
17 years ago
JSF