[Logo] OLD FORUM - Use new one: https://www.CaptainCasa.online/forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
FIXGRIDTreeItem#setEnabled?  XML
Forum Index -> Development
Author Message
bthalheim

Power User

Joined: 05/04/2012 11:45:24
Messages: 72
Offline

Hi,

I am using a ComboField with a FIXGRIDTree to have something like a hierarchic Combobox.
So far, this works really well.

Unfortunately my frontend requirements want me to put disabled endnodes into the tree. If I see that correct in the methods of FIXGRIDTreeItem, there unfortunately exists no such method, so FIXGRIDTreeItems are always enabled and cannot be disabled.

Is there any way to disable FIXGRIDTreeItem?

Regards,

Björn
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5555
Offline

Hi,

you can set ENABLED as attribute on TREENODE component level. If disabled then the tree will not react on "toggle" anymore. You still can select the line.

So you can add some enabled-property into you FIXGRIDTreeItem-Extension and bind to it via expression e.g. ".{enabled}".

Regards, Björn

Björn Müller, CaptainCasa GmbH
bthalheim

Power User

Joined: 05/04/2012 11:45:24
Messages: 72
Offline

Hi,

unfortunately, I have two problems with your suggestion.
1. It wouldn't help me if I can still select the line (because I would like the onRowSelect-Method not be called for these items
2. I am completely building up the Tree in Code and have no clue at the moment, how to get to the TreeNodes at this point (I only have FIXGRIDTreeItems at hand).

The code looks like this:
Code:
 			FIXGRIDTreeItem item;
 			item = new TreeNode(this.standards, datenbankFilterInfo.getOid(), datenbankFilterInfo.getName());
 			item.setText(datenbankFilterInfo.getName());
 


Right now, I simply resorted in not showing unsuitable items at all instead of trying to disable them.

Regards,

Björn
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5555
Offline

Hi,

the ENABLED expression has to be set in the TREENODE component in the layout (jsp/xml in case of static layout). But you are right: this will not have any influence on "onRowSelect".

Disabling of "onRowSelect" for certain items is not possible. You can only disable/enabled on full grid level...

Could you take a look onto the demo workplace: Grids > Tree > Select vs. Toggle? In this example the "semantic selection" is completely decoupled from the "cursor selection" in the grid. Maybe this would make sense for you as well?

Regards, Björn

Björn Müller, CaptainCasa GmbH
bthalheim

Power User

Joined: 05/04/2012 11:45:24
Messages: 72
Offline

Hi,

I'll recap the solution which works for me now.
In the JSP, the treeItem-Element has an attribute namend forground. I can bind this to a getter in my subclass of treeItem to have dynamic font colors depending on a flag which I introduce in this class named "active"
I cann ust this flag then in the methods getColor, onRowSelect and onRowExecute to have the desired look and behavior.

Pretty straightforward and not complicated at all this solution. I like it!

Thanks Björn for your help on this.

Regards,

Björn
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team