cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Refondini <patrick.refond...@pobox.com>
Subject Re: Calling a business service from a form
Date Sun, 12 Mar 2006 22:01:30 GMT
Hi Duncan,

If onChange can be used instead of onBlur in your senario you might be 
able to use something as follow in you CForm model (fd):

<fd:field id="name">
   <fd:datatype base="string"/>
     <fd:on-value-changed>
       <fd:javascript>
       uniqueAttributeNameConstraint(event);
       </fd:javascript>
     </fd:on-value-changed>			
</fd:field>

I have used this with Cocoon 2.1.8 with AJAX block enabled, and of 
course AJAX enabled in the form template too:

<ft:form-template
   action="#{$cocoon/continuation/id}.continue"
   method="POST"
   ajax="true">


Patrick


Duncan McLean wrote:
> Hi
> 
> We have a rather complicated scenario where we would like to effectively 
> call a business service which does some detailed calculations involving 
> a value from a text field on a form and then updating the same form with 
> the value.
> 
> Effectively, the users would like the service calculation to trigger 
> after an onBlur event on the affected text field.
> 
> We already call a business service in flow (using and XSP page which 
> composes the required SOAP request). We then call this pipeline within 
> flow which causes the business service to be called and we can then get 
> at the returned DOM to extract the values. This can be done up front in 
> flow which makes this scenario easy, but the onBlur scenario is proving 
> trickier.
> 
> What would be nice would be to (in the fd:javascript block for the text 
> box) using a similar method to the above - call a pipeline that creates 
> another XSP page that will create the appropriate SOAP request and call 
> the business service, interrogate the results and incorporate the 
> results into the same form! Tricky?
> 
> Sorry that this sounds a bit convoluted, but does anyone have a better 
> suggestion on how to achieve this?
> 
> So, in summary - onBlur called against a text field, results in creation 
> of SOAP request to a business service which does some business logic 
> calcs, returns some XML which is interrogated for a value and area on 
> the same form re-populated with result of calculation.
> 
> Phew
> 
> Thanks in advance
> 
> Duncan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message