Is there a way to for action on s:button first before it jumps to the view page 
with params?
This is JSF code:

  | <rich:dataTable values="#{locations}" var="location"...>
  | ...
  | <a:commandLink value="Remove" action="#{applicationHome.deleteLocation}"/>
  | ...
  | </rich:dataTable>
  |                         <s:button value="Add New Location"
  |                                      
action="#{applicationHome.addLocation}" 
  |                                      view="/LocationEdit.xhtml"
  |                                      propagation="join"
  |                                      >
  |                             <f:param name="locationId" 
value="#{applicationHome.location.id}"/>
  |                         </s:button>
  | 
I need new location added to current application before edit it in 
LocationEdit.xhtml
Application.addLocation() is defined as followed

  |     @DataModelSelection("locations")
  |     private Location location;
  |     public Location getLocation() { return location; }
  | 
  |     public void deleteLocation()
  |     {
  |                     getInstance().getLocations().remove(location);
  |                     getEntityManager().remove(location);
  |                     location = null;
  |     }
  | 
  |     public void addLocation()
  |     {
  |             location = new Location();
  |             getInstance().getLocations().add(location);
  |             getEntityManager().persist(location);
  |     }
  | 

location is DataModelSelection to be used within dataTable but also be used 
when added new. If I use the edit panel in the same page, that will be no 
problem, but I have to jump to new page to do it, that same code won't work 
because addLocation() didn't get called before #{applicationHome.location.id} 
assignment.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4075396#4075396

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4075396
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to