-
1. Re: DBCS inplaceInput treeNode causes javascript error
ilya_shaikovsky Mar 10, 2010 4:37 AM (in response to zjda)reproduced. now checking how to resolve.
B.t.w. it's not a issue reason but just question to you. Do you really need to call jsFunction oncomplete? Is it intended use of two ajax requests instead of single one? Why you just not re-rendering in support?
-
2. Re: DBCS inplaceInput treeNode causes javascript error
ilya_shaikovsky Mar 10, 2010 8:35 AM (in response to zjda)http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_tree.html
read about converters for tree component
-
3. Re: DBCS inplaceInput treeNode causes javascript error
zjda Mar 11, 2010 12:11 PM (in response to ilya_shaikovsky)Hi Ilya,
I am using the jsFunction to work around the problem I reported before: http://community.jboss.org/thread/14582?tstart=0. Nick's suggestion is better and I should use his workaround.
As you pointed out, I need a converter for the tree and I created one for it:
public class DbcsTreeRowKeyConverter extends TreeRowKeyConverter {
@Override
protected String convertKeyToString(FacesContext context, UIComponent component, Object value) {
long sum = 0;
String s = value.toString();
for ( int i = 0; i < s.length(); ++i ){
sum += (short) s.charAt(i);
}
return Long.toString(sum);
}
}After adding rowKeyConverter="test.DbcsTreeRowKeyConverter" to the tree, there is no javascript error and inplaceInput can be activated. However, the value of the inplaceInput CANNOT be updated anymore (NodeData.setValue is not called when changing the value in inplaceInput). I thought my DbcsTreeRowKeyConverter caused the problem. However, when I set rowKeyConverter="org.richfaces.TreeRowKeyConverter" for the tree and remove the DBCS node (since TreeRowKeyConverter does not handle DBCS), I got same result. Therefore, I think rowKeyConverter attribute and <a4j:region> do not work with each other. If I remove the <a4j:region> around the <rich:inplaceInput>, it works fine (but, the whole tree will be decoded). Is it a bug in RF or do I miss something?
Your help is appreciated!
-ZJ
-
4. Re: DBCS inplaceInput treeNode causes javascript error
zjda Apr 15, 2010 11:36 PM (in response to zjda)Hi.
I am trying to make it simple. When I add rowKeyConverter="org.richfaces.TreeRowKeyConverter" to the tree, <rich:inplaceInput> will NOT submit its new value to the server when it is modified (set method for propItem.nodeValue.value is not called). If I remove rowKeyConverter="org.richfaces.TreeRowKeyConverter", the inplaceInput will work fine.
<a4j:form id="propertyForm">
<rich:tree id="propertytree" value="#{propertyTree.data}" var="propItem" switchType="client"
nodeFace="#{propItem.nodeValue.type}" rowKeyConverter="org.richfaces.TreeRowKeyConverter"
requestDelay="400" eventsQueue="treeEventQueue" >
<rich:treeNode type="Number" ajaxSingle="true">
<h:panelGrid columns="3">
<h:outputLabel value="#{propItem.nodeValue.name}:" for="num_property" />
<a4j:region>
<rich:inplaceInput id="num_property" editEvent="ondblclick"
defaultLabel="Double Click to Edit" value="#{propItem.nodeValue.value}" minInputWidth="250px"
selectOnEdit="true">
<a4j:support event="onviewactivated" reRender="propertyPanel"/>
</rich:inplaceInput>
</a4j:region>
<h:message for="num_property" errorClass="ValidateError" />
</h:panelGrid>
</rich:treeNode>
</rich:tree>
</a4j:form>Is it a RF bug?
Thanks,
-ZJ
-
5. Re: DBCS inplaceInput treeNode causes javascript error
ilya_shaikovsky Apr 16, 2010 3:51 AM (in response to zjda)I guess you have just conversion errors. Add rich:messages and check the results of converter methods in debugger.. But removing it - not an option becuase rowKey should not contain special characters and them should be escaped.