[fw-general] dojo editor not working in ie invalid pointer

2008-12-14 Thread Ace Paul

works ok in firefox but giving this error in firebug
RichText should not be used with the TEXTAREA tag. See
dijit._editor.RichText docs.

In ie7 none of the dojo elements work though, and i get the error: Invalid
Pointer.

does any one know how to fix this? thanks for any help

this is what i have in my bootstrap

Zend_Dojo::enableView($view);
 Zend_Dojo_View_Helper_Dojo::setUseDeclarative();
 $view-addHelperPath('Zend/Dojo/View/Helper/', 'Zend_Dojo_View_Helper');
$view-dojo()-disable(); 
$view-dojo()-setLocalPath('/externals/dojo/dojo/dojo.js')
-addStyleSheetModule('dijit.themes.tundra');


this is from the form. i have 4 editors for the one form

  $this-addElement('editor', 'race_description', array(
'plugins'= array('undo', '|', 'bold', 'italic'),
'height' = '150px',
'inheritWidth'   = true,
 'label'  = 'RaceDescription:',
'required'   = false,
));


and in the controller i have this.
$this-view-addHelperPath('Zend/Dojo/View/Helper/',
'Zend_Dojo_View_Helper');
-- 
View this message in context: 
http://www.nabble.com/dojo-editor-not-working-in-ie-invalid-pointer-tp20998650p20998650.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to set up dependant dropdowns in form

2008-12-14 Thread Ace Paul

thanks for your help on this.
I'm trying to get this going, but not having any luck at all, especially
seeing as I haven't used json with zend yet.

I'm getting this error in my controller file.

Method encodeJson does not exist and was not trapped in __call() 
   public function _prepareautocompletion($data) {
$items = array();
foreach ($data as $key = $value) {
$items[] = array('label' = $value, 'name' = $value, 'key' =
$key);
}
$final = array(
'identifier' = 'key',
'items' = $items,
);
return $this-encodeJson($final);
}

this is my autocompleteAction in CategoryController.php

  function autocompleteAction () 
{
$this-getHelper('viewRenderer')-setNoRender();
$request = $this-getRequest();
$category_id = (int)$this-_request-getParam('category_id');
$race = new Race();
$races = $race-getCategoryRaces($category_id); // function to 
output all
races
$this-view-races = $this-_prepareautocompletion($races);
}


Ok, now theres a couple things here i'm unsure of.
Firstly because this is setup with the first select box not populated
because it is expecting data from a data store, how am I to pass this info
into the json request. I'm sure I'm way off track with this one.
And Second, why am I getting the json error. Do I need to set something up
before hand for this to work.

thanks
Paul 


