×

Error

Please login first

Using Core Fields Ajax plugin in another component

11 years 10 months ago #203471 by sobotkaholdingsllc
Using Core Fields Ajax plugin in another component was created by sobotkaholdingsllc
Hi, is there an easy way to add the core fields ajax plugin elsewhere, such as on a page in another component that is pulling CB user data? I'd like to use it in a similar way that the user list functionality and core ajax plugin of CB work together.

Any advice is appreciated. Thanks

Please Log in to join the conversation.

11 years 10 months ago #203529 by krileon
If the other extension has CB API loaded and you used API to perform getField it may work. See the below for usage of getField API.

www.allmysocials.com/directory/tutorials/item/235-obtaining-field-values-through-api


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

11 years 10 months ago #203552 by sobotkaholdingsllc
Replied by sobotkaholdingsllc on topic Re: Using Core Fields Ajax plugin in another component
Thanks for the help. Unfortunately the ajax doesn't load correctly. Is there something else that I need to load? This is what I'm loading within my component so far:
global $_CB_framework, $mainframe;

if ( defined( 'JPATH_ADMINISTRATOR' ) ) {
if ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ) ) {
echo 'CB not installed!';
return;
}

include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
} else {
if ( ! file_exists( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' ) ) {
echo 'CB not installed!';
return;
}

include_once( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' );
}
cbimport( 'cb.database' );
cbimport( 'cb.plugins' );
cbimport( 'cb.html' );

Please Log in to join the conversation.

11 years 10 months ago #203558 by krileon
What do you mean it doesn't load correctly? Please be more specific.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

11 years 10 months ago - 11 years 10 months ago #203560 by sobotkaholdingsllc
Replied by sobotkaholdingsllc on topic Re: Using Core Fields Ajax plugin in another component
Sorry for not being clear. The ajax save functionality will not work. This is what is displayed in the console:
[jquery.form] state = complete jquery.form.min.js:10
[jquery.form] isXml=false

Here is my code to call the cb field:
echo $cbUser->getField( 'cb_active', null, 'html', 'span', 'list' );

The field also disappears after the "update" button is clicked
Attachments:

Please Log in to join the conversation.

11 years 10 months ago #203612 by krileon
You need to ensure it has a container DIV. Please see the below example.
'<div>' . $cbUser->getField( 'cb_active' ) . '</div>'

Ensure the field has profile AJAX enabled for the field. If you still want to use userlist AJAX then change the reason to list and also ensure userlist view AJAX is enabled for the field.

The field also disappears after the "update" button is clicked

Update button? Please note you can't render AJAX fields on profile edit or inside of a FORM. The ajax usage is a FORM it self and you can not have a FORM within a FORM.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.242 seconds

Facebook Twitter LinkedIn