cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From imran <ipariy...@triplemind.com>
Subject Re: How to use ajax in selection-list
Date Mon, 06 Oct 2008 15:23:58 GMT
asif_zzz wrote:
> Hi Imran,
>
> First of all thanks for your reply..
> I've populated all the values to the selection list.
> Based on selected value ,i need to process the information in the DB
> and the i need to load the new values using ajax..
>
> I've tried on on change event handler..The selected value get stored in
> front end itself
> i cant receive the value to the backend..
>
> My binding will look like this.
>
> <fb:javascript id="customer" path="customerList" direction="load">
> 	  <fb:load-form>
> 	    var collection = jxpathPointer.getNode();
> 	    widget.setSelectionList(collection, "key", "val");
> 	  </fb:load-form>
> </fb:javascript>
> <fb:value id="customerSelectedId" path="customerId">
> 	<fb:on-update>
> 	<fb:set-attribute name="changed" value="true"/>
> 	</fb:on-update>
> </fb:value>
>
>
> My definition part look like this
>
> <fd:field id="customer">
>          <fd:label><i18n:text>customer</i18n:text></fd:label>
> 	<fd:datatype base="string"/>
> 	<fd:selection-list/>
> 	<fd:on-value-changed>
> 		<fd:javascript>
> 	
> event.source.lookupWidget("../customerSelectedId").setValue(event.newValue);
>             </fd:javascript>
> 	</fd:on-value-changed>
> </fd:field>
> 		
> <fd:field id="customerSelectedId" state="invisible">
> 	<fd:datatype base="string"/>
> </fd:field>
>
>
>
> Regards
> Aashik
>   
 i dont see u calling the backend anywhere ... there is a very good
example about changing a selectionlist using ajax within cocoon samples
.. there they are doing everyting using javascript .. u can see the
online demo at
http://cocoon.zones.apache.org/demos/21branch/samples/blocks/forms/carselector 


for looking at the source checkout the 2.1 branche from the SVN .. you
will find all you need in there ..

Hope that helps

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


Mime
View raw message