myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chamber (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Issue Comment Edited] (TRINIDAD-2119) Error in dialog using valueChangeEvent and PPR
Date Mon, 18 Jul 2011 08:57:00 GMT

    [ https://issues.apache.org/jira/browse/TRINIDAD-2119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13066859#comment-13066859
] 

Chamber edited comment on TRINIDAD-2119 at 7/18/11 8:55 AM:
------------------------------------------------------------

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 = event.getNewValue()).longValue();
           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? 



      was (Author: machamber):
    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? 


  
> Error in dialog using valueChangeEvent and 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

        

Mime
View raw message