Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Custom Liferay ScreenLets
Hello,
I am facing porblem in making custom liferay screenlet.
First i build JSON webservice (Student entity) through service.xml by doing remote service true and implemented method in StudentServiceImpl
The service i build is appearng in /api/jsonws and working properly.
Then i created a custom screen in ios using LiferayScreen and what i am trying to access the LRStudentService in ios so that i can use it in ios application.
Kindly suggest some solution how to use my custom api to be use in custom screenlet.
what are the steps to do this.
Thanks
I understood that you are building a screenlet from scratch and want to call your own remote service.
You should try to follow this tutorial. Specifically, this part and instead of this code:
let service = LRBookmarksEntryService_v7(session: session)
do {
try service.addEntryWithGroupId(LiferayServerContext.groupId,
... you add your own remote service call :)
Hi Javier ,
Thanks alot this worked for me.
One more thing, I have to use Liferay Forms in IOS application.
there are two possible solutions , one DDLFormScreenlet and other is WebContentScreenlet
Whileusing DDLFormScreenlet , I created Dynamic DataList in portal than accessed in app, It works fine except radioButtons, Location or Checkboxes are not visible in application. Data from app is saved in portal as well as in db.
On other hand i created Liferay Form and try to access this in DDLFormScreenlet in which i faced some issues.
- structureId and recordSetId are required attributes but Liferay form gives only structureId and formInstanceId
- created seperate dynamic data list having same data definition as per in form and give its recordSetId combine with Liferay Form structureId to DDLFormScreenlet. This displays form in app, submit successfull, a new entry in form is saved but with empty record.
Custom validations are also required in this scenario like i need to modify input number into mask and have to fix the half length like 66666XXX. How can i achieve this using Liferay forms or DDL in DDLFormScreenlet and should i need to validate it in app or webBackend.
Will be looking for your help
Thanks
I would recommend the DDLFormScreenlet approach... if you have access to the database, you can get the recordSetId from the table. It is usally +2/-2 from the structureId. Can you try with the real recordSetId of the form, it should insert and work fine...
If you need custom validation the best way of doing it is setting a listener in the field either with the id of the field or inspecting the view.
Hi Javier
Thanks for your suggestion.
Can you please suggest in DDLFormScreenLet should i use Liferay Forms or DynamicDataList.
Thanks
Hi Javier,
I tried DDLFormScreenlet with Liferay forms but still facing error in submitting form. EmailForm displaying ID: 48718. I consider this id as recordSetId and tried structureId as 48716 , 48720 this is not loading form. while in database this formInstance have structureId 48715. when i pass 48715 as structureId this loads the form but gives error while submitting form.
Error Domain=com.liferay.mobile.sdk Code=2 "No DDLRecordSet exists with the primary key 48718" UserInfo={NSLocalizedFailureReason=com.liferay.dynamic.data.lists.exception.NoSuchRecordSetException, NSLocalizedDescription=No DDLRecordSet exists with the primary key 48718}
Also attaching some screenshots.
Please have a look on this.
Thanks
Attachments:
I suppose you are using 7.1. With 7.0 it was possible to use the DDLFormScreenlet with both forms and DDL but with 7.1 is not possible. If you want to use DDLFormScreenlet you could...
- Use the new forms screenlet (in beta, using apio APIs)... documentation will arrive soon but right now it's pretty much undocumented.
- Add a custom interactor that allows you to submit the form (I could send it to you).
- Use DDL instead of forms.
I could guide you in whatever solution you prefer. The checkbox issue looks like the app is just missing the theme or something similar, should be easy to fix.
Hi Javier,
Appologies for not replying, was on holidays.
Yes we are using 7.1 so now we have to go with DDLForm. Custom Interactor seems to be a better option for our scenario , it will be thankful if you send.
Thanks for your help.
Powered by Liferay™