Themselves wrote:
 
 I have spent WAY too much time getting this exact scenario working using
 Zend Dojo forms and an MVC environment, and I plan on building an
 extensive
 article explaining it all soon, but for now, here's the really quick and
 dirty version. I haven't gotten my version perfect yet, I'm still not
 happy
 with the URLs I'm calling to retrieve the data, but that's not a huge
 deal.
 Anyway, on with the show.
 
 First of all, here's your two form elements.
 
 $this-addElement('FilteringSelect', 'fk_client_id', array(
 'label'= 'Client:',
 'storeId' = 'clientStore',
 'storeType'= 'dojo.data.ItemFileReadStore',
 'storeParams' = array( 'url' =
 '/clients/autocomplete/format/ajax?autocomplete=1str=*',),
 'autoComplete'   = 'false',
 'hasDownArrow'   = 'true',
 'id' = 'fk_client_id',
 ));
 
 $this-addElement('FilteringSelect', 'fk_client_contact_id',
 array(
 'label'= 'Client contact:',
 'storeId' = 'clientContactStore',
 'storeType'= 'dojo.data.ItemFileReadStore',
 'autoComplete'   = 'false',
 'hasDownArrow'   = 'true',
 'id' = 'fk_client_contact_id',
 ));
 
 Now for the javascript, this has to appear somewhere on the page that
 contains the form.
 
 dojo.connect(dijit.byId('fk_client_id'), 'onChange', function () {
 dijit.byId('fk_client_contact_id').store = new
 dojo.data.ItemFileReadStore({ url:
 /clientcontacts/autocomplete/format/ajax?autocomplete=1fk_client_id= +
 dijit.byId(fk_client_id).value });
 });
 
 
 As for the URLs for the Datastores, they are kind of an exercise for the
 reader, other than to say they obviously should filter correctly on the
 passed parameters, and they have to return JSON. This part was pretty
 annoying, but I eventually found that a function like this returns the
 correct JSON format:
 
 public function prepareAutoCompletion($data) {
 $items = array();
 foreach ($data as $key = $value) {
 $items[] = array('label' = $value, 'name' = $value, 'key' =
 $key);
 }
 $final = array(
 'identifier' = 'key',
 'items' = $items,
 );
 return $this-encodeJson($final);
 }
 
 
 You pass in to the function an array of id = value pairs, and it will
 output the correct JSON for the FilteringSelects. If you use the built in
 AutoCompleteDojo helper, it won't use the id from your table as the value
 that the form submits, which is pretty much useless.
 
 Oh, and one more trick, for the Edit action, you are going to need to
 include something like this:
 
 $form-populate($row);
 $form-getElement('fk_client_contact_id')-setStoreParams(array( 'url' =
 '/clientcontacts/autocomplete/format/ajax?autocomplete=1fk_client_id=' .
 $form-getElement('fk_client_id')-getValue() ));
 
 So that it prepopulates the form correctly.
 
 I promise I'll write up a really impressive document that spells this
 whole
 thing out in painstaking detail, I'm just absolutely flat out until
 christmas, I haven't had any time!
 
 
 On Tue, Dec 9, 2008 at 10:58 AM, Ace Paul sa...@acewebdesign.com.au
 wrote:
 

 I have a form, which I would like to use dependent drop downs in. I can't
 seem to find anything about it hear, after looking all morning trying to
 work it out.
 I have one field race_country
 when an option is selected I would like to show the 

[fw-general] Default value of a Zend_Dojo_Form_Element_DateTextBox in a Zend_Form

2008-12-14 Thread Barrett Conrad
Hello all.  I am attempting to use a  
Zend_Dojo_Form_Element_DateTextBox in a Zend_Form and I am unable to  
set the default value for the date picker.  The element works fine if  
the form/element validates, but the element does not retain its value  
when the validation fails or it has no value at all if I am populating  
it with existing data.  I am currently trying to use -setValue on the  
element within the Zend_Form, and that works up to the initial page  
load; once Dojo kicks in and turns the element into a date picker it  
appears to strip the value of the input.  A simple example of what I  
am trying is:


class My_Zend_Form extends Zend_Form {

public function init() {

$date = new Zend_Dojo_Form_Element_DateTextBox('date');

$date-setLabel('Date')
-setValue(date('m/d/Y'));

$this-addElements(array($date));
}

}

Just to be clear, all other elements of the form work just fine;  only  
the Dojo date picker has problems.


Thanks for the assistance,
Barrett M. Conrad


Re: [fw-general] dojo tooltip in a contentpane

2008-12-14 Thread aad pouw


