Home › Forums › Presentation › Screens › How to create picker to capture instances of a new class
Tagged: Picker
- This topic has 3 replies, 2 voices, and was last updated 7 years, 4 months ago by jason ng.
-
AuthorPosts
-
-
August 22, 2017 at 9:54 am #8644jason ngParticipant
Hi,
I am trying to make the picker element from the UI be able to display instances of a new class for user selection. What I have done so far are as follow:
- Created a new class named Client with 2 attributes firstName and lastName
- Created persistence mapping for both the attributes
- Created a form list named ClientList with class set to Client and added firstName to the form
- Created a ClientPicker screen where the form under Common(FormRef) is set to ClientList and name set to frmClientList. Under the UI Action tab created a Script with Event set to sysProperties and Source set to frmClientList. The script are (source’fireUIEvent (UIEvent’new “sysOK” parameter source))
- Seed 2 instances of the Client class with pickerM1 set to ClientPicker and checked the instance existence with read-instance
Then I went to the UI and bounds the picker to this class. But then when I try press the arrow button It gave me errors. Is there anything that I missed?
0 -
August 23, 2017 at 4:24 pm #8666Peter MurrayParticipant
Hi Jason,
Can you provide the error/stack trace/screen shot to help give us some more context? Â Also, from where are you launching the picker?
Thanks,
Peter
0 -
August 24, 2017 at 10:56 am #8696jason ngParticipant
Hi Peter,
I have attached a screen shot for my picker screen The following is the stack trace:
; 10:51:56,843 ERROR [FlatApplicationController] (http-7080-exec-2) —– Dispatch Err Info| Exception: nexj.core.util.UncheckedException: Missing source form ref in picker popup “DOLClientPicker”. (err.client.popupController.missingSourceFormRef) Ctrl Id: <no ids received> View – ApprovalDetailPortlet$portletRef10C9EEB4E8B1584AAB8866E6F38F06D231 Popup – <none>
; 10:51:56,843 ERROR [FlatApplicationController] (http-7080-exec-2) —– Application State| Active Screen: ScreenView{ApprovalDetailPortlet$portletRef10C9EEB4E8B1584AAB8866E6F38F06D231} Popup: <none>
; 10:51:56,843 ERROR [FlatApplicationController] (http-7080-exec-2) —– Application State| Popup Holder: ApprovalDetailPortlet Popup : <none> Ctxt Change State: 0
; 10:51:56,843 ERROR [FlatApplicationController] (http-7080-exec-2) Error processing the flat page request (reference id 4kiiju)
nexj.core.util.UncheckedException: Missing source form ref in picker popup “DOLClientPicker”. (err.client.popupController.missingSourceFormRef)
at nexj.core.controller.PopupController.?(PopupController.java:981)
at nexj.core.controller.PopupController.pickerInitialQuery(PopupController.java:1786)
at nexj.core.controller.PopupController.initialQuery(PopupController.java:1072)
at nexj.core.controller.GenericScreenController.activate(GenericScreenController.java:592)
at nexj.core.controller.PopupController.activate(PopupController.java:1031)
at nexj.core.controller.flat.FlatPopupDelegator.open(FlatPopupDelegator.java:66)
at nexj.core.controller.flat.FlatPopupController.open(FlatPopupController.java:145)
at nexj.core.controller.ContinuationInvoker.invoke(ContinuationInvoker.java:91)
at nexj.core.controller.flat.FlatPopupController.invoke(FlatPopupController.java:262)
at flow:QuestionnaireStreamClient.lambda(library:flow:QuestionnaireStreamClient:48)
0 -
August 25, 2017 at 11:20 am #8716Peter MurrayParticipant
It looks like you are missing the sourceFormRef property on the screen element. Â I’d recommend looking at other picker screens to help see what is needed to configure a picker. Â You may also be able to run the validation in studio to get a more user friendly error message.
If you click on the topmost “Screen” node in the outline view you should see a property in the Properties view called “sourceFormRef” that should be “frmClientList”.
The overall screen xml should look something like the following:
XHTML1234567891011121314151617181920212223242526272829303132333435363738394041424344454647<Screen caption="idss.ClientPicker.caption" height="450" sourceFormRef="frmClientList" width="475"><UIActions><UIAction event="sysProperties" source="frmClientList"><Script><![CDATA[(source'fireUIEvent (UIEvent'new "sysOK" parameter source))]]></Script></UIAction></UIActions><TableLayout horizontalMargin="30" horizontalSpacing="0" locale="en" name="TableLayout" style=""Popup"" verticalMargin="5" verticalSpacing="0"><Columns><Column/></Columns><Rows><Row height="100%"><Holder height="100%"><TableLayout horizontalMargin="0" horizontalSpacing="0" name="tableLayout0" verticalMargin="0" verticalSpacing="0"><Columns><Column/></Columns><Rows><Row height="100%"><Holder height="100%"><TableLayout horizontalMargin="0" horizontalSpacing="0" name="tableLayout1" verticalMargin="0" verticalSpacing="0"><Columns><Column/></Columns><Rows><Row height="100%"><Holder height="100%"><FormRef form="ClientList" name="frmClientList"/></Holder></Row></Rows></TableLayout></Holder></Row></Rows></TableLayout></Holder></Row><Row><Holder><FormRef form="PopupButtons" name="frmPopupButtons"/></Holder></Row></Rows></TableLayout></Screen>0
-
-
AuthorPosts
- You must be logged in to reply to this topic.