• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to refresh (rerender) a subview with Dynamic Faces

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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=.../>
<h:outputText 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?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic