I have a feeling the answer to this is staring me in the face, but clearly I haven't yet put the pieces together in the right order to make it just so. So I apologize in advance. This is all in SmartGWT Power 11.1
Let's keep it simple: my goal is to be able to set a custom property on a custom component upon an event occurring within a UI defined in ComponentXML.
I have created my custom component class (IpListGridEditor), exposed it via the BeanFactory.MetaFactory, constructed the corresponding Component Schema and referenced it in a ComponentXML screen definition. This all works great, and we've been doing stuff like this for a long time now.
I can even set my custom property (parentKeys) within the ComponentXML without a problem.
However, upon let's say a recordClick event I wish to set my custom property with a line along the lines of:
I'm unclear whether or not use of the BeanFactory class should mean that I can access the getter and setter methods of parentKeys, but the method isn't recognized. Neither is the property itself directly accessible to me, although I did include reference to it in IpListGridEditor.ds.xml:
Perhaps I need to access the property through the static BeanFactory methods mentioned in the documentation? Or maybe I have to export the getter and setter methods via a JSNI method? Like I said, I'm pretty sure some combination of all that I've read will get me what I need but the combination of elements has so far eluded me. Can someone please supply me with a couple of pointers to set me on the right track? I won't necessarily need to be led there by the hand - just something to get me headed in the right direction.
Thanks!
Let's keep it simple: my goal is to be able to set a custom property on a custom component upon an event occurring within a UI defined in ComponentXML.
I have created my custom component class (IpListGridEditor), exposed it via the BeanFactory.MetaFactory, constructed the corresponding Component Schema and referenced it in a ComponentXML screen definition. This all works great, and we've been doing stuff like this for a long time now.
I can even set my custom property (parentKeys) within the ComponentXML without a problem.
Code:
<IpListGridEditor dataSource="PackingList" autoFetchData="true" ID="PackingList_PackingListGrid" name="PackingList_PackingListGrid" autoDraw="false" selectionType="single" showResizeBar="true" dockEditor="bottom" listEndEditAction="next" canEdit="true" editByCell="true" > <parentKeys><JS>{id:1}</JS></parentKeys> </IpListGridEditor>
Code:
<recordClick>this.setParentKeys({packingListId:record.id});</recordClick>
Code:
<DataSource serverType="component" ID="IpListGridEditor" inheritsFrom="IpListGrid" instanceConstructor="com.islandpacific.gui.client.base.IpListGridEditor"> <fields> <field name="parentKeys" type="AdvancedCriteria" basic="true"/> </fields> </DataSource>
Thanks!
Comment