Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Retrieve value from JSF

  1. #1
    Member
    Join Date
    Feb 2011
    Posts
    33
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default Retrieve value from JSF

    Okay, so here's the setup... I have main.xhtml file that displays four links to the user. These links are categories that determine what category is viewed on the next page. The categories are in a database, and are pulled into a List. I use this list to create the links. Note** I decided to do it this way, so when it's time to add more categories, I can update the database, and not have to create more JSF.** The problem I have is that I cannot figure out how to pass the selected category back to my Java class. Here is what I have for the links...

                <h:form>
                    <div id="indexRightColumn">
                        <ui:repeat var="category" value="#{vpsForm.category}">
                            <div class="categoryBox">
                                <h:commandLink action="#{vpsForm.findForward}">
                                    <span class="categoryLabelText">#{category}</span>
                                    <img src="#{initParam.categoryImagePath}#{category}.png"
                                         alt="#{category}" class="categoryImage"/>
                                </h:commandLink>
                            </div>
                        </ui:repeat>
                    </div>
                </h:form>

    I can get all the links to display and function, all I need is a way to set my selctedCategory var in my Java class so I can prepare my next page. Please note I am using JSF here and not Struts. However, if I absolutely have to use the actionForward from Struts, I guess I will. But I'd like to avoid that if at all possible...

    Thanks!


    All intelligent thoughts have already been thought;
    what is necessary is only to try to think them again.




  2. #2
    Forum Squatter newbie's Avatar
    Join Date
    Nov 2010
    Location
    North Wales
    Posts
    661
    My Mood
    Stressed
    Thanks
    28
    Thanked 115 Times in 106 Posts
    Blog Entries
    1

    Default Re: Retrieve value from JSF

    Posted again on the forums: http://www.javaprogrammingforums.com...html#post57693
    Please use [highlight=Java]//code goes here...[/highlight] tags when posting your code

Similar Threads

  1. Retrieve data from other table
    By kichkich in forum JDBC & Databases
    Replies: 2
    Last Post: June 23rd, 2011, 07:51 AM
  2. Retrieve coordinates of other windows
    By Knox in forum AWT / Java Swing
    Replies: 1
    Last Post: April 10th, 2011, 02:03 PM
  3. [HELP] How can I retrieve attribute/method?
    By k4it0xtr3me in forum Object Oriented Programming
    Replies: 0
    Last Post: January 21st, 2011, 02:18 AM
  4. Program that will retrieve information from website.
    By minaru in forum Java Theory & Questions
    Replies: 2
    Last Post: December 18th, 2010, 05:50 PM
  5. [SOLVED] Problem trying to retrieve a file from ftp server
    By alexdd1987 in forum What's Wrong With My Code?
    Replies: 7
    Last Post: December 16th, 2010, 06:27 PM