Welcome, Guest
Username: Password: Remember me

TOPIC: [SOLVED] Differences between ajax and non ajax in combobox

Differences between ajax and non ajax in combobox 25 Jul 2013 20:18 #10579

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
Having receive no answer about the fact that ajax loading is not working in IE7, i'm trying to do this :
I detect user-agent, and if its iE8 or bellow, i want to use a combobox (brand->model) with model as the data and brand as the groupby without ajax, and if user-agent is above IE9, then i want to 'turn on' ajax loading. I tried this in many ways and didn't get it to work.
Any help would be appreciated.
Last Edit: 27 Jul 2013 09:39 by VeCrea.
The administrator has disabled public write access.

Differences between ajax and non ajax in combobox 27 Jul 2013 09:31 #10602

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
I know I must sort this out. For the moment I am still searching.
Coding is now a piece of cake
The administrator has disabled public write access.

Differences between ajax and non ajax in combobox 27 Jul 2013 09:38 #10603

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
Could you at least tell me what are the differences in calling ajax or nonajax ? or what would the jdom call if i want to do some conditionnal display of either the ajax or either the non ajax combo ? because if i only change the xml file, the combo doesn't display anything anymore, but it seems the fields called in the model are the same, and called in the same way.
The administrator has disabled public write access.

Differences between ajax and non ajax in combobox 27 Jul 2013 10:12 #10604

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Yes, because the content of the combo list are prepared in the view file, and sent to the JForm field in the template.
Generate without Ajax, and :
1- keep the code wich is preparing the list (displayXxxx())
2- Keep the few line in the template (Dynamic initialization)
3- Keep the parameters in the XML file (dataKey, dataObject, ...)

Ajax call needs the ajaxContext property to show,
and the Vars sent to it (Dynamic init)


But in your case, it becomes tricky because impossible to switch XML paramters depending on condition. You may have to create 2 different fields with the same name. It is not very clean and could raise some issues.

How I would do :
Keep an ajax field for your XML,
and write the conditional normal combo with a hardcoded JDom call in the template (not using XML field)
This field should recieve : dataKey, dataObject, list, listKey, labelKey, (eventualy groupBy array)

Hope it helps.
Coding is now a piece of cake
The administrator has disabled public write access.

Differences between ajax and non ajax in combobox 27 Jul 2013 11:19 #10605

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
Will try this out tonight.
Wouldn't it be possible to write to JDom calls, one for ajax and one without ajax, and not use the xml at all ?
The JDom calss would be placed in the view.html.php file or in the template view file (_form.php) ?
Could you please give me the two JDom calls so i'm sure i won't mess it up ? It's not used with the new version of Cook and i don't want to do try/errors for too much time, i need this to be done quick.
Thank you
Last Edit: 27 Jul 2013 11:19 by VeCrea.
The administrator has disabled public write access.

Differences between ajax and non ajax in combobox 27 Jul 2013 12:07 #10606

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
The project ?
And Table/Layout ?

So I can download it and help you.
Coding is now a piece of cake
The administrator has disabled public write access.

Differences between ajax and non ajax in combobox 27 Jul 2013 14:23 #10609

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
  • Karma: 30
Recyv3 > vhus > nouveau vhu

Thank you
The administrator has disabled public write access.

Differences between ajax and non ajax in combobox 27 Jul 2013 23:09 #10612

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
sent you by email.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.108 seconds

Get Started