Dojo with cakePHP

View: New views
5 Messages — Rating Filter:   Alert me  

Dojo with cakePHP

by Mauricio Tellez-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi all, I'm using dojo for a little time, and I find it great. But now, I'm playing a bit with cakePHP but I can't figure out how to embed dojo. Some one has do it? Thanks in advance.


--
Mauricio


Conoce el perfil completo de todos tus amigos de Windows Live Messenger justo aquĆ­: Windows Live Spaces
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Error from ItemFileWriteStore

by Bin Hu-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

When I delete an item from the ItemFileWriteStore and save it with  
myStore.save() and later try to add a new item with the same name as  
the deleted one, I will get an error in displaying the newly added item:

Error: [Exception... "'Error: dojo.data.ItemFileReadStore: Invalid  
item argument.' when calling method:  
[nsIDOMEventListener::handleEvent]"  nsresult: "0x8057001c  
(NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "<unknown>"  data: no]

Direct change in the value of an item's identifier is not supported by  
the ItemFileWriteStore.

Any suggestions of what I am doing wrong here? Thanks.

Bin
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Re: Error from ItemFileWriteStore

by jaredj :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Did you pass callbacks to save and wait until the callback is fired
(or an error is thrown) before attempting to do newItem?

What version of ItemFileWriteStore are you using?     (1.1.0, 1.1.1)?

-- Jared


On Thu, Jul 24, 2008 at 9:57 PM, Bin Hu <bhu@...> wrote:

> Hi,
>
> When I delete an item from the ItemFileWriteStore and save it with
> myStore.save() and later try to add a new item with the same name as
> the deleted one, I will get an error in displaying the newly added item:
>
> Error: [Exception... "'Error: dojo.data.ItemFileReadStore: Invalid
> item argument.' when calling method:
> [nsIDOMEventListener::handleEvent]"  nsresult: "0x8057001c
> (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "<unknown>"  data: no]
>
> Direct change in the value of an item's identifier is not supported by
> the ItemFileWriteStore.
>
> Any suggestions of what I am doing wrong here? Thanks.
>
> Bin
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest@...
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
>
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Re: Error from ItemFileWriteStore

by Bin Hu-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jared, thanks for the suggestion. I looked in to the Write.js and  
confirmed that error was caused by the asynchronous in running the  
script. After using the onComplete callback, I no longer has the error.

I am using Dojo 1.1.1.

Regards,
Bin





On Jul 25, 2008, at 5:51 AM, Jared Jurkiewicz wrote:

> Did you pass callbacks to save and wait until the callback is fired
> (or an error is thrown) before attempting to do newItem?
>
> What version of ItemFileWriteStore are you using?     (1.1.0, 1.1.1)?
>
> -- Jared

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

Re: Error from ItemFileWriteStore

by Bin Hu-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I got some weird behavior here. I paste some code here. Basically a  
user select some item from the datastore (in a tree view), change the  
value of the selected item and submit that change. The code below  
shall delete the selected item and add one using user provided string.  
With the code below, if the user select the newly changed item,  
sometime  he can view it without problem sometime he gets the error:

Error: [Exception... "'Error: dojo.data.ItemFileReadStore: Invalid  
item argument.' when calling method:  
[nsIDOMEventListener::handleEvent]"  nsresult: "0x8057001c  
(NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "<unknown>"  data: no]

Although alert(myStore.isItem(newItem)) always return true.

Could you please tell me what's the error in my code? Thanks.

Bin


     function editFool() {
        if (myStore.getValue(target,'type') == 'storeItem') {
            myStore.deleteItem(target);           // target is the currently  
select item
            myStore.save({onComplete:onEdit,
                             onError:saveFailed});
        }
     }


    function onEdit() {
        var myStr = dojo.byId('myStrEditInput').value;
        var msg = "Update this storeItem to " + myStr;
        if ( !confirm(msg) )
            return
        var mName = myStr.substring(0,myStr.indexOf('('));
        var mComp = myStr.substring(myStr.indexOf('(')+1, myStr.indexOf(')'));
       
        myStore.fetchItemByIdentity( {
            identity: "storeItem",
            onItem: function(item) {
                var newItem = myStore.newItem(
                    {name:mName,
                     type:'storeItem',
                     component:mComp},
                    {parent:item,
                     attribute:'children'}
                );
                alert(myStore.isItem(newItem));
            }
        });

        myStore.save(
            {onComplete:alert('saved'),
             onError:saveFailed});
     }



On Jul 25, 2008, at 1:11 PM, Bin Hu wrote:

> Jared, thanks for the suggestion. I looked in to the Write.js and
> confirmed that error was caused by the asynchronous in running the
> script. After using the onComplete callback, I no longer has the  
> error.
>
> I am using Dojo 1.1.1.
>
> Regards,
> Bin
>
>
>
>
>
> On Jul 25, 2008, at 5:51 AM, Jared Jurkiewicz wrote:
>
>> Did you pass callbacks to save and wait until the callback is fired
>> (or an error is thrown) before attempting to do newItem?
>>
>> What version of ItemFileWriteStore are you using?     (1.1.0, 1.1.1)?
>>
>> -- Jared
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest@...
> http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest

_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
Dojo-interest@...
http://turtle.dojotoolkit.org/mailman/listinfo/dojo-interest
LightInTheBox - Buy quality products at wholesale price