This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
I've been looking in to creating client side validation for form fields in Laszlo, which would involve the field-to-field validate-on-tab behavior that is being described.
I was planning on doing this using a Java-based form validation framework that I wrote in-house several years back, which I'm currently revamping. Effectively, you place all your validation and form field description (is each field a text field, radio button, etc.) in to the framework, and it renders the form in to XML or an HTML/Swing GUI, and provides services for syncing changes to the form (through user input) with the form "model" and allowing the model to be validated using the specified rules. (I know there are ways to do this in web frameworks like Struts, Spring MVC, etc., but I needed a solution that was framework independent and easy to use - so I rolled my own).
My plan with Laszlo was to take the XML generated by the form/validation descriptor and write Laszlo utility classes that could replicate the fields and validation locally (using regexs for pattern validation, and maybe RPC calls for validation that requires interaction with the back end, such as checking an ID against a database table). I haven't gotten to this point yet, but I hope to in the next few months with the project I'm presently engaged in.
Is anybody else working with Laszlo and form validation who can share their experiences or thoughts on the subject?
I'm currently writing a document that I'll post on the Spring, Laszlo, and Liferay sites that demonstrates the usage of Rich Internet Applications via Laszlo with a Spring middle-tier as JSR-168 compliant portlet.
I was wondering if you've had a chance to write this document yet? My company is interested in writing Spring/Laszlo apps, and your doco would be really useful...
I was able to create a hack (I wouldn't call it a solution) openlaszlo and SWF to work together. I might write a white paper and provide it, but that depends on when I get time (may not be soon). However these are the steps I followed for getting it working.
I use dhtml compiler from Laszlo (but should be the same for swf as well, I suppose).
1. Write a view (look at jstlview etc.) to compile laszlo files. Look at the Main.lzc and Compiler.compile in Laszlo to find out how it can be done. In the view get the lzx file and compile it to the swf or js file we need.
2. This has to be embedded into html (Look at Browser integration chapter). I am currently using the compiled file embedded, but I think embedding it directly should work as well.
3. After embedding one will be able to get the UI rendered in the browser, but submit will not go to web flow. This is because Laszlo seems to be using XHR for all requests with the file name as the URL. Hence Spring Web Flow is not triggered. For this I have used a workaround where I embed the compiled laszlo file in a form and on clicking the submit button, I fill up a div with all the required inputs (hidden) and submit the form, instead of calling the Laszlo doRequest or submit calls.
4. For embedding and for future data to be embedded I am using Apache velocity to make the job easier. We might be able to use the Velocity view which comes with Spring to make the stuff faster, but I haven't reached there yet.
If you need more details on any of these let me know and I will be more than happy to help.