This discussion is archived
3 Replies Latest reply: Aug 29, 2013 10:50 PM by Frank Nimphius RSS

Prerender event not refreshing fields on screen

user12209214 Newbie
Currently Being Moderated

Hi,

 

JDev version : 11.1..2.3.0

 

I am using prerender event in my fragment page

 

<f:event type="preRenderComponent" listener="#{bean.renderfragment}"/>

 

Now in bean.renderfragment I have written following code to refresh the iterator binding.

 

            DCIteratorBinding iterBind = (DCIteratorBinding)bindings.get("Table1RO1Iterator");

            iterBind.executeQuery();           

            iterBind.refresh(1);

 

Now problem is in my jsff page its not reflecting values for the fields which have value coming from bindings(like value="#{bindings.field1.inputValue}"  ) ,but in the managed bean i can see those values.

 

Please suggest me how can i fix this problem.

 

Regards,

  • 1. Re: Prerender event not refreshing fields on screen
    Frank Nimphius Employee ACE
    Currently Being Moderated

    Hi,

     

    first of all, why do you need iterator.refresh() if you execute it before? Also, why do you execute it in the process of a component rendering and not trigger it from e.g. a user event like value change or action? One thing you want to do anyway is to clear the component value (resetValue()) to allow the component to release its current value if you do the iterator refresh that late in the cycle

     

    Frank

  • 2. Re: Prerender event not refreshing fields on screen
    user12209214 Newbie
    Currently Being Moderated

    Use case is I m doing some checks before showing data ,so during page load i had to show popup if one of the validation fails ,and if validation passes then show data in fields which r getting data from bindings.

     

    So I used prerender component event ,as thats only place i can get popup to show up while loading page in case any validations fails.

     

    But now issue is its not refreshing data in successful case.

  • 3. Re: Prerender event not refreshing fields on screen
    Frank Nimphius Employee ACE
    Currently Being Moderated

    Hi,

     

    strange to test validation when page renders and not when data is input to the system. This basically sounds like you don't trust your data, which is odd. If you navigate to the page, what if you use a method call activity before entering the page to perform the data validation checks? If there is an error, use FacesMessage to display it.

     

    If you continue with yur approach (which I don't think it sounds like a sound solution), try and reset the component value so it is forced to re-read the underlying value.

     

    Frank

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points