Embedding a flow in a DOJO dialog - spring

I want to create a modal dialog wizard using spring web flow and dojo.
I searched for embedding the flow in a dialog using embedded mode. But I found very few examples related to this. In these examples, they used JSF dialogs and tiles framework to partially render a form.
Can we do this without using JSF and tiles framework but using jsp and dojo?
Can anyone help me to create a wizard embedded in a dojo dialog using spring web flow?

I wouldn't depend on the dojo framework I believe is no longer supported with webflow. Moreover, webflow wasn't really designed (without hacks) to be embedded inside modal dialogs. It was designed as a simple "flow" navigation from html page to page.
To achieve what you want you'll have to use jquery (or some javascript library) to interact with the current flow via ajax calls to predefined transitions/fragments and manually via javascript take the response html fragments returned by webflow contents and change the contents of your modal dialog box. You could argue this is a "hack" but this is how I achieved what you desire using webflow.
A user asked a similar question a few months ago and i provided a thorough answer explaining how to use webflow + ajax + transitions in dialog boxes.
How to include a pop-up dialog box in subflow

Related

Liferay 6.2 ajax portlet content rendering

I've noticed that sometimes liferay loads the content of a portlet using ajax. For example, we've done some heavy duty web content templates and sometimes I can see a loading spinner while rendering the page.
I know about ajaxable and render-weight properties in liferay-portlet.xml, but... how does liferay know whether to render a portlet content using ajax or not? and second question, is it any way to disable this feature for asset publisher and web content display portlets without changing liferay's internal liferay-portlet.xml?
By default ajaxable is set to true.
In order to modify this you can try updating the render-weight and ajaxable attributes using the class PortletPreferences.
Read more here: https://www.liferay.com/community/forums/-/message_boards/message/11904281

Why does ajax and jsf work nicely together? How do Ajax lifecycle plug in with normal JSF lifecycle?

I have used JSF 1.2 but new to JSF 2.0 . It seems like JSF 2.0 seamlessly supports ajax functionality via <f:ajax> but I am not clear yet how ? I would like to understand what makes these two powerful technologies to work so nicely together ? How does the two lifecycles interact ?
P.S: I am familiar with ajax and javascript. So you can base your answer on that premise.
The question is really broad and I would suggest to search for the appropriate tags to understand its usage in real situations. BalusC has contributed much here on stackoverflow and has also written excellent tutorials that Xtreme Biker made a reference to.
Due to abscence of answers I would offer a basic vision of how ajax works within JSF. There is a special Javascript library in JSF which makes it possible to perform ajax calls to the server with jsf.ajax.request(...). To ease development, there are components that you may attach ajax behaviour to. Typically you will use <f:ajax> tag on the component of your choice, like <h:commandButton>, to add ajax functionality to it.
In the old times we would send an asynchronous XMLHttpRequest via get or post to the server and wait until server sends us postback data which we will get most typically in JSON or XML format for client'side processing and update the view via document.getElementById(...) or by more convenient methods introduced by modern Javascript libraries. I think that in the end this is what JSF does behind the scenes.
In JSF 2.0 <f:ajax> tag was introduced which helps partially submit data, process it on server and partially update your view. For this the ajax tag has the following most important features/attributes: <f:ajax execute="..." render="..." event="..." listener="..." onevent="..." />. Let's take a closer look on all of them.
execute attribute tells JSF about what elements should be updated/processed on the server during this request by specifying a list of element ids;
render attribute tells JSF which components shall be replaced after ajax call is finished - the new elements that were rendered on the server shall replace the old ones with specified ids after partial page update;
event attribute defines events on which an ajax call shall take place, for instance, in case of a command button the event may be a click event, in case of an input text field the event may be a keyup, or blur event;
listener attribute defines a binding to a managed bean method of type public void processAjaxRequest (AjaxBehaviorEvent event) { } that will be triggered on ajax request and executed on server, before partial page update is done;
onevent attribute defines a javascript function to call during different phases of ajax request.
You may consult another excellent tutorial written by Marty Hall on ajax here.
I didn't intend to make an overview of ajax features in JSF 2.0, but rather to make a short introduction to get a basic grasp of ajax functionality.

ReCaptcha: cant get it to work in a exisiting modal dialog consuming web service

Community -
I'm stuck for couple days on this and decide to go with a iFrame solution and a regular embedded page with a basic reCaptcha plugin using a Page.IsValid {} on the server functionality.
Basiccaly I have an older WebForm ASP.NET 2.0 clients website with a Modal Dialog implemented using a Ajax/JSON call to a MailSend WebService and now integrating a clients wish having a reCaptcha functionality within the modal dialog gets a pain.
After several trials with some basic code and all over not completed code pieces on several blogs around the net I do give up - I go to create a separate page with a regular send to friend mail form and will call it from the parent page with jQuery in a iFrame.
Did anyone had some more luck consuming a reCaptcha Validate Web Service within a modal dialog without a Postback or without using the iFrame way?
I'm thankful for any idea.
Martin
Allright. Me and my co-worker gave up on validate re-captcha thru web service. We finished the task with a iFrame and a jQuery FancyBox modal dialog solution. It solved our problem and it looks good. But I will come back to do the research and try the first way to solve as well at a later point.

Spring MVC and WML web page?

is it possible to contruct and use a WML page instead of a normal html page to render my views that contain a form?
i could not find any examples on how to achieve this and i could not even find the "form" tag in WML. Instead, from my understanding WML, uses cards with input tags to process a form of some sort but in Spring mvc's SimpleFormController it is used in conjunction to a html form not a WML input card.
Spring MVC's controller infrastructure doesn't care if the page is rendered in HTML or WML. Both HTML forms and WML cards end up generating HTTP requests when submitted, and the controller can't tell the difference.
However, Spring only provides an HTML form tag library, so if you want to generate WML, you'll have to do it all yourself.
Is this really something you want to get into, though? WML is obsolete, and only very old phones need it.

MVC - How to develop a wizard like control functionality in ajax

I thought I would ask here about how to develop a wiazrd like control
in ajax for MVC before I started it.
The control will have pages that have data entry controls and
on each page submission insert data into a database.
Any ideas how to go about this?
Malcolm
Are you using a JavaScript library? I know dojo has a wizard in dojox namespace, and I'm pretty sure there are wizards for jquery. If not, I'd do a wizard just like I would tabs, without the tab bar, and each view contains a form and next, previous, cancel and or restart buttons, all of which would handle the ajax calls/state management and change the view.
If it's a wizard you probably actually should use separate web pages rather than having a single page that's updated through ajax calls, that way the forward and back buttons can work as nature intended in the browser for moving forward and back through the wizard.
Of course you can use fragment tricks to get forward / back working in a single page but in my experience this is tricky.

Resources