This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!

Josh Juneau

Ranch Hand
+ Follow
since Jun 16, 2004
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 Josh Juneau

I think you want to use something like this:

<h:commandLink action="#{tie to action}"> <h:outputText value="Click This Link"/> <f:param name="editParameter" value="parameterValue"/> </h:commandLink>

In your bean action you would use something like this:

FacesContext fc = FacesContext.getCurrentInstance();
String value = (String) fc.getExternalContext().getRequestParameterMap().get("editParameter");

I think this would do the trick...however I cannot test it out at this time.

Hope this helps.
13 years ago
JSF
You should tie an action to the invoking link by using h:commandLInk. Once the link is selected, the action will populate the bean accordingly. You can use the FacesContext from within the backing bean action method in order to obtain the parameter.

I would like to add that this is also a good reason to use a solution like Seam or Spring. In Seam you can set up actions which are invoked when pages are accessed. This can be done within an XML file with no code at all. However, it seems like a commandLInk or commandButton should work fine in your case (from what I know about your issue).
13 years ago
JSF
You may wish to try the selectBooleanRadio. I've used Oracle ADF components many times in the past, but never used the radio buttons unfortunately. However, the selectBooleanRadio looks like what you need:

http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/selectBooleanRadio.html
14 years ago
JSF
Another choice would be Icefaces. They've released some pretty nice components and IceFaces was recently open-sourced.

http://www.icefaces.org/main/home/index.jsp
14 years ago
JSF
You may consider looking at JBOSS Seam as well. Although, that may be overly complex if you are not using more than one input form. Seam natually integrates with Facelets and JSF...and it handles the managed beans transparently through the usage of annotations!

Otherwise if you are looking for something more simple, Struts may be more efficient for you. If you are using generally static pages, you may also consider just straight JSP...you can break up static page pieces into separate pages and just use the jsp:include where needed.
14 years ago
JSF
You should be able to Google XMLHttpRequest and AJAX to find all the links you need. If you want good information regarding JSF AJAX components, then you should look at the book "Pro JSF and AJAX" by Jacobi and Fallows...it has lots of good info. You can probably Google JSF AJAX components for some information as well....

Hope this helps.
14 years ago
JSF
Hey there...sorry you are having issues with JSF. Personally, I started coding JSF when it was in beta mode on the Sun Java Application Server...and it was great! I really have only used JBOSS a few times, and more recently I've begun investigating and reading up on the JBOSS Seam framework.

Enough said with my history...if you want to use JBOSS, I would recommend downloading the SEAM framework and giving it a try. There are some very simplistic examples, including a Hello World that you can try. As long as you follow the directions on building and deploying, they should work fine on your JBOSS server. They work fine for me.

I would also recommend checking out the Sun Java Application Server, or even Glassfish, to begin developing JSF apps. Most of the tutorials from Sun use this server, and it is really straight forward.

Don't give up on JSF...it is the most powerful Java web application framework from my perspective. There are plenty of good ones out there, but this one has it all. Even further, if you want to really exploit JSF then you should look at facelets and seam as well.

https://facelets.dev.java.net/

Hope this helps..
14 years ago
JSF
Nice one...that will definitely do the trick!
14 years ago
JSF
I do not know if the JSTL "set" will work with JSF. However, can't you just use another variable for the second level output? If you are looking to have both of the values appear on the same page then you would be making a cleaner solution by using two separate variables in my opinion.
14 years ago
JSF
Did you paste your code correctly? When obtaining a value from the bean, you must use the JSF EL syntax:

<f:view>
Test String here -> <h:outputText value=�#{UserBean.test}�/> <-Test String there
</f:view>

If you are not using the #{} around your value, it is not binding to the bean.

Hope this helps...
14 years ago
JSF
I'm not sure exactly what you are attempting to perform, but you should be able to tie the selected attribute to a backing bean value. In coding this way, your backing bean will determine if the value is true or false. You can get rid of the JSTL altogether and just do something like this:

<tr:commandNavigationItem immediate="true"
text="Contracts"
action="guide.page"
selected="#{bean.selectedValue}"/>

I do not use JSTL anywhere in JSF code at this time unless absolutely necessary. You should try to perform all comparisons and business logic within the backing beans if possible.

I hope this will work for your situation. Otherwise, your JSTL solution may be the best alternative.
14 years ago
JSF
What development environment (IDE) are you using? Most IDEs nowdays will automatically set up your JSF application for you. Also, which application server are you deploying to?
14 years ago
JSF
Have you looked at the commandLink?

Hope this is what you are looking for.
14 years ago
JSF
Try to request the parameter map instead of references to the HTTP session. Look at this topic below. It pertains to a commandLink, but it should also work for a commandButton. I hope this solves your issue...good luck!

http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters

code:
FacesContext context = FacesContext.getCurrentInstance();
Map map = context.getExternalContext().getRequestParameterMap();
String localVariable = (String) map.get("your value");
14 years ago
JSF
It sounds like your original page will have a commandButton which initiates an action in the bean. This action method is where your transactions will take place. You can then store the values into this bean or another bean. The completion of the transaction should cause the page to be redirected to your second page which shows the calculated solutions.

In short...the action method which is invoked can store the values within a hashmap or even just variables within a bean (these variables can also be collections). The second page will reference the variables within the bean...which will show the results.

Here is a link which may assist you in retrieving values from other managed beans:

http://www.jsffaq.com/Wiki.jsp?page=HowToAccessOneManagedBeanFromAnotherManagedBean
14 years ago
JSF