voyent
Partial submits and Spring Web Flow eventIds. (and IceFaces action-to-eventId mapping in general)  XML
Forum Index -> General Help
Author Message
Morningrise

Joined: 16/Feb/2009 00:00:00
Messages: 24
Offline


Hi again!

Is it possible to fire an eventId for Spring Web Flow with a partial submit, just like on normal submits?

When I bind a model to the view-state of my flow, the partially submitted values are instantly set in my model. This is the good news :-)

But what I'd like to do is, partially submit a value, and then catch the event in my web flow (and perform a DB query.)
My problem is now, that I somehow can't see that an event is detected by web flow in my case.
...on the other hand, setting the values in the bound model works just fine.

In my page I have inputTexts like this:
Code:
 <ice:inputText id="nickname"
        value="#{registration.nickname}"
        partialSubmit="true" 
        action="nicknameCheck">
 </ice:inputText>
 


In the web-flow, inside the view-state there is something like this:
Code:
 <transition on="nicknameCheck">
     <!--
           call the service here (check nickname)
     -->
 </transition>
 


My hope was that the action="nicknameCheck" will sent an nicknameCheck eventId for web flow, but I think it doesn't.


How does the action to web flow mapping with IceFaces work in general?
As an example. When I fire a partial submit in a form like this one:

Code:
 <ice:form id="registrationForm">
                 <ui:fragment id="registrationFormFragment">
                     <ice:panelGrid columns="2">
                         <ice:outputLabel for="nickname" value="nickname"/>
                         <ice:inputText id="nickname"
                             value="#{registration.nickname}"
                             partialSubmit="true" 
                             action="nicknameCheck">
                         </ice:inputText>
                         
                         <ice:outputLabel for="birthday" value="Birthday (yyyy-mm-dd)"/>
                         <ice:inputText id="birthday" value="#{registration.birthday}"/>
 
                         <ice:outputLabel for="male" value="gender"/>
                         <ice:inputText id="male" value="#{registration.male}"/>
                         
                         <ice:outputLabel for="email" value="email"/>
                         <ice:inputText id="email" value="#{registration.email}"/>
 
                         <ice:outputLabel for="password" value="password"/>
                         <ice:inputSecret id="password" value="#{registration.password}"/>
                     </ice:panelGrid>
                 </ui:fragment>
                 <ice:commandButton type="submit" id="submit" value="Proceed" action="submit"/>
                 <ice:commandButton type="submit" id="cancel" value="Cancel"  action="cancel"/>
             </ice:form>
 


I get something like this:
Code:
 [window.zodC#3.async-connection] send > | 
 ice.submit.partial=true | 
 | ice.event.target=registrationForm:nickname | 
 | ice.event.captured=registrationForm:nickname | 
 | ice.event.type=onblur | 
 | registrationForm= |
 | icefacesCssUpdates= | 
 | org.springframework.webflow.FlowExecutionKey=e3s1 |
 | registrationForm:nickname=nick | 
 | registrationForm:birthday=Mar 13, 2009 |
 | registrationForm:male=male |
 | registrationForm:email=email@foo.com | 
 | registrationForm:password=foo | 
 | ice.session=zodCyRpsJ9nRwgFBescQIQ | 
 | ice.view=3 | 
 | ice.focus= |
 


When the normal (non partial) submit is performed, it looks like this:
Code:
 [window.zodC#3.async-connection] send > 
 | ice.submit.partial=false | 
 | ice.event.target=registrationForm:submit | 
 | ice.event.captured=registrationForm:submit | 
 | ice.event.type=onclick | 
 | ice.event.alt=false | 
 | ice.event.ctrl=false |
 | ice.event.shift=false | 
 | ice.event.meta=false | 
 | ice.event.x=70 | 
 | ice.event.y=414 | 
 | ice.event.left=true |
 | ice.event.right=false | |
  registrationForm:submit=Proceed | 
 | registrationForm= | 
 | icefacesCssUpdates= | 
 | org.springframework.webflow.FlowExecutionKey=e3s1 | 
 | registrationForm:nickname=nick | 
 | registrationForm:birthday=Mar 13, 2009 | 
 | registrationForm:male=male | 
 | registrationForm:email=email@foo.com | 
 | registrationForm:password=foo | 
 | ice.session=zodCyRpsJ9nRwgFBescQIQ | 
 | ice.view=3 | 
 | ice.focus=registrationForm:submit |
 


I can't see the something like an eventId in both cases, but I think the registrationForm:submit=Proceed in the second (full) submit will fire the event for web flow?

It woul be very nice if someone of the IceFaces team (or anybody else ;-) ) could say something about this.

Thanks in advice!
Jörg



Morningrise

Joined: 16/Feb/2009 00:00:00
Messages: 24
Offline


No one?
...this really can't be such an extraordinary thing.
As an example.
I have a registration form, where the user inputs a nickname. Now on the partial submit I want to trigger a db query to check whether the nickname is already taken.
So, is it possible to send an eventId along with the nickname value, so that I can handle this event in web flow?
jinal123

Joined: 09/Jan/2009 00:00:00
Messages: 4
Offline


I guess you can use:

<transition on="next">
<evaluate expression="searchCriteria.nextPage()" />
<render fragments="searchResultsFragment" />
</transition>

this is when you want to rerender a fragment and capture some activity by evaluating the expression. Hope this is what you wanted to do...
Morningrise

Joined: 16/Feb/2009 00:00:00
Messages: 24
Offline


My problem is the "next" in your example. This event has to be sent to react on it in web flow and I haven't figured out yet, how to send an event with a partial submit.
I can see that all events that are fired with a normal submit are detected by web flow, but no event has ever reached my flow, when using partial submits.
greg.dick

Joined: 26/Oct/2004 00:00:00
Messages: 85
Offline


The components do not send the action field on partial submit, as the protocol capture shows. I don't think you really want to send this particular event to the server in any case. Using the action attribute is, of course, a shortcut to define the navigation outcome without returning it from the actionListener, but you don't want to navigate based on partial submit. Partial submit is a way of submitting values from certain components in a form without validating the other component values from the same form.

An example of this would be submitting a single character from a city input text field to do city lookups in a database without executing JSF validation on the rest of the fields in the form. To use this to generate navigable outcomes would be a misuse of the feature since validation wouldn't occur on the rest of your fields.

[Email]
Morningrise

Joined: 16/Feb/2009 00:00:00
Messages: 24
Offline


greg.dick wrote:
Partial submit is a way of submitting values from certain components in a form without validating the other component values from the same form.
 

Which is what I want to do. But additionally I want to check if the value (nickname in my case) is already taken or not and instantly display this information to the user. Nothing more...

I don't want to deny, that I'm maybe doing it totally wrong, but what I wanted to do is capturing the event in webflow (if there would be one) and then force web flow to render the corresponding fragment, so that I can see the result.

Currently this works, when I'm using <sf:ajaxEvent>.
The event is sent along with the nickname value. The Validator checks the nickname and sets a message (or not) and then the fragment is re-rendered.

[edit]
...ok, it seems I'm just not enough into jsf.
Thanks everyone. Just ignore what I've written...
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team