-
1. Re: dataTableEdit of sample is bug?
ilya_shaikovsky Jun 13, 2011 1:27 PM (in response to nijinsky)1 of 1 people found this helpfulplease rise an issue.. it's just application problem related to http://ishabalov.blogspot.com/2007/08/sad-story-about-uiinput.html
-
2. Re: dataTableEdit of sample is bug?
nijinsky Jun 14, 2011 7:25 AM (in response to ilya_shaikovsky)Thank you Ilya Shaikovsky.
The explanation of the site was regrettable.
However, it was possible to solve it from the sample of measures by the following methods.
------------------------------------------------------------------------------------------------------------------------------------------
---CarsBean------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
public void hide(String parentId){
clear(parentId);
}
private void clear(String parentId){
FacesContext context = FacesContext.getCurrentInstance();
UIComponent component = context.getViewRoot().findComponent(parentId);
Map<String, UIInput> inputComponents = new HashMap<String, UIInput>();
findComponent(component,inputComponents);
UIInput input = null;
for(Map.Entry<String, UIInput> entry : inputComponents.entrySet()) {
input = entry.getValue();
input.setSubmittedValue(null);
input.setValue(null);
}
}
private void findComponent(UIComponent component, Map<String, UIInput> inputComponents) {
if (component instanceof UIInput) {
inputComponents.put(component.getClientId(), (UIInput) component);
}
Iterator<UIComponent> child = component.getFacetsAndChildren();
while (child.hasNext()) {
findComponent(child.next(),inputComponents);
}
}
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
---dataTableEdit-sample.xhtml-----------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:util="http://java.sun.com/jsf/composite/components/util">
<rich:popupPanel header="Edit Car Details" id="editPane" domElementAttachment="parent" width="400" height="170">
<util:panel id="samplePanel">
<a4j:commandButton value="Cancel"
action="#{carsBean.hide('form:samplePanel')}" immediate="true"
oncomplete="#{rich:component('editPane')}.hide(); return false;" />
</util:panel>
</rich:popupPanel>
------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
---/resources/util/panel.xhtml-------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:composite="http://java.sun.com/jsf/composite">
<composite:interface>
</composite:interface>
<composite:implementation>
<a4j:outputPanel>
<composite:insertChildren />
</a4j:outputPanel>
</composite:implementation>
</html>
------------------------------------------------------------------------------------------------------------------------------------------
It has not understood though it only has to provide the function like "prependId" of "h:form" in tag.
Therefore, [/resources/util/panel.xhtml]was added.
Please refer though it is thought that it is possible to improve it still.