[
https://issues.apache.org/jira/browse/TRINIDAD-2119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13066859#comment-13066859
]
Chamber commented on TRINIDAD-2119:
-----------------------------------
Tentative solution:
<tr:inputText id="num" value="#{pageFlowScope.num}"
valueChangeListener="#{dialogBacking.updateDescription}"
autoSubmit="true" required="true" maximumLength="25" />
<tr:inputText value="#{pageFlowScope.descripcion}"
binding="#{dialogBacking.inputDescripcion}" partialTriggers=":num"/>
public void updateDescription(ValueChangeEvent event) {
Long num =
Long.parseLong(RequestContext.getCurrentInstance().getPageFlowScope().get("num").toString());
RequestContext requestContext = RequestContext.getCurrentInstance();
requestContext.getPageFlowScope().put("num", num);
requestContext.getPageFlowScope().put("descripcion", num);
FacesContext context = FacesContext.getCurrentInstance();
String refreshpage = context.getViewRoot().getViewId();
ViewHandler ViewH = context.getApplication().getViewHandler();
UIViewRoot UIV = ViewH.createView(context, refreshpage);
UIV.setViewId(refreshpage);
context.setViewRoot(UIV);
}
Could anybody come up with something more refine?
> dialog valueChangeEvent PPR
> ---------------------------
>
> Key: TRINIDAD-2119
> URL: https://issues.apache.org/jira/browse/TRINIDAD-2119
> Project: MyFaces Trinidad
> Issue Type: Bug
> Components: Components
> Affects Versions: 2.0.0
> Environment: Tomcat 6.0.32, Spring 3.0.5
> Reporter: Chamber
>
> Launch dialog passing Information In and Out and updating one of the fields
> Code od the dialog:
> <tr:document>
> <tr:form>
> <tr:panelFormLayout labelAlignment="start">
> <tr:group>
> <tr:inputText id="num"
> value="#{pageFlowScope.num}"
>
> valueChangeListener="#{dialogBacking.updateDescription}"
> autoSubmit="true"
> required="true" maximumLength="25" />
> <tr:inputText
> value="#{pageFlowScope.descripcion}"
>
> binding="#{dialogBacking.inputDescripcion}" partialTriggers=":num"/>
> </tr:panelFormLayout>
> </tr:form>
> </tr:document>
> </ui:composition>
> Code of the backing Bean:
> @ManagedBean(name = "dialogBacking")
> @ViewScoped
> public class DialogBacking {
> ...
> private UIXInput inputDescripcion;
> public void updateDescription(ValueChangeEvent event) {
> getDescripcionInput().setValue(event.getReturnValue());
> }
> Error produced in the browser:
> clientErrorTypeErrorMyFaces ERROR:Class
> Afected:myfaces._impl.xhrCore._AjaxResponse
> Method afected:replaceHTMLItem
> Type of the error:TypeError
> Name of the Error:Cannot read property 'childNodes' of undefined
> Description of the Error:undefined
> Number of the Error:undefined
> Number of the line of the Error:3221
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira