Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6928049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:08:01+00:00 2026-05-27T11:08:01+00:00

I have a search screen where I search for a customer id and it

  • 0

I have a search screen where I search for a customer id and it consumes a webservice a returns list of objects. I display the results in a datatable.For a specific field , I have a method which provides the value based on a key value in each row of the list being iterated. The key value is productID. I set that in a bean named output. In the getCustomerValue method I call the method which provides the relevant value by passing the value of “productID”. I use the below listed code to do the same.

<h:outputText id="customerID" binding="#{myBean.output}" value="#{customerBean.customervalue}">
<f:attribute name="myID" value="#{item2.customerService.productID}"/>
</h:outputText> 

The value gets displayed properly when the page is loaded. I have hyperlink in the same page which basically calls the same webservice and renders the same page.But this time around all the values except the value listed above is being displayed. When I print the value of attribute “item2.customerService.productID” in the method “customervalue” , it is displayed as null.I am not sure why this value isn’t being passed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:08:01+00:00Added an answer on May 27, 2026 at 11:08 am

    You’re displaying this in a <h:dataTable>. The <f:attribute> is specific to the component itself, not to its generated HTML output. The <f:attribute> is evaluated during view build time, not during the view render time. At the moment JSF builds the view, the #{item2} is not present in the scope. It’s only present in the scope when JSF renders the view.

    You need to look for the solution by alternate means. It’s unclear what JSF version you’re using, but based on your question you’re using JSF 1.2 (in the future questions, please explicitly mention the JSF impl/version you’re using; in JSF 2.0 a lot of things can be done differently and much more elegantly).

    My answer on your previous question of Passing parameters to a method in h:outputtext tag should be the best answer to your current problem. This is apparently not an option somehow. In that case, there are at least 3 alternative ways:

    1. Move the property to the class behind #{item2}:

      <h:outputText value="#{item2.customervalue}">
      

      You’ve in there instant access to the customerservice property.

    2. Get the current item inside the getter by evaluating EL programmatically:

      public String getCustomervalue() {
          FacesContext context = FacesContext.getCurrentInstance();
          Long productID = context.getApplication().evaluateExpressionGet(context, "#{item2.customerService.productID}", Long.class);
          // ...
      }
      

      (I assume that productID is a Long)

    3. Bind the datatable’s value to a DataModel:

      private DataModel<Item2> items;
      

      with

      <h:dataTable value="#{customerBean.items}" var="item2">
      

      and

      public String getCustomervalue() {
          Item2 item2 = items.getRowData();
          // ...
      }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have a search screen and I want to show results by searching specific data.My
I have a search results screen and in the results payload supplied I get
I have started learning MVC2. I developed a simple customer search screen with Jquery
I want to display search result on the screen, i have implemented in such
I have an asp.net search screen which displays the results in a new browser
I have a .aspx search screen that displays the results of the search in
I have search screen which has 10 fields and involves around 5 to 6
I have a search screen in my WPF application. The screen is implemented as
I have a lookup screen with 25 fields. When the user clicks the search
I have a .net application which includes search screen which has a panel with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.