-
1. Re: a4j:support action is not called
nbelaevski Aug 1, 2011 2:04 PM (in response to faupel)Hi Maximilian,
Please take a look: http://community.jboss.org/wiki/CommonAjaxRequestsProblems#actionNotCalled
-
2. Re: a4j:support action is not called
faupel Aug 1, 2011 5:46 PM (in response to nbelaevski)Hi Nick,
thank you for your answer, but I already know that. I read about 100 posts and tried everything. I have an output for faces messages in my template and I did override the equals and hashCode methods in my entities.
That's what I put in my template:
a4j:outputPanel ajaxRendered="true">
<h:messages/>
</a4j:outputPanel>
I also put a <a4j:log /> tag on my page, but I can only see, that an ajax request is sent and I can't see any errors.
Thanks
Maxi
-
3. Re: a4j:support action is not called
nbelaevski Aug 1, 2011 6:17 PM (in response to faupel)OK, so we can exclude the most frequent coding issues. Can you please check this issue: https://issues.jboss.org/browse/RF-3314 to see if it's applicable to your case?
-
4. Re: a4j:support action is not called
faupel Aug 2, 2011 3:41 AM (in response to nbelaevski)Two of my entities are in seams page scope. If I change that to conversation or session scope, the problem is still the same.
-
5. Re: a4j:support action is not called
faupel Aug 2, 2011 4:43 AM (in response to faupel)Hi Nick,
I wrote a little example to reproduce the error. I hope you can see what I made wrong.
@Entity @Scope(ScopeType.SESSION) public class City implements Serializable { /** * */ private static final long serialVersionUID = -5262788797651793204L; private Long id; private Integer version; private String name; private List<Street> streets = new ArrayList<Street>(); @Id @GeneratedValue public Long getId() { return id; } public void setId(Long id) { this.id = id; } @Version public Integer getVersion() { return version; } public void setVersion(Integer version) { this.version = version; } public String getName() { return name; } public void setName(String name) { this.name = name; } @OneToMany(mappedBy = "city") public List<Street> getStreets() { return streets; } public void setStreets(List<Street> streets) { this.streets = streets; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof City)) return false; City subject = (City) obj; return EqualsUtil.areEqual(this.id, subject.id) && EqualsUtil.areEqual(this.name, subject.name); } }
@Entity @Scope(ScopeType.SESSION) public class Street implements Serializable { /** * */ private static final long serialVersionUID = -7650360829992051220L; private Long id; private Integer version; private String name; private City city; @Id @GeneratedValue public Long getId() { return id; } public void setId(Long id) { this.id = id; } @Version public Integer getVersion() { return version; } public void setVersion(Integer version) { this.version = version; } public String getName() { return name; } public void setName(String name) { this.name = name; } @ManyToOne public City getCity() { return city; } public void setCity(City city) { this.city = city; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (!(obj instanceof Street)) return false; Street subject = (Street) obj; return EqualsUtil.areEqual(this.id, subject.id) && EqualsUtil.areEqual(this.name, subject.name); } }
public final class EqualsUtil { public static boolean areEqual(boolean b1, boolean b2) { return b1 == b2; } public static boolean areEqual(char c1, char c2) { return c1 == c2; } public static boolean areEqual(long l1, long l2) { return l1 == l2; } public static boolean areEqual(float f1, float f2) { return Float.floatToIntBits(f1) == Float.floatToIntBits(f2); } public static boolean areEqual(double d1, double d2) { return Double.doubleToLongBits(d1) == Double.doubleToLongBits(d2); } public static boolean areEqual(Object o1, Object o2) { return o1 == null ? o2 == null : o1.equals(o2); } }
@Local public interface CityLocal { public void initCityList(); public List<City> getCityList(); public void selectStreet(Street street); public void destroy(); }
@Stateful @Name("cityAction") @Scope(ScopeType.SESSION) @Restrict("#{identity.loggedIn}") public class CityAction implements CityLocal { @Logger private Log log; @PersistenceContext private EntityManager em; @DataModel private List<City> cityList; @Factory("cityList") @Begin(join = true) @SuppressWarnings("unchecked") public void initCityList() { cityList = em.createQuery("from City c").getResultList(); } public List<City> getCityList() { return cityList; } public void selectStreet(Street street) { log.info("selecting street {0}", street.getName()); } @Destroy @Remove public void destroy() { } }
<h:form id="cityForm"> <rich:panel> <h:panelGrid columns="1"> <a4j:outputPanel ajaxRendered="true"> <h:messages /> </a4j:outputPanel> <a4j:log /> <s:decorate id="cityDecorate" template="/layout/display.xhtml"> <ui:define name="label"> Cities </ui:define> <h:selectOneMenu id="selectCity" value="#{city}"> <s:selectItems id="cityItems" var="city" noSelectionLabel="" label="#{city.name}" value="#{cityList}" /> <s:convertEntity /> <a4j:support event="onchange" reRender="streetPanelGroup" /> </h:selectOneMenu> </s:decorate> <h:panelGroup id="streetPanelGroup"> <a4j:repeat var="street" value="#{city.streets}"> <h:panelGrid columns="2"> <h:outputText value="#{street.name}" /> <a4j:commandButton id="select" value="select" action="#{cityAction.selectStreet(street)}" /> </h:panelGrid> </a4j:repeat> </h:panelGroup> </h:panelGrid> </rich:panel> </h:form>
-
6. Re: a4j:support action is not called
srikannan_89 Aug 8, 2011 8:49 AM (in response to faupel)Hi Nick
i have problem in my code. Im using rich:modalPanel in my Code. inside that modal h:command Button is not working. it not hit the flow written in the flow.xml file.please refer some solution to me for this problem
Header 1 <?
xml version='1.0' encoding='UTF-8'
?>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<
ui:composition xmlns=
"http://www.w3.org/1999/xhtml"
X Close
</
ui:composition
>
Header 1 <
flow xmlns=
"http://www.springframework.org/schema/webflow"
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"
<!-- <transition on="add" >-->
<!-- <evaluate expression="saveDetail.test(flowScope.detail)"/></transition>-
<transition on="panel1"> <evaluate expression="saveDetail.adduser(flowScope.skill,flowScope.detail)" /> <evaluate expression="new com.bankofireland.internalportal.beans.Skill()" result="flowScope.skill" /> </transition>
</
flow
>
>
-
longin.xml 1.8 KB
-
ce.xhtml.zip 1.2 KB
-