This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

How to refresh (rerender) a subview with Dynamic Faces  RSS feed

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody:

I keep on learning...my first problem today is that I need to refresh a subview after the user updates data in a form.

The subview id is vistaCliente and inside there is an Ajax Zone <jsfExt:ajaxZone id="autoUpdate"> ... </jsfExt:ajaxZone>

The user fills a form then has to click on a commandLink:

The method processAction render the subview in this way:

The subview "vistaCliente" (is a form too) is created at the sametime with the first form but not showed ( <f:subview id="vistaCliente" rendered="false"> ).

The function of vistaCliente is to show the data if the customer is already registered in the database. If the customer is not in the database, vistaCliente is ready to get the additional data of the new customer for saving in the database.

To make things simpler the vistaCliente has its own back bean ... also because thinking of reusing it in other pages.

The question: what is the way of using Ajax to refresh the subview "vistaCliente" when the customer is in the database from the processAction. Or put it in another way...how to refresh a view from another view? I tried to create an object of the VistaClienteBean from another bean and used the set methods to refresh the data but it doesn´t work... Do I have to use the same back bean?

As usual many thanks for your cooperation.






 
Enrique Villamizar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another attempt,

In the first back bean: A call to the update() method of the second bean.

The update method of the second bean recieve data and call its own setters to updated the initial information. But it doesn't work.

I understand that if the view and the subview depended on the same back bean this would work.
Am I right?

But I also think that the two back bean communication is possible....yes?

I read but didn't understand in Project Dynamic Faces -- a Variation on Adding Ajax to JavaServer Faces Technology Components :

<jsfExt:ajaxZone id="selectzone"
action="#{updateOutput}">
<h:commandButton id="Selection1" ...
actionListener=.../>
<h:commandButton id="Selection2" ...
actionListener=.../>
<hutputText value= .../>
<h:selectOneMenu .../>
</jsfExt:ajaxZone>



action="#{updateOutput}" ...the updateOutput is a property or a mehtod, is Javascript or Java? where and how I code the updateOutput to refresh the subview?


Please, could anyone give me a hand?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!