Hi Fabio, Thanks for your reply. The problem is that the FieldPanel template is constructed and cloned before the Virtual Attribute is selected from the Drop Down list. Therefore, if it is a new attribute that is being added, we don't know at the point of cloning whether the Virtual Attribute name that will be selected will be read-only or not. Once the selection is made, I have no way of setting ReadOnly on the cloned object.
Does that make sense? Colm. On Thu, Feb 7, 2013 at 8:54 AM, Fabio Martelli <[email protected]>wrote: > > Il giorno 04/feb/2013, alle ore 18.39, Colm O hEigeartaigh ha scritto: > > > Hi all, > > > > Perhaps this is extremely obvious... > > > > I'm running into a problem with a fix for SYNCOPE-215. Essentially there > is > > a drop down list of Virtual attribute names, and I want to make the > > corresponding text field "read-only" if the Virtual attribute that is > > selected is "read-only". > > > > The DropDownChoice object in VirtualAttributesPanel already has an > "onblur" > > component that allows me to see what was selected. The problem is that > the > > "Panel" object corresponding to the text field, is passed through to a > > MultiValueSelectorPanel object, which clones it: > > > > final FieldPanel fieldPanel = panelTemplate.clone(); > > > > So even if I call "setReadOnly" on the panel in VirtualAttributesPanel, > the > > text field does not turn read-only. Is there an obvious way to solve this > > problem? > > Hi Colm, I think that setReadOnly method on the field panel template > should solve your problem. > The clone method is overridden into FildPanel class. This method set the > read only value explicitly: > > panel.setReadOnly(isReadOnly()); > > Have you already tried by calling the setReadOnly method on the field > panel template? > > Best regards, > F. > > -- Colm O hEigeartaigh Talend Community Coder http://coders.talend.com
