-
1. Re: ReRenderd UIcommand not working
ilya_shaikovsky Jan 9, 2008 7:40 AM (in response to jmatters)you may not reRender that component that didn't present in DOM tree before request. Instead you should reRender some parent that was actually on the page before request.
-
2. Re: ReRenderd UIcommand not working
jmatters Jan 11, 2008 12:53 PM (in response to jmatters)Hi, thanks for your reply!
I am rerendering a parent object that is present from the page rendering on. It's a datatable:<h:form> <h:dataTable id="personSearchResult" var="person" value="#{personList.searchPersons}"> <h:column> <a4j:commandLink action="#{CaseHome.addPerson(person.id)}" value="#{person.givenName} #{person.familyName}" reRender="personList" ></a4j:commandLink> </h:column> </h:dataTable> </h:form>
Now #{personList.searchPersons} is null at page rendering. But then I've got:<h:form> <h:inputText value="#{personList.person.givenName}"> <a4j:support event="onkeyup" requestDelay="400" reRender="personSearchResult" action="#{personList.resultList}"></a4j:support> </h:inputText> </h:form>
and when #{personList.person.givenName} is not empty #{personList.searchPersons} returns a list. The table and the a4j:commandLinks are rendered perfectly fine, but the command links don't call the action...
Any hints appreciated!
- Chris -
3. Re: ReRenderd UIcommand not working
sergeysmirnov Jan 11, 2008 1:10 PM (in response to jmatters)you need to define the ide of the command component explicitly if it is in the rerendered area. Otherwise, the id of the regenerated component might not match the id assigned during the component tree restoring of the first JSF phase. This mismatch is not only one, but a very strong reason when the action is not processed on postback.
-
4. Re: ReRenderd UIcommand not working
jmatters Jan 11, 2008 1:51 PM (in response to jmatters)Hi, I added an id to the commandLink:
<a4j:commandLink id="addPersonLink" action="#{CaseHome.addPersonX(person.id)}" value="#{person.givenName} #{person.familyName}" reRender="personList" ></a4j:commandLink>
Sadly the action is still not being called...
The rendered commandLink now looks like this:<a href="#" id="personSearchList:0:j_id86:addPersonLink" name="personSearchList:0:j_id86:addPersonLink" onclick="A4J.AJAX.Submit('_viewRoot','personSearchList:0:j_id86',event,{'parameters':{'personSearchList:0:j_id86:addPersonLink':'personSearchList:0:j_id86:addPersonLink'} ,'actionUrl':'/case.seam?javax.portlet.faces.DirectLink=true'} );return false;">Test Person</a>
- Chris -
5. Re: ReRenderd UIcommand not working
sergeysmirnov Jan 11, 2008 2:06 PM (in response to jmatters)what the scope of the bean you use for the list ?
-
6. Re: ReRenderd UIcommand not working
jmatters Jan 11, 2008 2:48 PM (in response to jmatters)The bean is a seam component. It's kept in the seam coversation context.
-
7. Re: ReRenderd UIcommand not working
jmatters Jan 11, 2008 3:41 PM (in response to jmatters)I solved the problem by moving the list to a stateful bean, it's scope is also the seam conversation context.
Thanks for your help!
- Chris