Matthew Weier O'Phinney-3 wrote:
 
 -- aad pouw aad.p...@gmail.com wrote
 (on Sunday, 30 November 2008, 04:56 AM -0800):
 Before I go on with this issue, I first want to mention this.
 ZFW 1.7 needs a patch to get the Zend_Dojo_View_Helper_Tooltip working
 anyhow and 
 that's to be found at http://framework.zend.com/issues/browse/ZF-4635. 
 
 Since we were not able to get it into 1.7, at this point, it's scheduled
 for 1.8 (no new features in mini releases).
 
 Then my issue.
 I just don't get it work with a contentpane. It's not the helper itself
 because I can see in firebug/php that is is loading properly. 
 It's like that I just missing or do something wrong in the code? 
 
 ?php $this-dojo()-enable()?
 !--begin def-main--div id=def-main
 ?php $this-TabContainer()-captureStart('main-content', array('class'
 =
 'main-content'))?
 ?= $this-Tooltip('tooltip1',array('connectId' = 'tab1','label' =
 'Home'))?
 
 Contrary to what you say, you're putting it in the TabContainer body,
 not one of the content panes... try putting this call *after* the
 TabContainer has been fully setup, and see if that makes a difference.
 
 ?= $this-contentPane('tab1','', array('title' = 'tab1', 'href' =
 $this-url(array('controller' = 'content', 'action' = 'tab1'),
 'default',
 true), 'parseOnLoad' = true, 'selected' = true))?
 ?= $this-contentPane('tab2','', array('title' = 'tab2', 'href' =
 $this-url(array('controller' = 'content', 'action' = 'tab2'),
 'default',
 true)))?
 ?= $this-contentPane('tab3','', array('title' = 'tab3', 'href' =
 $this-url(array('controller' = 'content', 'action' = 'tab3'),
 'default',
 true)))?
 ?= $this-contentPane('tab4','', array('title' = 'tab4', 'href' =
 $this-url(array('controller' = 'content', 'action' = 'tab4'),
 'default',
 true)))?
 ?= $this-contentPane('tab5','', array('title' = 'tab5', 'href' =
 $this-url(array('controller' = 'content', 'action' = 'tab5'),
 'default',
 true)))?
 ?= $this-TabContainer()-captureEnd('main-content')?
 /div!--end def-main--
 
 -- 
 Matthew Weier O'Phinney
 Software Architect   | matt...@zend.com
 Zend Framework   | http://framework.zend.com/
 
 


 Dear Matthew,
 
 It's a bit late response just because of 'time'.
 
 About the patch, I've added that line into zfw 1.7 myself and that's
 working great. 
 The issue.
 Besides the mistakes, I was missing something too and I fixed that all.
 Still the problem remained.
 There is no way to get 'tooltip' on top of a contentPane 'button' and I've
 tried many ways.
 At the latest I got it working on the pane itself but not the button.
 
 Then I used my creativity and found a solution for this problem.
 I made a kind of strip with corresponding blocks on top over the
 contentpane 'buttons', just with some CSS.
 The relevant lines in my css file;
 div#tooltipbalk{margin: -8px auto 0px;width: 974px;height: 8px;   
 
 position: relative;top: 12px;z-index: 12;border: none;}
 .title{width: 188px;height: 8px;float: left;background:
 transparent;border: none;cursor: pointer;}
 
 This in my view file;
 !--begin tooltipbalk--div id=tooltipbalk
 !--begin title1--div id=title1 class=title/div!--end title1--
 !-- the other titles --
 !--begin tooltip1--div id=tooltip1 position=top/div!--end
 tooltip1--
 
 ?= $this-Tooltip('tooltip1',array('connectId' = 'title1','label' =
 'div class=labelh3Home/h3/div'))?
 !-- the other tooltips --
 /div!--end tooltipbalk--
 
 ?php $this-BorderContainer()-captureStart('main-border', array('class'
 = 'main-border'))?
 ?php $this-TabContainer()-captureStart('main-content', array('class' =
 'main-content'))?
 ?= $this-contentPane('tab1','', array('title' = 'home', 'class' =
 'tab', 'href' = $this-url(array('controller' = 'content', 'action' =
 'tab1'?
 !-- the other tabs --
 ?= $this-TabContainer()-captureEnd('main-content')?
 ?= $this-BorderContainer()-captureEnd('main-border')?
 
 Anyhow, this way it's working great :)
 Aad Pouw
 
-- 
View this message in context: 
http://www.nabble.com/dojo-tooltip-in-a-contentpane-tp20757413p21005546.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] SWFUpload with Zend

2008-12-14 Thread dop3

Hey friends.. this is my problem.. I want to do thinds in ZF style so I did
like this:

SWFUpload.onload = function () {
var settings = {
flash_url : baseUrl + /js/swfupload/swfupload.swf,
upload_url: baseUrl + /controller/upload,// the upload action
of my controller
...

and nothing.. it seems like I have to point to a real file. In fact, if I do
like this:

SWFUpload.onload = function () {
var settings = {
flash_url : baseUrl + /js/swfupload/swfupload.swf,
upload_url: baseUrl + /upload.php,// Upload file
...
it works great!

What I'm missing?
Well... if you did it, please let me know how.
thanks



-- 
View this message in context: 
http://www.nabble.com/SWFUpload-with-Zend-tp19802731p21005609.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Soap_AutoDiscover and document literal

2008-12-14 Thread krytie

Hello,

I'm wanting to use the cool AutoDiscover library to produce document/literal
compliant WSDLs, but looking at the setClass() method of
Zend_Soap_AutoDiscover, it looks like it is hard coded to use RPC/encoded.

What's the best way of allowing document/literal?

1) Hacking Zend_Soap_AutoDiscover to accept document/literal
or
2) Sub Class Zend_Soap_AutoDiscover and override the setClass method

Cheers
-- 
View this message in context: 
http://www.nabble.com/Zend_Soap_AutoDiscover-and-document-literal-tp21006481p21006481.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] How to set up dependant dropdowns in form

2008-12-14 Thread Cameron
try calling it statically, Zend_Json::encode($data);

On Sun, Dec 14, 2008 at 11:39 PM, Ace Paul sa...@acewebdesign.com.auwrote:


 thanks for your help on this.
 I'm trying to get this going, but not having any luck at all, especially
 seeing as I haven't used json with zend yet.

 I'm getting this error in my controller file.

 Method encodeJson does not exist and was not trapped in __call()
   public function _prepareautocompletion($data) {
$items = array();
foreach ($data as $key = $value) {
$items[] = array('label' = $value, 'name' = $value, 'key' =
 $key);
}
$final = array(
'identifier' = 'key',
'items' = $items,
);
return $this-encodeJson($final);
}

 this is my autocompleteAction in CategoryController.php

  function autocompleteAction ()
{
$this-getHelper('viewRenderer')-setNoRender();
$request = $this-getRequest();
$category_id =
 (int)$this-_request-getParam('category_id');
$race = new Race();
$races = $race-getCategoryRaces($category_id); // function
 to output all
 races
 $this-view-races = $this-_prepareautocompletion($races);
}


 Ok, now theres a couple things here i'm unsure of.
 Firstly because this is setup with the first select box not populated
 because it is expecting data from a data store, how am I to pass this info
 into the json request. I'm sure I'm way off track with this one.
 And Second, why am I getting the json error. Do I need to set something up
 before hand for this to work.

 thanks
 Paul


 Themselves wrote:
 
  I have spent WAY too much time getting this exact scenario working using
  Zend Dojo forms and an MVC environment, and I plan on building an
  extensive
  article explaining it all soon, but for now, here's the really quick and
  dirty version. I haven't gotten my version perfect yet, I'm still not
  happy
  with the URLs I'm calling to retrieve the data, but that's not a huge
  deal.
  Anyway, on with the show.
 
  First of all, here's your two form elements.
 
  $this-addElement('FilteringSelect', 'fk_client_id', array(
  'label'= 'Client:',
  'storeId' = 'clientStore',
  'storeType'= 'dojo.data.ItemFileReadStore',
  'storeParams' = array( 'url' =
  '/clients/autocomplete/format/ajax?autocomplete=1str=*',),
  'autoComplete'   = 'false',
  'hasDownArrow'   = 'true',
  'id' = 'fk_client_id',
  ));
 
  $this-addElement('FilteringSelect', 'fk_client_contact_id',
  array(
  'label'= 'Client contact:',
  'storeId' = 'clientContactStore',
  'storeType'= 'dojo.data.ItemFileReadStore',
  'autoComplete'   = 'false',
  'hasDownArrow'   = 'true',
  'id' = 'fk_client_contact_id',
  ));
 
  Now for the javascript, this has to appear somewhere on the page that
  contains the form.
 
  dojo.connect(dijit.byId('fk_client_id'), 'onChange', function () {
  dijit.byId('fk_client_contact_id').store = new
  dojo.data.ItemFileReadStore({ url:
  /clientcontacts/autocomplete/format/ajax?autocomplete=1fk_client_id= +
  dijit.byId(fk_client_id).value });
  });
 
 
  As for the URLs for the Datastores, they are kind of an exercise for the
  reader, other than to say they obviously should filter correctly on the
  passed parameters, and they have to return JSON. This part was pretty
  annoying, but I eventually found that a function like this returns the
  correct JSON format:
 
  public function prepareAutoCompletion($data) {
  $items = array();
  foreach ($data as $key = $value) {
  $items[] = array('label' = $value, 'name' = $value, 'key'
 =
  $key);
  }
  $final = array(
  'identifier' = 'key',
  'items' = $items,
  );
  return $this-encodeJson($final);
  }
 
 
  You pass in to the function an array of id = value pairs, and it will
  output the correct JSON for the FilteringSelects. If you use the built in
  AutoCompleteDojo helper, it won't use the id from your table as the value
  that the form submits, which is pretty much useless.
 
  Oh, and one more trick, for the Edit action, you are going to need to
  include something like this:
 
  $form-populate($row);
  $form-getElement('fk_client_contact_id')-setStoreParams(array( 'url' =
  '/clientcontacts/autocomplete/format/ajax?autocomplete=1fk_client_id='
 .
  $form-getElement('fk_client_id')-getValue() ));
 
  So that it prepopulates the form correctly.
 
  I promise I'll write up a really impressive document that spells this
  whole
  thing out in painstaking detail, I'm just absolutely flat out until
  christmas, I haven't had any time!
 
 
  On Tue, Dec 9, 2008 at 10:58 AM, Ace Paul sa...@acewebdesign.com.au
  wrote:
 
 
  I have a form, which I 

Re: [fw-general] Default value of a Zend_Dojo_Form_Element_DateTextBox in a Zend_Form

2008-12-14 Thread Cameron
You need to pass the element an ISO date. Try something like this:

$date = new Zend_Date();
$date-set($row['date'], Zend_Date::ISO_8601);
$retarr['auction_date'] = $date-getIso();


Interestingly enough, the Time picker accepts the full ISO date too, if
you're using them. Unfortunately you need to do this for every date/time
dojo field and datetime you pull out of a mysql DB, because mysql misses the
T in the middle - although it happily accepts an ISO date as an input, it
stores it without. Quite annoying, really.


On Mon, Dec 15, 2008 at 4:53 AM, Barrett Conrad barrettcon...@gmail.comwrote:

 Hello all.  I am attempting to use a Zend_Dojo_Form_Element_DateTextBox in
 a Zend_Form and I am unable to set the default value for the date picker.
  The element works fine if the form/element validates, but the element does
 not retain its value when the validation fails or it has no value at all if
 I am populating it with existing data.  I am currently trying to use
 -setValue on the element within the Zend_Form, and that works up to the
 initial page load; once Dojo kicks in and turns the element into a date
 picker it appears to strip the value of the input.  A simple example of what
 I am trying is:

 class My_Zend_Form extends Zend_Form {

public function init() {

$date = new Zend_Dojo_Form_Element_DateTextBox('date');

$date-setLabel('Date')
-setValue(date('m/d/Y'));

$this-addElements(array($date));
}

 }

 Just to be clear, all other elements of the form work just fine;  only the
 Dojo date picker has problems.

 Thanks for the assistance,
 Barrett M. Conrad



[fw-general] Zend_Date and Timezones - how do I turn them off?

2008-12-14 Thread Cameron
Hi guys,

I'm just doing a bit of work with the Dojo date and time pickers, and it's
all going wonderfully, and I decided to use the Zend_Date::ISO_8601 method
for formatting the output from MySQL, which works perfectly well, all except
for the fact it's appending a timezone, which then goes and screws with the
time that gets displayed in the time picker - i wouldn't have noticed this
if it wasn't for DST!

Anyway, all I want is to basically turn off the whole timezone thing - I
don't need it for this project, and it's much more obvious for the time
stored in the DB to be the time of the event, not a GMT representation of
it. I tried $date-setTimezone(NULL); and $date-setTimezone(''); but I got
nothing. Of course I can chop the last 6 chars off the string and everything
will be fine, but i'd rather not have to resort to such clunkiness if at all
possible.


Re: [fw-general] SWFUpload with Zend

2008-12-14 Thread Cristian Bichis

Hello,

1. Put into js folder a .htaccess file with RewriteEngine Off directive 
 (there are other ways also)


2. upload.php transform it into a controller action as you did into your 
initial sample


--
Best regards,
Cristian Bichis
www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com



Hey friends.. this is my problem.. I want to do thinds in ZF style so I did
like this:

SWFUpload.onload = function () {
var settings = {
flash_url : baseUrl + /js/swfupload/swfupload.swf,
upload_url: baseUrl + /controller/upload,// the upload action
of my controller
...

and nothing.. it seems like I have to point to a real file. In fact, if I do
like this:

SWFUpload.onload = function () {
var settings = {
flash_url : baseUrl + /js/swfupload/swfupload.swf,
upload_url: baseUrl + /upload.php,// Upload file
...
it works great!

What I'm missing?
Well... if you did it, please let me know how.
thanks



  




Re: [fw-general] SWFUpload with Zend

2008-12-14 Thread ask josephsen

Hi

I've made made SWFUpload work as well. Make sure you start with a classic
HTML-upload form that post the file to your ZF controller/action - in this
way you can easily debug your upload action. And when that works - start
putting up the SWFUplaod.


./ask



teleki wrote:
 
 Hi,
 Has anybody tried to use SWU upload (http://code.google.com/p/swfupload/)
 with Zend?? I have no problem using either Zend Framework or SWU
 separately, however when trying to integrate the two, I have problem
 specifying the upload_url, which would point to the Action that would
 process the upload. 
 I used both absolute and different relative path to point to the right
 action, but it wouldn't find it:
 e.g.:
 upload_url = /path/to/control/action or 
 upload_url = www.blabla.com/control/action
 etc...
 What ever way I specify my action never gets invoked.
 
 In none zend framework you would say:
 upload_url = upload.php 
 and it would work correctly...
 
 Thank you,
 Monika
 
 
 
 using on a project which is set up with Zend Framework structure, when I
 specify the 
 upload_url  when initializing the setting for SWU, it does not find my php
 file. 
 I tryed to give both absolute and relative urls, like:
 
 /path/to/control/action or www.blabla.com/control/action... but my action
 is not invoked...
 
 
 

-- 
View this message in context: 
http://www.nabble.com/SWFUpload-with-Zend-tp19802731p2100.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Date and Timezones - how do I turn them off?

2008-12-14 Thread Thomas Weidner
To prevent timezone calculation you should use UTC as timezone. This 
timezone has no DST.
But be aware of possible time differences when your input is not UTC but 
GMT.


Also to note: UTC is also a timezone and will be displayed in the output. It 
just uses no DST, that's all.
ISO_8601 is the complete ISO representation. It's recognised by all common 
DBs and is always with timezone.
To prevent output you could use the toString method and create your own 
format.


Greetings
Thomas Weidner, I18N Team Leader, Zend Framework
http://www.thomasweidner.com

- Original Message - 
From: Cameron themsel...@gmail.com

To: Zend Framework - General fw-general@lists.zend.com
Sent: Monday, December 15, 2008 5:59 AM
Subject: [fw-general] Zend_Date and Timezones - how do I turn them off?



Hi guys,

I'm just doing a bit of work with the Dojo date and time pickers, and it's
all going wonderfully, and I decided to use the Zend_Date::ISO_8601 method
for formatting the output from MySQL, which works perfectly well, all 
except
for the fact it's appending a timezone, which then goes and screws with 
the

time that gets displayed in the time picker - i wouldn't have noticed this
if it wasn't for DST!

Anyway, all I want is to basically turn off the whole timezone thing - I
don't need it for this project, and it's much more obvious for the time
stored in the DB to be the time of the event, not a GMT representation of
it. I tried $date-setTimezone(NULL); and $date-setTimezone(''); but I 
got
nothing. Of course I can chop the last 6 chars off the string and 
everything
will be fine, but i'd rather not have to resort to such clunkiness if at 
all

possible.