Need help To remove Constraints

asked 2012-01-09 05:31:46 +0800

siva477 gravatar image siva477


I create some dynamic components with in the TREE structure. With in the build stage i set constraints to all the components. Is it possible to clear the constraints of all the components when i need to remove. Components are may be textbox, decimalbox, combobox.....etc

NOTE: There is no identity for each component.

Thanks in Advance

With Regards,
Siva Kumar.M

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2012-01-09 09:58:16 +0800

vincentjian gravatar image vincentjian
2245 6

updated 2012-01-09 09:59:17 +0800


It is better not to create Tree dynamically. If it is not possible to avoid, it is recommended to specify id to input component if the creation phase has some information that is unique.
However, you can try using the following untested code:

Tree tree = (Tree) Path.getComponent("path/to/treeId");
for(Treeitem treeItem : tree.getItems()) {
	for(Component treeCell : treeItem.getTreerow().getChildren()) {
		for(Component comp1 : treeCell.getChildren()) {
			if(comp1 instanceof Textbox) {
				((Textbox) comp1).setConstraint("");

The sample code above is not complete due to Tree structure is complicated with Treechildren, Treeitem, Treerow and Treecell. Therefore, I assume the tree depth is 1.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2012-01-09 05:31:46 +0800

Seen: 135 times

Last updated: Jan 09 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More