[fw-general] Dijit container example ?

2008-11-26 Thread Superbiji »
Hi All..
i've been trying zf 1.7 and add accordionContainer but without
success. please can anyone give me full examples? can't find it in
manual yet.

in my action:
function dojoformAction() {
Zend_Dojo::enableView($this-view);

}

view:

?= $this-dojo()-enable();  ?

/head
body class=tundra


?= $this-accordionContainer(
'foo',
$content . XX,
array(
'duration' = 200,
),
array(
'style' = 'width: 200px; height: 300px;',
) );
?



-- 
Kamus Online - http://kamus.landak.com/


Re: [fw-general] Cannot consume SOAP Service

2008-11-26 Thread Jan Pieper
We got it working (for java) :-) We created a wsdl definition with java and 
compared it with wsdl definition created by Zend_Soap_AutoDiscover and modified 
all differences in Zend_Soap components until we got it working. Java seems to 
have a problem with following element:

part name=getStaticStringReturn type=xsd:string /

We changed it to following because it was the main difference between the 
definitions:

part name=return type=xsd:string /

And now... it works fine :-) I also tested the modified name-value with 
Zend_Soap_Client and it works fine too. Now we have to wait for a test with 
Microsoft Dynamics AX.

-- Jan

 Original-Nachricht 
 Datum: Tue, 25 Nov 2008 23:48:31 +0100
 Von: Benjamin Eberlei [EMAIL PROTECTED]
 An: fw-general@lists.zend.com
 Betreff: Re: [fw-general] Cannot consume SOAP Service

 this is very valueable input. thank you very much.
 
 I have to look into that. Unfortunatly the AutoDiscover and WSDL internals
 are 
 in very bad shape to extend without easily breaking backwards compability,
 so 
 i cannot assure you that I can include it in the next mini or minor
 release.
 
 Do i understand you correctly, that it worked for you with Java, when you 
 switched from encoded to literal?
 
 greeetings
 Benjamin
 
 On Tuesday 25 November 2008 21:23:30 Jan Pieper wrote:
  Hi guys,
 
  I created a small soap service with Zend_Soap_Server and
  Zend_Soap_AutoDiscover but I cannot consume its data via a java soap
  client. I tried it all the day but it won´t work.
 
  - SNIP -
 
  class MyFooService
  {
  /**
   * @return string
   */
  public function getStaticString() {
  return 'Hello World';
  }
  }
 
  - SNAP -
 
  It is accessable (for me!) via http://jason/Laboratory/JMS/service.php
  which is the service and http://jason/Laboratory/JMS/service.php?wsdl
 which
  will show wsdl definition. The created wsdl definition looks like this:
 
  - SNIP -
 
  ?xml version=1.0?
  definitions xmlns=http://schemas.xmlsoap.org/wsdl/;
  xmlns:tns=http://jason/Laboratory/JMS/service.php;
  xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/;
  xmlns:xsd=http://www.w3.org/2001/XMLSchema;
  xmlns:soap-enc=http://schemas.xmlsoap.org/soap/encoding/;
  xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
  name=MyFooService
  targetNamespace=http://jason/Laboratory/JMS/service.php; portType
  name=MyFooServicePort
  operation name=getStaticString
  input message=tns:getStaticStringRequest /
  output message=tns:getStaticStringResponse /
  /operation
  /portType
  binding name=MyFooServiceBinding type=tns:MyFooServicePort
  soap:binding style=rpc
  transport=http://schemas.xmlsoap.org/soap/http; /
  operation name=getStaticString
  soap:operation
 
  soapAction=http://jason/Laboratory/JMS/service.php#getStaticString; /
  input
  soap:body use=literal
  namespace=http://jason/Laboratory/JMS/service.php;
 /
  /input
  output
  soap:body use=literal
  namespace=http://jason/Laboratory/JMS/service.php;
 /
  /output
  /operation
  /binding
  service name=MyFooServiceService
  port name=MyFooServicePort binding=tns:MyFooServiceBinding
  soap:address
  location=http://jason/Laboratory/JMS/service.php; / /port
  /service
  message name=getStaticStringRequest /
  message name=getStaticStringResponse
  part name=getStaticStringReturn type=xsd:string /
  /message
  /definitions
 
  - SNAP -
 
  As you can see I do not use Zend_Soap_AutoDiscover in its original
 version
  (see attached MyAutoDiscover.diff, could not extend and use my own class
  because I need access to private class properties). I needed to change
  soap:body use=encoded encodingStyle=... / to soap:body
 use=literal
  namespace=... / because wsimport (small tool included in jdk) cannot
  handle encoded. So I used following command to create java classes
 from
  wsdl definiton:
 
  # wsimport -keep http://jason/Laboratory/JMS/service.php?wsdl
 
  So I got this two java classes:
 
  # jason.laboratory.jms.service.MyFooServicePort.java
  # jason.laboratory.jms.service.MyFooServiceService.java
 
  After that I created a soap client using these classes (jdk1.6.0_10):
 
  - SNIP -
 
  package jason.laboratory.jms.myfooclient;
 
  import jason.laboratory.jms.service.*;
 
  public class MyFooClient
  {
  /**
   * @param args
   */
  public static void main(String[] args)
  {
  MyFooServiceService mfss = new MyFooServiceService();
  MyFooServicePortmfsp = mfss.getMyFooServicePort();
  String result= mfsp.getStaticString();
 
  if (result != null) {
  System.out.println(Result:  + result);
  } else {
  

[fw-general] Need help regarding url rewrite for zend framework

2008-11-26 Thread amar4kintu

Hello all,

I need some more help. Following is my httpd.conf file.
===

## httpd.conf -- Apache HTTP server configuration file
##

#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See URL:http://httpd.apache.org/docs/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# After this file is processed, the server will look for and process
# /u/ap5/conf/srm.conf and then /u/ap5/conf/access.conf
# unless you have overridden these with ResourceConfig and/or
# AccessConfig directives here.
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as
a
# whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default'
server,
# which responds to requests that aren't handled by a virtual host.
# These directives also provide default values for the settings
# of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
# different IP addresses or hostnames and have them handled by the
# same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with / (or drive:/ for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with /, the value of ServerRoot is prepended -- so logs/foo.log
# with ServerRoot set to /usr/local/apache will be interpreted by the
# server as /usr/local/apache/logs/foo.log.
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerType is either inetd, or standalone.  Inetd mode is only supported
on
# Unix platforms.
#
ServerType standalone

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation
# (available at URL:http://www.apache.org/docs/mod/core.html#lockfile);
# you will save yourself a lot of trouble.
#
ServerRoot /u/ap5

#
# The LockFile directive sets the path to the lockfile used when Apache
# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
# its default value. The main reason for changing it is if the logs
# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
# DISK. The PID of the main server process is automatically appended to
# the filename. 
#
#LockFile /u/ap5/logs/httpd.lock

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile /u/ap5/logs/httpd.pid

#
# ScoreBoardFile: File used to store internal server process information.
# Not all architectures require this.  But if yours does (you'll know
because
# this file will be  created when you run Apache) then you *must* ensure
that
# no two invocations of Apache share the same scoreboard file.
#
ScoreBoardFile /u/ap5/logs/httpd.scoreboard

#
# In the standard configuration, the server will process httpd.conf (this 
# file, specified by the -f command line option), srm.conf, and access.conf 
# in that order.  The latter two files are now distributed empty, as it is 
# recommended that all directives be kept in a single file for simplicity.  
# The commented-out values below are the built-in defaults.  You can have
the 
# server ignore these files altogether by using /dev/null (for Unix) or
# nul (for Win32) for the arguments to the directives.
#
#ResourceConfig /u/ap5/conf/srm.conf
#AccessConfig /u/ap5/conf/access.conf

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to Off to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

#
# Server-pool size regulation.  Rather than making you guess how many
# server processes you need, Apache dynamically adapts to the load it
# sees --- that is, it tries 

Re: [fw-general] Validating JQuery forms via AJAX

2008-11-26 Thread Benjamin Eberlei

Hello Manuel,

there is currently no way to validate your form via ajax unless you
implement that yourself.

I might implement that someday, but the form plugin is not part of jQuery
or jQuery UI, so I havent integrated that yet.

best regards,
Benjamin

On Wed, 26 Nov 2008 02:58:18 -0800 (PST), manuelpedrera
[EMAIL PROTECTED] wrote:
 
 Hi, I've created a ZendX_JQuery_Form which has some fields with
 validators.
 The submit's click event is linked to a javascript function, where I want
 to
 check if the input entered is valid or not.
 
 When I did this using dojo forms, it was easy through form.isValid(), but
 I
 can't figure the way it's done using JQuery.
 
 Is there a way to use the validators before sending the data to the
 server?
 --
 View this message in context:

http://www.nabble.com/Validating-JQuery-forms-via-AJAX-tp20698748p20698748.html
 Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Validating JQuery forms via AJAX

2008-11-26 Thread manuelpedrera

Hi, I've created a ZendX_JQuery_Form which has some fields with validators.
The submit's click event is linked to a javascript function, where I want to
check if the input entered is valid or not.

When I did this using dojo forms, it was easy through form.isValid(), but I
can't figure the way it's done using JQuery. 

Is there a way to use the validators before sending the data to the server?
-- 
View this message in context: 
http://www.nabble.com/Validating-JQuery-forms-via-AJAX-tp20698748p20698748.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] When the new API PDF will be available

2008-11-26 Thread Martin Klobusnik
Hello,

 

I was just wondering when the new PDF for 1.7.0  API version will become
available for download.

 

Thanks

Martin

 



RE: [fw-general] Validating JQuery forms via AJAX

2008-11-26 Thread Xavier Vidal
I have an inherited form class from Zend_Form that can validate Ajax forms
and render the error messages using JQuery, if someone is interested, i can
share my code and we can promote it to ZF.


-Mensaje original-
De: Benjamin Eberlei [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 26 de noviembre de 2008 14:50
Para: fw-general@lists.zend.com
Asunto: Re: [fw-general] Validating JQuery forms via AJAX


Hello Manuel,

there is currently no way to validate your form via ajax unless you
implement that yourself.

I might implement that someday, but the form plugin is not part of jQuery
or jQuery UI, so I havent integrated that yet.

best regards,
Benjamin

On Wed, 26 Nov 2008 02:58:18 -0800 (PST), manuelpedrera
[EMAIL PROTECTED] wrote:
 
 Hi, I've created a ZendX_JQuery_Form which has some fields with
 validators.
 The submit's click event is linked to a javascript function, where I want
 to
 check if the input entered is valid or not.
 
 When I did this using dojo forms, it was easy through form.isValid(), but
 I
 can't figure the way it's done using JQuery.
 
 Is there a way to use the validators before sending the data to the
 server?
 --
 View this message in context:

http://www.nabble.com/Validating-JQuery-forms-via-AJAX-tp20698748p20698748.h
tml
 Sent from the Zend Framework mailing list archive at Nabble.com.




Re: [fw-general] Validating JQuery forms via AJAX

2008-11-26 Thread Benjamin Eberlei

Hello,

you could open up an Enhancement/Feature issue in Jira for me
(http://framework.zend.com/issues) and attach the changes. I can review and
test them, and we could then think about how to integrate them into ZF. I
am very interested to contribute an ajax validation, it should be very
robust though, so I cannot guarantee that i can include it.

On Wed, 26 Nov 2008 15:36:42 +0100, Xavier Vidal [EMAIL PROTECTED]
wrote:
 I have an inherited form class from Zend_Form that can validate Ajax
forms
 and render the error messages using JQuery, if someone is interested, i
 can
 share my code and we can promote it to ZF.
 
 
 -Mensaje original-
 De: Benjamin Eberlei [mailto:[EMAIL PROTECTED] 
 Enviado el: miércoles, 26 de noviembre de 2008 14:50
 Para: fw-general@lists.zend.com
 Asunto: Re: [fw-general] Validating JQuery forms via AJAX
 
 
 Hello Manuel,
 
 there is currently no way to validate your form via ajax unless you
 implement that yourself.
 
 I might implement that someday, but the form plugin is not part of jQuery
 or jQuery UI, so I havent integrated that yet.
 
 best regards,
 Benjamin
 
 On Wed, 26 Nov 2008 02:58:18 -0800 (PST), manuelpedrera
 [EMAIL PROTECTED] wrote:
 
 Hi, I've created a ZendX_JQuery_Form which has some fields with
 validators.
 The submit's click event is linked to a javascript function, where I
 want
 to
 check if the input entered is valid or not.
 
 When I did this using dojo forms, it was easy through form.isValid(),
 but
 I
 can't figure the way it's done using JQuery.
 
 Is there a way to use the validators before sending the data to the
 server?
 --
 View this message in context:


http://www.nabble.com/Validating-JQuery-forms-via-AJAX-tp20698748p20698748.h
 tml
 Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zend_Cache Dojo FilteringSelect

2008-11-26 Thread Brett Scott
Hi Guys,
 
I'm trying to work out the best way to implement caching in my
application.   I've based my cache setup on Matthew's PasteBin
application http://github.com/weierophinney/pastebin/tree/master
http://github.com/weierophinney/pastebin/tree/master  (which is a
great ZF example).
 
What I'd like to do is cache ajax calls from my Dojo FilteringSelect
widget.  I'm not sure whether I should use Zend_Cache_Frontend_Page,  or
Zend_Cache_Frontend_Output or simply Zend_Cache_Core and the best way to
implement different types of caching in the same application (still set
it up in the bootstrap?).
 
In the code below, a form element payment_method_id uses Dojo to call
/data/payments/supplier_id/123456 (controller: data, action: payments,
supplier_id=123456) to obtain a list of payment methods based on
supplier_id.
 
Thanks in advance :)
 
Brett.
 
==
 
Bootstrap.php
 
public function initCache()
{
$config = $this-config-cache;
$this-cache = $this-_getCache($config);
Zend_Registry::set('cache', $this-cache);
return $this;
}
 
protected function _getCache(Zend_Config $config)
{
$cache = Zend_Cache::factory(
$config-frontendName,
$config-backendName,
$config-frontendOptions-toArray(),
$config-backendOptions-toArray()
);
return $cache;
}
 
==
 
Config.ini
 
cache.backendName = Sqlite
cache.frontendName = Core
cache.frontendOptions.caching = false
cache.frontendOptions.lifetime = 900
cache.frontendOptions.automatic_serialization = true
cache.frontendOptions.automatic_cleaning_factor = 20
cache.backendOptions.cache_db_complete_path = APPLICATION_PATH
/../data/cache/cache-dev.db
cache.backendOptions.automatic_vacuum_factor = 20
 
==
 
Step1.php
 
class My_Form_Step1 extends My_Form
{
 
//  ..  
 
public function init()
{
 
//  .. 
 
$this-addElement(
'FilteringSelect',
'payment_method_id',
array(
'label' = 'Payment Method',
'storeId' = 'payment_method_id_store',
'storeType' = 'dojo.data.ItemFileReadStore',
'storeParams' = array(
'url' = $this-baseUrl() .
'/data/payments/supplier_id/123456',
),
'dijitParams' = array(
'searchAttr' = 'payment_method_title',
),
)
);
}
 
}
 
==
 
DataController.php
 
class DataController extends Zend_Controller_Action
{
 
public function init()
{
// Stop standard view output (template/layout/views)
$layout = Zend_Layout::getMvcInstance();
if ($layout instanceof Zend_Layout) {
$layout-disableLayout();
}
}

public function paymentsAction()
{

// ..   {{$matches is populated based on $supplier_id}}
 
$data = new Zend_Dojo_Data('payment_method_id', $matches);
echo $data-toJson();
}
 
}

==
 
 


RE: [fw-general] Validating JQuery forms via AJAX

2008-11-26 Thread Xavier Vidal
Ok, the idea is not complicated, thought. 

This is the inheritance diagram:

Zend_Form -- My_Ajax_Form

Zend_Form_Element -- My_Ajax_Form_Element
Zend_Form_Element_Text -- My_Ajax_Form_Element_Text
...
Zend_View_Helper_FormCheckbox -- My_View_Helper_FormCheckbox

Zend_Ajax_Form has some extra functions:
- renderAjaxMessages(returns Jquery-formatted messages ready to be
evaluated by javascript client)
- addMessage(add a message after automatic validation)
- addIdToElements   (if we have more than one form, this will
make the form unique)

The validators and filters remain unchanged as the functionality is
abstracted from ajax.

The key here is override the form view helpers (not all, only some of them),
control the validation from server and always evaluate javascript responses
from server, because it's not all about data but we can receive execution
code too.

The submit view helper will attach a jquery code to submit the form through
an ajax request and receive the response from server.

The action that will validate the form will have the same structure as we
can see in the documentation, but, the response from action needs to change.

Public function init() {
$this-form = new My_Form_Login();
}

Public function showFormAction() {
$this-view-form = $form;
}

Public function validateFormAction() {
$ajax = new Ajax();

If($this-form-isValid($_POST)) {
// do whatever and redirect client
// using javascript
$ajax-alert('Well done');
$ajax-redirect($this-view-Url('...'));
} else {
$ajax-addContent($this-form-renderAjaxMessages());
}

$ajax-render();
}

In this example I'm using my own Ajax class, disabling layout and
viewrenderer, so it take control of the response.

The error messages rendered by the Ajax Form are Jquery code, like this:

$('[EMAIL PROTECTED]']).removeClass('formErrorClass');
$('ul id=error-formid-element
class=ul-errorClass').insertAfter('[EMAIL PROTECTED]');
$('[EMAIL PROTECTED]').append('li class=li-errorClassEmpty
value/li');
$('[EMAIL PROTECTED]']).addClass('formErrorClass');


So, the ajax server part takes control of the form and he will dictates what
he needs to do in both cases: error (render error messages) or success
(redirect, show message or whatever you need).

I will post the full code soon, 

 

I took Zend_Form and I've added some extra functions: renderAjaxMessages.
I've inherited every Zend_Form_Element too, and each one has the
renderAjaxMessages function (inherited from Z

-Mensaje original-
De: Benjamin Eberlei [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 26 de noviembre de 2008 16:12
Para: fw-general@lists.zend.com
Asunto: Re: [fw-general] Validating JQuery forms via AJAX


Hello,

you could open up an Enhancement/Feature issue in Jira for me
(http://framework.zend.com/issues) and attach the changes. I can review and
test them, and we could then think about how to integrate them into ZF. I
am very interested to contribute an ajax validation, it should be very
robust though, so I cannot guarantee that i can include it.

On Wed, 26 Nov 2008 15:36:42 +0100, Xavier Vidal [EMAIL PROTECTED]
wrote:
 I have an inherited form class from Zend_Form that can validate Ajax
forms
 and render the error messages using JQuery, if someone is interested, i
 can
 share my code and we can promote it to ZF.
 
 
 -Mensaje original-
 De: Benjamin Eberlei [mailto:[EMAIL PROTECTED] 
 Enviado el: miércoles, 26 de noviembre de 2008 14:50
 Para: fw-general@lists.zend.com
 Asunto: Re: [fw-general] Validating JQuery forms via AJAX
 
 
 Hello Manuel,
 
 there is currently no way to validate your form via ajax unless you
 implement that yourself.
 
 I might implement that someday, but the form plugin is not part of jQuery
 or jQuery UI, so I havent integrated that yet.
 
 best regards,
 Benjamin
 
 On Wed, 26 Nov 2008 02:58:18 -0800 (PST), manuelpedrera
 [EMAIL PROTECTED] wrote:
 
 Hi, I've created a ZendX_JQuery_Form which has some fields with
 validators.
 The submit's click event is linked to a javascript function, where I
 want
 to
 check if the input entered is valid or not.
 
 When I did this using dojo forms, it was easy through form.isValid(),
 but
 I
 can't figure the way it's done using JQuery.
 
 Is there a way to use the validators before sending the data to the
 server?
 --
 View this message in context:


http://www.nabble.com/Validating-JQuery-forms-via-AJAX-tp20698748p20698748.h
 tml
 Sent from the Zend Framework mailing list archive at Nabble.com.




Re: [fw-general] Zend_Cache Dojo FilteringSelect

2008-11-26 Thread Matthew Weier O'Phinney
-- Brett Scott [EMAIL PROTECTED] wrote
(on Wednesday, 26 November 2008, 12:14 PM -):
 I'm trying to work out the best way to implement caching in my application.  
 I've based my cache setup on Matthew's PasteBin application http://github.com/
 weierophinney/pastebin/tree/master (which is a great ZF example).
  
 What I'd like to do is cache ajax calls from my Dojo FilteringSelect widget. 
 I'm not sure whether I should use Zend_Cache_Frontend_Page,  or
 Zend_Cache_Frontend_Output or simply Zend_Cache_Core and the best way to
 implement different types of caching in the same application (still set it up
 in the bootstrap?).
  
 In the code below, a form element payment_method_id uses Dojo to call 
 /data/
 payments/supplier_id/123456 (controller: data, action: payments, supplier_id=
 123456) to obtain a list of payment methods based on supplier_id.

You have a few ways to accomplish this. First, if you're using the MVC
to serve the XHR request for your FilteringSelect data, I wouldn't
really recommend Zend_Cache_Frontend_Page or Output. Instead, I'd
suggest using Zend_Cache_Core to cache the generated data and return it.

Second, there's nothing that says that you need to use the MVC to serve
the XHR request. If you look at recent revisions of the pastebin app,
I've actually moved all of these to a separate area under the public/
tree:

public/
api/
v1/
xmlrpc
jsonrpc
content/
...

I setup rewrite rules that intercept calls to /api/v1/content/*.* and,
if the file is not found, generate the content from a script in the
api/v1/ directory. That script utilizes the Initializer plugin to
setup the DB and view, and then, after rendering the response,
caches it to a file under the content/ tree. This allows the content
to be primarily static for XHR calls -- which gives optimal
performance. Similarly, I cache the JSON-RPC server's SMD file so it
does not need to be generated each request.

Of course, this really only works for data that is relatively static --
but similar ideas could be applied to dynamic data. The approach
basically allows you to separate XHR concerns from your MVC layer by
building targetted, mini controller scripts that utilize the same
environment bootstrapping as your MVC application.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


Re: [fw-general] Dijit container example ?

2008-11-26 Thread Matthew Weier O'Phinney
-- Superbiji » [EMAIL PROTECTED] wrote
(on Wednesday, 26 November 2008, 04:21 PM +0700):
 Hi All..
 i've been trying zf 1.7 and add accordionContainer but without
 success. please can anyone give me full examples? can't find it in
 manual yet.
 
 in my action:
   function dojoformAction() {
   Zend_Dojo::enableView($this-view);
   
   }
 
 view:
 
 ?= $this-dojo()-enable();  ?
 
 /head
 body class=tundra
 
 
 ?= $this-accordionContainer(
 'foo',
 $content . XX,
 array(
 'duration' = 200,
 ),
 array(
 'style' = 'width: 200px; height: 300px;',
 ) );
 ?

This is a classic mistake -- you're rendering the dojo() view helper
*before* any methods that would populate it have been called.

The easy solution is to capture the content of your accordionContainer()
call *prior* to doing so, and then echo that content; I've done
similarly in the pastebin example application, only I do so by rendering
another view script.

As an example, modify your layout script as follows:

? $container = $this-render('bodyAccordion.phtml'); ?
?= $this-doctype() ?
html
head
...
?= $this-dojo() ?
/head
body class=tundra
?= $container ?
/body
/html?

and then, in bodyAccordion.phtml:

? 
$this-dojo()-enable();
echo $this-accordionContainer();

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


RE: [fw-general] Validating JQuery forms via AJAX

2008-11-26 Thread Xavier Vidal
You can see a very tiny example here (in spanish, ehem…): 

http://www.citiers.com/en

 

The server is validating the received data using common validators and
filters, but the response is managed with an Ajax class that writes Jquery
code and get’s executed in the client (with Ajax’s Jquery ‘script’
datatype).

  _  

De: AJ McKee [mailto:[EMAIL PROTECTED] 
Enviado el: miércoles, 26 de noviembre de 2008 16:16
Para: Xavier Vidal
Asunto: Re: [fw-general] Validating JQuery forms via AJAX

 

Hi Xavier,
I'd love to see the class if possible. Its the one thing thats putting me
off jquery at present, but this could change it.

Thanks
AJ



2008/11/26 Xavier Vidal [EMAIL PROTECTED]

I have an inherited form class from Zend_Form that can validate Ajax forms
and render the error messages using JQuery, if someone is interested, i can
share my code and we can promote it to ZF.


-Mensaje original-
De: Benjamin Eberlei [mailto:[EMAIL PROTECTED]
Enviado el: miércoles, 26 de noviembre de 2008 14:50
Para: fw-general@lists.zend.com
Asunto: Re: [fw-general] Validating JQuery forms via AJAX


Hello Manuel,

there is currently no way to validate your form via ajax unless you
implement that yourself.

I might implement that someday, but the form plugin is not part of jQuery
or jQuery UI, so I havent integrated that yet.

best regards,
Benjamin

On Wed, 26 Nov 2008 02:58:18 -0800 (PST), manuelpedrera
[EMAIL PROTECTED] wrote:

 Hi, I've created a ZendX_JQuery_Form which has some fields with
 validators.
 The submit's click event is linked to a javascript function, where I want
 to
 check if the input entered is valid or not.

 When I did this using dojo forms, it was easy through form.isValid(), but
 I
 can't figure the way it's done using JQuery.

 Is there a way to use the validators before sending the data to the
 server?
 --
 View this message in context:

http://www.nabble.com/Validating-JQuery-forms-via-AJAX-tp20698748p20698748.h
http://www.nabble.com/Validating-JQuery-forms-via-AJAX-tp20698748p20698748.
html 
tml
 Sent from the Zend Framework mailing list archive at Nabble.com.






-- 
AJ McKee
phone: +353 (0)86 380 50 70
profile:  http://linkedin.com/in/ajmkee
jid:   [EMAIL PROTECTED]
blog:http://aj.mc-kee.com/
twitter: @ajmckee



Re: [fw-general] When the new API PDF will be available

2008-11-26 Thread Matthew Weier O'Phinney
-- Martin Klobusnik [EMAIL PROTECTED] wrote
(on Wednesday, 26 November 2008, 02:24 PM -):
 I was just wondering when the new PDF for 1.7.0  API version will become
 available for download.

To my knowledge, we've never offered the API documentation as a PDF --
the manual, yes, but not the API docs... The 1.7.0 PDF manual is in
process, but I don't know if there's an ETA yet.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


[fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

I would like to figure this out:
On my index.phtml page is a link:
--- index.phtml

?=$this-jQuery ();?
?=$this-ajaxLink( 
Home, 
/admin/index/hello, 
array('update' = 
'#contentJ',
  'noscript' = false,
  'method' = 'POST'));
?
- end of index.phtml
--

DIV contentJ is somwhere within same index.phtml page.


This function calling my helloAction inside indexController where i have:
 part of indexController-
helloAction-
$news = $db-fetchAll ( $newssql );
$this-view-news = $news;
 end


and my hello.phtml view script showing:
 hello.phtml
-
?php foreach ( $this-news as $news ) :?
?php echo $news['date'].' - '.$news['postedBy']? nbsp;nbsp;nbsp;nbsp;
?php echo $this-ajaxLink( 
[ Edit ], 
/admin/index/edit, 
array(  'id' = 'edit',

'update' = '#contentJ',

'noscript' = false,

'method' = 'POST'));
?
nbsp;
?php echo $this-ajaxLink( 
[ Delete ], 
/admin/index/delete, 
array(  'id' = 
'delete',

'update' = '#contentJ',

'noscript' = false,

'method' = 'POST'));
?

br
?php echo $news['newsText']?
br
br
?php endforeach; ?
--end of hello.phtml
---

SO far you can see that i tried to create 2 links inside hello.phtml. All
data are displayed, but [ Edit ] and [ Delete ] links are not links at all,
just plain text. 
Is it possible to make them as ajaxLink within given container (contentJ)
and clicking on them, new content is pulled in contentJ div?

Thanks a lot,
V

-- 
View this message in context: 
http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20703903.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Really slow using DOJO features...

2008-11-26 Thread Php (Absolom)
Hi!

I am using Dojo with sevarals input form, and before the view appear, it can 
take 5 seconds, even in local...

When I desactivate Dojo, it really quick.

When online, 

Any idea on how I could improve performance ?

Here is my code : 



AdminController.php : 

public function preDispatch ()
{
   $this-layout = Zend_Layout::getMvcInstance(); 
   $this-view-addHelperPath('Zend/Dojo/View/Helper', 
'Zend_Dojo_View_Helper');
   $this-translate = Zend_Registry::get('translate');  
   $this-layout-translate = Zend_Registry::get('translate');
   $this-layout-controller = $this-getRequest()-getControllerName();
}

public function customerAction()
{
$this-layout-field_left_title = 
$this-translate-_(admin_customer_left_title);
$this-layout-field_middle_title = 
$this-translate-_(admin_customer_middle_title);
$this-layout-field_right_title = 
$this-translate-_(admin_customer_right_title);
$id = $this-_getParam('id');

$view = new Zend_View();
$view-translate = Zend_Registry::get('translate');
$view-id = $id;

$customer = new CustomerModel();
if ($id != new)
{
$view-form = $customer-get($id);
} else {
$view-form = $_POST;
}

if (!empty($this-error))
{
$view-error = $this-error;
}

$view-setScriptPath('../application/views/scripts/index');

Zend_Dojo::enableView($view);
   

$customer = new CustomerModel();
$view-customers_count = $customer-count(); 
$view-customer_per_page = 7;
$paginator = Zend_Paginator::factory($customer-get());
$paginator-setCurrentPageNumber($this-_getParam('page'));
$paginator-setItemCountPerPage($view-customer_per_page);
$paginator-setPageRange(0);
$view-paginator-translate = Zend_Registry::get('translate');
$view-paginator = $paginator;
$view-setScriptPath('../application/views/scripts/customer/admin/');
$this-layout-field_left_content = $view-render('left.phtml');


$view-setScriptPath('../application/views/scripts/customer/admin/customer');
$this-layout-field_middle_content = $view-render('middle.phtml');
$this-layout-field_right_content = $view-render('right.phtml');
$this-layout-main_js = $view-render('js.phtml');
}



Layout : 

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;
html xmlns=http://www.w3.org/1999/xhtml; xml:lang=fr lang=fr
head
title?=$this-layout()-main_title?/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /
meta http-equiv=Pragma content=no-cache /
meta http-equiv=Cache-Control content=no-cache, must-revalidate /  
meta http-equiv=Expires content=0 /
? 
$dojo_theme = 'tundra';
/*if ($this-dojo()-isEnabled())
{   
   $this-dojo()-setLocalPath('/js/dojo/dojo.js')
-addStyleSheetModule('dijit.themes.'.$dojo_theme);
   echo $this-dojo();
}*/
?

Etc...



middle.phtml

input type=button class=buttonblue 
value=?=$this-translate-_(customer_submenu_general);? 
onclick=showCustomerGeneral() style=cursor:pointer
input type=button class=buttonblue 
value=?=$this-translate-_(customer_submenu_account);? 
onclick=showCustomerAccount() style=cursor:pointer
input type=button class=buttonblue 
value=?=$this-translate-_(customer_submenu_option);? 
onclick=showCustomerOption() style=cursor:pointer
input type=button class=buttonblue 
value=?=$this-translate-_(customer_submenu_note);? 
onclick=showCustomerNote() style=cursor:pointer
hr

form id=customer name=customer method=POST 
action=?=URL?admin/customersave/id/new
div id=customer_general style=display: block;height:600px;
table width=100%
?php

$this-dojo()-enable()
-setDjConfigOption('parseOnLoad', true)
-requireModule('dijit.Dialog');

if ($this-id != 'new' ) {
?
trtd?= 
$this-translate-_(customer_id)?/tdtd?=$this-form['customer_id'];?/td/tr
? } ?
trtd width=200

input type=hidden name=customer_date_creation value=?=date(Y-m-d);?

?= $this-translate-_(customer_civility)?/tdtd
?php echo $this-radioButton(
'customer_civility',
$this-form['customer_civility'],
array(),
array(),
array(
'f' = $this-translate-_(customer_civility_female),
'm' = $this-translate-_(customer_civility_male),
)
);
?
/td/tr

trtd?=$this-translate-_(customer_name);?/tdtd?php
echo $this-validationTextBox(
   'customer_name',
   $this-form['customer_name'],
   array(
   'required' = true,
   'regExp'   = '[a-zA-Z\s]+',
   'invalidMessage' = $this-translate-_(customer_name_invalidMessage),
   'class' = 'admin_customer_general_name',
   ),
   array(
   'maxlength' = 50,
   )
);
?  /td/tr

trtd?=$this-translate-_(customer_firstname);?/tdtd?php
echo 

Re: [fw-general] Dijit container example ?

2008-11-26 Thread Jason Webster
Conversely, simply move your head tags, etc, into a layout (it looks as 
if they're in your view script from your snippets).
The layout is rendered after the views, so everything should fire in the 
correct order.


Matthew Weier O'Phinney wrote:

-- Superbiji » [EMAIL PROTECTED] wrote
(on Wednesday, 26 November 2008, 04:21 PM +0700):
  

Hi All..
i've been trying zf 1.7 and add accordionContainer but without
success. please can anyone give me full examples? can't find it in
manual yet.

in my action:
function dojoformAction() {
Zend_Dojo::enableView($this-view);

}

view:

?= $this-dojo()-enable();  ?

/head
body class=tundra


?= $this-accordionContainer(
'foo',
$content . XX,
array(
'duration' = 200,
),
array(
'style' = 'width: 200px; height: 300px;',
) );
?



This is a classic mistake -- you're rendering the dojo() view helper
*before* any methods that would populate it have been called.

The easy solution is to capture the content of your accordionContainer()
call *prior* to doing so, and then echo that content; I've done
similarly in the pastebin example application, only I do so by rendering
another view script.

As an example, modify your layout script as follows:

? $container = $this-render('bodyAccordion.phtml'); ?
?= $this-doctype() ?
html
head
...
?= $this-dojo() ?
/head
body class=tundra
?= $container ?
/body
/html?

and then, in bodyAccordion.phtml:

? 
$this-dojo()-enable();

echo $this-accordionContainer();

  




Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread Benjamin Eberlei

You have to give dataType = html as additoinal parameter to the options,
because for
security by default ajax responses are handled as text.

On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn [EMAIL PROTECTED]
wrote:
 
 I would like to figure this out:
 On my index.phtml page is a link:
 --- index.phtml
 
 ?=$this-jQuery ();?
 ?=$this-ajaxLink(
   Home, 
 /admin/index/hello,
   array('update' = 
 '#contentJ',
   'noscript' = false,
   'method' = 'POST'));
   ?
 - end of index.phtml
 --
 
 DIV contentJ is somwhere within same index.phtml page.
 
 
 This function calling my helloAction inside indexController where i have:
  part of indexController-
 helloAction-
 $news = $db-fetchAll ( $newssql );
 $this-view-news = $news;
  end
 
 
 and my hello.phtml view script showing:
  hello.phtml
 -
 ?php foreach ( $this-news as $news ) :?
 ?php echo $news['date'].' - '.$news['postedBy']?
 
 ?php echo $this-ajaxLink(
   [ Edit ], 
 /admin/index/edit,
   array(  'id' = 'edit',
   
 'update' = '#contentJ',
   
 'noscript' = false,
   
 'method' = 'POST'));
 ?
  
 ?php echo $this-ajaxLink(
   [ Delete ], 
 /admin/index/delete,
   array(  'id' = 
 'delete',
   
 'update' = '#contentJ',
   
 'noscript' = false,
   
 'method' = 'POST'));
 ?
 
   br
 ?php echo $news['newsText']?
   br
   br
 ?php endforeach; ?
 --end of hello.phtml
 ---
 
 SO far you can see that i tried to create 2 links inside hello.phtml. All
 data are displayed, but [ Edit ] and [ Delete ] links are not links at
 all,
 just plain text.
 Is it possible to make them as ajaxLink within given container (contentJ)
 and clicking on them, new content is pulled in contentJ div?
 
 Thanks a lot,
 V
 
 --
 View this message in context:

http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20703903.html
 Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

THank you for your quick reply.
Can you show me how to this, or point me somewhere where i can learn that
please?
And where to add that?
array('update' = '#contentJ',
  'noscript' = false,
  'method' = 'POST',
  'dataType'='html'
)
Like that?


beberlei wrote:
 
 
 You have to give dataType = html as additoinal parameter to the options,
 because for
 security by default ajax responses are handled as text.
 
 On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn [EMAIL PROTECTED]
 wrote:
 
 I would like to figure this out:
 On my index.phtml page is a link:
 --- index.phtml
 
 ?=$this-jQuery ();?
 ?=$this-ajaxLink(
  Home, 
 /admin/index/hello,
  array('update' = 
 '#contentJ',
   'noscript' = false,
   'method' = 'POST'));
  ?
 - end of index.phtml
 --
 
 DIV contentJ is somwhere within same index.phtml page.
 
 
 This function calling my helloAction inside indexController where i have:
  part of indexController-
 helloAction-
 $news = $db-fetchAll ( $newssql );
 $this-view-news = $news;
  end
 
 
 and my hello.phtml view script showing:
  hello.phtml
 -
 ?php foreach ( $this-news as $news ) :?
 ?php echo $news['date'].' - '.$news['postedBy']?
 
 ?php echo $this-ajaxLink(
  [ Edit ], 
 /admin/index/edit,
  array(  'id' = 'edit',
  
 'update' = '#contentJ',
  
 'noscript' = false,
  
 'method' = 'POST'));
 ?
  
 ?php echo $this-ajaxLink(
  [ Delete ], 
 /admin/index/delete,
  array(  'id' = 
 'delete',
  
 'update' = '#contentJ',
  
 'noscript' = false,
  
 'method' = 'POST'));
 ?
 
  br
 ?php echo $news['newsText']?
  br
  br
 ?php endforeach; ?
 --end of hello.phtml
 ---
 
 SO far you can see that i tried to create 2 links inside hello.phtml. All
 data are displayed, but [ Edit ] and [ Delete ] links are not links at
 all,
 just plain text.
 Is it possible to make them as ajaxLink within given container (contentJ)
 and clicking on them, new content is pulled in contentJ div?
 
 Thanks a lot,
 V
 
 --
 View this message in context:

 http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20703903.html
 Sent from the Zend Framework mailing list archive at Nabble.com.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20704281.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

Well, i added dataType to all 3 links, but no changes at all


vladimirn wrote:
 
 THank you for your quick reply.
 Can you show me how to this, or point me somewhere where i can learn that
 please?
 And where to add that?
 array('update' = '#contentJ',
   'noscript' = false,
   'method' = 'POST',
   'dataType'='html'
 )
 Like that?
 
 
 beberlei wrote:
 
 
 You have to give dataType = html as additoinal parameter to the options,
 because for
 security by default ajax responses are handled as text.
 
 On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn
 [EMAIL PROTECTED]
 wrote:
 
 I would like to figure this out:
 On my index.phtml page is a link:
 --- index.phtml
 
 ?=$this-jQuery ();?
 ?=$this-ajaxLink(
 Home, 
 /admin/index/hello,
 array('update' = 
 '#contentJ',
   'noscript' = false,
   'method' = 'POST'));
 ?
 - end of index.phtml
 --
 
 DIV contentJ is somwhere within same index.phtml page.
 
 
 This function calling my helloAction inside indexController where i
 have:
  part of indexController-
 helloAction-
 $news = $db-fetchAll ( $newssql );
 $this-view-news = $news;
  end
 
 
 and my hello.phtml view script showing:
  hello.phtml
 -
 ?php foreach ( $this-news as $news ) :?
 ?php echo $news['date'].' - '.$news['postedBy']?
 
 ?php echo $this-ajaxLink(
 [ Edit ], 
 /admin/index/edit,
 array(  'id' = 'edit',
 
 'update' = '#contentJ',
 
 'noscript' = false,
 
 'method' = 'POST'));
 ?
  
 ?php echo $this-ajaxLink(
 [ Delete ], 
 /admin/index/delete,
 array(  'id' = 
 'delete',
 
 'update' = '#contentJ',
 
 'noscript' = false,
 
 'method' = 'POST'));
 ?
 
 br
 ?php echo $news['newsText']?
 br
 br
 ?php endforeach; ?
 --end of hello.phtml
 ---
 
 SO far you can see that i tried to create 2 links inside hello.phtml.
 All
 data are displayed, but [ Edit ] and [ Delete ] links are not links at
 all,
 just plain text.
 Is it possible to make them as ajaxLink within given container
 (contentJ)
 and clicking on them, new content is pulled in contentJ div?
 
 Thanks a lot,
 V
 
 --
 View this message in context:

 http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20703903.html
 Sent from the Zend Framework mailing list archive at Nabble.com.
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20704314.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] View Helper Repository?

2008-11-26 Thread Justin Plock
Does anyone know if there is some sort of site which is collecting 
useful view helpers to use? Might be a good idea. In any case, here is a 
view helper I use to convert a UNIX timestamp stored as UTC to a 
user-defined timezone and locale:


class My_View_Helper_FormatDate extends Zend_View_Helper_Abstract
{
  /**
   * Format a timestamp in the user's locale and timezone
   *
   * @param  integer $timestamp
   * @param  string  $format
   * @return string
   */
  public function formatDate($timestamp, $format=Zend_Date::DATE_SHORT)
  {
if (Zend_Registry::isRegistered('locale')) { // en_US
  $locale = Zend_Registry::get('locale');
}
else {
  $locale = null;
}

$date = new Zend_Date($timestamp, Zend_Date::TIMESTAMP, $locale);
if (Zend_Registry::isRegistered('timezome')) { // America/New_York
  $date-setTimezone(Zend_Registry::get('timezone'));
}

return $date-get($format, $locale);
  }
}

Then, as long as 'locale' and 'timezone' variables are set in 
Zend_Registry, in my view I can do:


?php echo $this-formatDate($timestamp); ?

-Justin



Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread Benjamin Eberlei
Hello,

i have looked at the issue again, and what you try to achieve is not really 
possible. Because ajaxLink generally creates jQuery javascript and attaches it 
to the jQuery stack which you render with ?= $this-jQuery(); ? in your 
view.

Wenn you call the ajax content and return new links that are created with 
ajaxLink() their javascript cannot be attached to the jQuery stack anymore, 
because that has been rendered before.

What you could try is the following, in the two links that are generated 
through the ajax request set in the options 'inline'  = true, and in the 
previous linke set: 'dataType' = 'script', so that it would look like:

Normally generated link:
 array('update' = '#contentJ',
   'noscript' = false,
   'method' = 'POST',
   'dataType'='script'
 )

Ajax Requested Link:
?php echo $this-ajaxLink(
[ Edit ], /admin/index/edit,
array(  'id' = 'edit',
'update' = '#contentJ',
'noscript' = false,
'inline' = true,
'method' = 'POST'));

On Wednesday 26 November 2008 17:27:37 vladimirn wrote:
 Well, i added dataType to all 3 links, but no changes at all

 vladimirn wrote:
  THank you for your quick reply.
  Can you show me how to this, or point me somewhere where i can learn that
  please?
  And where to add that?
  array('update' = '#contentJ',
'noscript' = false,
'method' = 'POST',
'dataType'='html'
  )
  Like that?
 
  beberlei wrote:
  You have to give dataType = html as additoinal parameter to the options,
  because for
  security by default ajax responses are handled as text.
 
  On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn
  [EMAIL PROTECTED]
 
  wrote:
  I would like to figure this out:
  On my index.phtml page is a link:
  --- index.phtml
  
  ?=$this-jQuery ();?
  ?=$this-ajaxLink(
Home, 
  /admin/index/hello,
array('update' = 
  '#contentJ',
'noscript' = false,
'method' = 'POST'));
?
  - end of index.phtml
  --
 
  DIV contentJ is somwhere within same index.phtml page.
 
 
  This function calling my helloAction inside indexController where i
  have:
   part of indexController-
  helloAction-
  $news = $db-fetchAll ( $newssql );
  $this-view-news = $news;
   end
  ---
 -
 
  and my hello.phtml view script showing:
   hello.phtml
  -
  ?php foreach ( $this-news as $news ) :?
  ?php echo $news['date'].' - '.$news['postedBy']?
  
  ?php echo $this-ajaxLink(
[ Edit ], 
  /admin/index/edit,
array(  'id' = 'edit',

  'update' = '#contentJ',

  'noscript' = false,

  'method' = 'POST'));
  ?
   
  ?php echo $this-ajaxLink(
[ Delete ], 
  /admin/index/delete,
array(  'id' = 
  'delete',

  'update' = '#contentJ',

  'noscript' = false,

  'method' = 'POST'));
  ?
 
br
  ?php echo $news['newsText']?
br
br
  ?php endforeach; ?
  --end of hello.phtml
  ---
 
  SO far you can see that i tried to create 2 links inside hello.phtml.
  All
  data are displayed, but [ Edit ] and [ Delete ] links are not links at
  all,
  just plain text.
  Is it possible to make them as ajaxLink within given container
  (contentJ)
  and clicking on them, new content is pulled in contentJ div?
 
  Thanks a lot,
  V
 
  --
  View this message in context:
 
  http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-thi
 s--tp20703903p20703903.html
 
  Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
Benjamin Eberlei
http://www.beberlei.de


Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

I went thru
http://framework.zend.com/manual/en/zendx.jquery.view.html#zendx.jquery.view.helpers.ajaxlink
and it says that dataType = html is default. However, i explicitly gave this
to my ajaxLink and still wont work.
I tried to change to dataType=text and i am getting code of my hello.phtml

However links inside hello.phtml still wont work.
Can anyone help me on this please? :)
-- 
View this message in context: 
http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20704908.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

Thank you for reply.
I tried to set up like this, but still wont work.
I think that would be big deal to make such thing to work, so one can use
ajaxLink inside container requested by another ajaxLInk.
Is there anything else i can try? i would not like to abandon this, cause i
think its a great idea, so i will ask for help one more time ;)

Thanks,
V


beberlei wrote:
 
 Hello,
 
 i have looked at the issue again, and what you try to achieve is not
 really 
 possible. Because ajaxLink generally creates jQuery javascript and
 attaches it 
 to the jQuery stack which you render with ?= $this-jQuery(); ? in your 
 view.
 
 Wenn you call the ajax content and return new links that are created with 
 ajaxLink() their javascript cannot be attached to the jQuery stack
 anymore, 
 because that has been rendered before.
 
 What you could try is the following, in the two links that are generated 
 through the ajax request set in the options 'inline'  = true, and in the 
 previous linke set: 'dataType' = 'script', so that it would look like:
 
 Normally generated link:
  array('update' = '#contentJ',
'noscript' = false,
'method' = 'POST',
'dataType'='script'
  )
 
 Ajax Requested Link:
 ?php echo $this-ajaxLink(
   [ Edit ], /admin/index/edit,
   array(  'id' = 'edit',
   'update' = '#contentJ',
   'noscript' = false,
   'inline' = true,
   'method' = 'POST'));
 
 On Wednesday 26 November 2008 17:27:37 vladimirn wrote:
 Well, i added dataType to all 3 links, but no changes at all

 vladimirn wrote:
  THank you for your quick reply.
  Can you show me how to this, or point me somewhere where i can learn
 that
  please?
  And where to add that?
  array('update' = '#contentJ',
'noscript' = false,
'method' = 'POST',
'dataType'='html'
  )
  Like that?
 
  beberlei wrote:
  You have to give dataType = html as additoinal parameter to the
 options,
  because for
  security by default ajax responses are handled as text.
 
  On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn
  [EMAIL PROTECTED]
 
  wrote:
  I would like to figure this out:
  On my index.phtml page is a link:
  --- index.phtml
  
  ?=$this-jQuery ();?
  ?=$this-ajaxLink(
   Home, 
  /admin/index/hello,
   array('update' = 
  '#contentJ',
'noscript' = false,
'method' = 'POST'));
   ?
  - end of index.phtml
  --
 
  DIV contentJ is somwhere within same index.phtml page.
 
 
  This function calling my helloAction inside indexController where i
  have:
   part of indexController-
  helloAction-
  $news = $db-fetchAll ( $newssql );
  $this-view-news = $news;
   end
 
 ---
 -
 
  and my hello.phtml view script showing:
   hello.phtml
  -
  ?php foreach ( $this-news as $news ) :?
  ?php echo $news['date'].' - '.$news['postedBy']?
  
  ?php echo $this-ajaxLink(
   [ Edit ], 
  /admin/index/edit,
   array(  'id' = 'edit',
   
  'update' = '#contentJ',
   
  'noscript' = false,
   
  'method' = 'POST'));
  ?
   
  ?php echo $this-ajaxLink(
   [ Delete ], 
  /admin/index/delete,
   array(  'id' = 
  'delete',
   
  'update' = '#contentJ',
   
  'noscript' = false,
   
  'method' = 'POST'));
  ?
 
   br
  ?php echo $news['newsText']?
   br
   br
  ?php endforeach; ?
  --end of hello.phtml
  ---
 
  SO far you can see that i tried to create 2 links inside hello.phtml.
  All
  data are displayed, but [ Edit ] and [ Delete ] links are not links
 at
  all,
  just plain text.
  Is it possible to make them as ajaxLink within given container
  (contentJ)
  and clicking on them, new content is pulled in contentJ div?
 
  Thanks a lot,
  V
 
  --
  View this message in 

Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

Just to add this:
i looked at source after clicked on first ajaxLink and i have this:
#  [ Edit ]nbsp;
#  [ Delete ]   
Somehow, [ Edit ] is out of a href tags..
-- 
View this message in context: 
http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20705645.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread Benjamin Eberlei
you should probably generalize your jQuery link by writing that on your own. 
This way you can supply the needed jQuery code already in your main view.

I cannot come up with another idea how that would work with the ajaxLink 
helper. Sorry :-)

On Wednesday 26 November 2008 18:34:15 vladimirn wrote:
 Thank you for reply.
 I tried to set up like this, but still wont work.
 I think that would be big deal to make such thing to work, so one can use
 ajaxLink inside container requested by another ajaxLInk.
 Is there anything else i can try? i would not like to abandon this, cause i
 think its a great idea, so i will ask for help one more time ;)

 Thanks,
 V

 beberlei wrote:
  Hello,
 
  i have looked at the issue again, and what you try to achieve is not
  really
  possible. Because ajaxLink generally creates jQuery javascript and
  attaches it
  to the jQuery stack which you render with ?= $this-jQuery(); ? in your
  view.
 
  Wenn you call the ajax content and return new links that are created with
  ajaxLink() their javascript cannot be attached to the jQuery stack
  anymore,
  because that has been rendered before.
 
  What you could try is the following, in the two links that are generated
  through the ajax request set in the options 'inline'  = true, and in the
  previous linke set: 'dataType' = 'script', so that it would look like:
 
  Normally generated link:
   array('update' = '#contentJ',
 'noscript' = false,
 'method' = 'POST',
 'dataType'='script'
   )
 
  Ajax Requested Link:
  ?php echo $this-ajaxLink(
  [ Edit ], /admin/index/edit,
  array(  'id' = 'edit',
  'update' = '#contentJ',
  'noscript' = false,
  'inline' = true,
  'method' = 'POST'));
 
  On Wednesday 26 November 2008 17:27:37 vladimirn wrote:
  Well, i added dataType to all 3 links, but no changes at all
 
  vladimirn wrote:
   THank you for your quick reply.
   Can you show me how to this, or point me somewhere where i can learn
 
  that
 
   please?
   And where to add that?
   array('update' = '#contentJ',
 'noscript' = false,
 'method' = 'POST',
 'dataType'='html'
   )
   Like that?
  
   beberlei wrote:
   You have to give dataType = html as additoinal parameter to the
 
  options,
 
   because for
   security by default ajax responses are handled as text.
  
   On Wed, 26 Nov 2008 08:07:39 -0800 (PST), vladimirn
   [EMAIL PROTECTED]
  
   wrote:
   I would like to figure this out:
   On my index.phtml page is a link:
   --- index.phtml
   
   ?=$this-jQuery ();?
   ?=$this-ajaxLink(
  Home, 
   /admin/index/hello,
  array('update' 
   = '#contentJ',
 'noscript' = false,
 'method' = 'POST'));
  ?
   - end of index.phtml
   --
  
   DIV contentJ is somwhere within same index.phtml page.
  
  
   This function calling my helloAction inside indexController where i
   have:
    part of indexController-
   helloAction-
   $news = $db-fetchAll ( $newssql );
   $this-view-news = $news;
    end
 
  ---
 
  -
  
   and my hello.phtml view script showing:
    hello.phtml
   -
   ?php foreach ( $this-news as $news ) :?
   ?php echo $news['date'].' - '.$news['postedBy']?
   
   ?php echo $this-ajaxLink(
  [ Edit ], 
   /admin/index/edit,
  array(  'id' = 
   'edit',
  
   'update' = '#contentJ',
  
   'noscript' = false,
  
   'method' = 'POST'));
   ?
    
   ?php echo $this-ajaxLink(
  [ Delete ], 
   /admin/index/delete,
  array(  'id' = 
   'delete',
  
   'update' = '#contentJ',
  
   'noscript' = false,
  
   'method' = 'POST'));
   ?
  
  br
   ?php echo $news['newsText']?
  br
 

Re: [fw-general] jQuery Ajax link inside container- how to make this?

2008-11-26 Thread vladimirn

Thanks.
Can u just tell me why Edit and Delete are not inside a href in hello.phtml?
It wont allow me to post how link looks like so i will improvize:
href=# id=delete onclick=$.post('/admin/index/hello', {},
function(data, textStatus) { $('#contentJ').html(data); }, 'html');return
false; [Delete]

See? [Delete] is totally out of link tag.
-- 
View this message in context: 
http://www.nabble.com/jQuery-Ajax-link-inside-container--how-to-make-this--tp20703903p20705922.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Really slow using DOJO features...

2008-11-26 Thread Matthew Weier O'Phinney
-- Php (Absolom) [EMAIL PROTECTED] wrote
(on Wednesday, 26 November 2008, 05:08 PM +0100):
 I am using Dojo with sevarals input form, and before the view appear, it can
 take 5 seconds, even in local...
 
 When I desactivate Dojo, it really quick.
 
 When online, 
 
 Any idea on how I could improve performance ?

The speed has to do with the fact that Dojo is pulling in resources from
the server on-demand; it cannot render the various dijits until the
resources are present.

The answer to this is twofold. First, make sure that you have
appropriate expires headers setup for your static (js, css, html)
resources so that the browser can cache them. Second, when you're ready
to go to production, create a custom dojo build. This will significantly
speed up the UI, as all resources will be loaded in a single file.

I've performed a webinar showing this at:

http://www.zend.com/webinars/framework

and also blogged about it. Creating the build is unintuitive at first,
but once you grasp how it works and have a build in place, the results
are nothing short of amazing.

-- 
Matthew Weier O'Phinney
Software Architect   | [EMAIL PROTECTED]
Zend Framework   | http://framework.zend.com/


[fw-general] Zend_Session and rememberMe();

2008-11-26 Thread Tim Nagel
Hello,

I am trying to set sessions to be remembered for 2 weeks. I have set
remember_me_seconds to 1209600. I call Zend_Session::rememberMe() once the
user is authenticated.

Works great.

The problem occurs that the cookie expiry time is never updated after this
point and will expire in 2 weeks regardless of how much activity. I want to
be able to extend this to current activity + 2 weeks, but using
Zend_Session::rememberMe() in the bootstrap calls regenerateId() and changes
the session id on every pageload which will break some code I am using that
needs a steady session id.

The question is: IS there a way to call rememberMe() without it calling
regenerateId(), should I request a new feature? I know I can override the
session object to do what I want without too much trouble, but I believe I
might be missing something in my application design? How do you guys deal
with remembering sessions?



Tim


Re: [fw-general] Zend_Session and rememberMe();

2008-11-26 Thread Kevin McArthur

You just need to call setExpirationSeconds again.



Tim Nagel wrote:

Hello,
 
I am trying to set sessions to be remembered for 2 weeks. I have set 
remember_me_seconds to 1209600. I call Zend_Session::rememberMe() once 
the user is authenticated.
 
Works great.
 
The problem occurs that the cookie expiry time is never updated after 
this point and will expire in 2 weeks regardless of how much activity. 
I want to be able to extend this to current activity + 2 weeks, but 
using Zend_Session::rememberMe() in the bootstrap calls regenerateId() 
and changes the session id on every pageload which will break some 
code I am using that needs a steady session id.
 
The question is: IS there a way to call rememberMe() without it 
calling regenerateId(), should I request a new feature? I know I can 
override the session object to do what I want without too much 
trouble, but I believe I might be missing something in my application 
design? How do you guys deal with remembering sessions?
 
 
 
Tim


--

Kevin McArthur

StormTide Digital Studios Inc.
Author of the recently published book, Pro PHP
http://www.stormtide.ca



smime.p7s
Description: S/MIME Cryptographic Signature


[fw-general] Url rewrite problem for index controller

2008-11-26 Thread amar4kintu

I have my site in /certilogo/ folder

Following is my .htaccess file

==
   Options +FollowSymLinks
RewriteEngine on

RewriteBase /certilogo/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* index.php [L]


Following is the problem I am getting.

1. When I run my site using url http://10.103.99.2/certilogo/. It opens site
homepage perfectly.

2. When I run my site using url http://10.103.99.2/certilogo/index. It
should again open site home page but instead it gives me following error.

Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with
message 'Invalid controller specified (certilogo)' in
/u/certilogo/certilogo/library/Zend/Controller/Dispatcher/Standard.php:241
Stack trace: #0
/u/certilogo/certilogo/library/Zend/Controller/Front.php(934):
Zend_Controller_Dispatcher_Standard-dispatch(Object(Zend_Controller_Request_Http),
Object(Zend_Controller_Response_Http)) #1
/u/certilogo/certilogo/index.php(175): Zend_Controller_Front-dispatch() #2
{main} thrown in
/u/certilogo/certilogo/library/Zend/Controller/Dispatcher/Standard.php on
line 241

3. If I run my site using url http://10.103.99.2/certilogo/page/index/cid/2.
It works perfectly fine.

So it is only second option that is giving error.

Following is my mod_rewrite log. If it can help you.
10.103.240.117 - - [27/Nov/2008:06:54:21 +0100]
[test.ctltest.com/sid#877b624][rid#888af5c/initial] (3) [per-dir
/u/certilogo/certilogo/] strip per-dir prefix:
/u/certilogo/certilogo/index.php - index.php
10.103.240.117 - - [27/Nov/2008:06:54:21 +0100]
[test.ctltest.com/sid#877b624][rid#888af5c/initial] (3) [per-dir
/u/certilogo/certilogo/] applying pattern '.*' to uri 'index.php'
10.103.240.117 - - [27/Nov/2008:06:54:21 +0100]
[test.ctltest.com/sid#877b624][rid#888af5c/initial] (4) RewriteCond:
input='/u/certilogo/certilogo/index.php' pattern='!-f' = not-matched
10.103.240.117 - - [27/Nov/2008:06:54:21 +0100]
[test.ctltest.com/sid#877b624][rid#888af5c/initial] (1) [per-dir
/u/certilogo/certilogo/] pass through /u/certilogo/certilogo/index.php

Please help me if you can

Thanks
-- 
View this message in context: 
http://www.nabble.com/Url-rewrite-problem-for-index-controller-tp20713702p20713702.html
Sent from the Zend Framework mailing list archive at Nabble.com.



[fw-general] Zendx Jquery Datepicker custom viewscript

2008-11-26 Thread aSecondWill

Hi, 

I had a jquery datepicker working with my options set like this:

$time_event_end = new ZendX_JQuery_Form_Element_DatePicker(
'time_event_end',
array('jQueryParams' = array( 'showOn' = both ,
'buttonImage' = /images/jquery/calendar.gif, 'dateFormat' = 'yy-mm-dd',
'buttonImageOnly' = 'true'))
);  

But i wanted to add a div around the whole element, dt label dd input,
everything.

so i set my custom viewscript like this:

$time_event_end-setDecorators(array(array('ViewScript', array(
'viewScript' = '_element.phtml',
'id'  = 'time_event_end_div'
;

and then made a element.phtml that looked like this:

div id=?= $this-id ?
dt
?= $this-formLabel($this-element-getName(),
 $this-element-getLabel()) ?
 /dt
 dd
?= $this-{$this-element-helper}(
$this-element-getName(),
$this-element-getValue(),
$this-element-getAttribs()
) ?
/dd
?= $this-formErrors($this-element-getMessages()) ?
div class=hint?= $this-element-getDescription() ?/div
/div

now my datepicker dosn't have any options set because the onload function
for it as changed from 


$(#time_event_end).datepicker({showOn:both,buttonImage:\/images\/jquery\/calendar.gif,dateFormat:yy-mm-dd,buttonImageOnly:true});


to 

$(#time_event_end).datepicker({helper:datePicker,jQueryParams:{showOn:both,buttonImage:\/images\/jquery\/calendar.gif,dateFormat:yy-mm-dd,buttonImageOnly:true},options:[]});

What have i done wrong? i don't think its in the .phtm file right? its the
way ive used setDecorators? 

Any and all help gratefully recieved!

Will

-- 
View this message in context: 
http://www.nabble.com/Zendx-Jquery-Datepicker--custom-viewscript-tp20713703p20713703.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zendx Jquery Datepicker custom viewscript

2008-11-26 Thread Benjamin Eberlei
datepicker needs the UiWidgetElement Decorator, NOT the ViewHelper decorator.

On Thursday 27 November 2008 07:03:25 aSecondWill wrote:
 Hi,

 I had a jquery datepicker working with my options set like this:

 $time_event_end = new ZendX_JQuery_Form_Element_DatePicker(
 'time_event_end',
 array('jQueryParams' = array( 'showOn' = both ,
 'buttonImage' = /images/jquery/calendar.gif, 'dateFormat' = 'yy-mm-dd',
 'buttonImageOnly' = 'true'))
 );

 But i wanted to add a div around the whole element, dt label dd input,
 everything.

 so i set my custom viewscript like this:

 $time_event_end-setDecorators(array(array('ViewScript', array(
   'viewScript' = '_element.phtml',
   'id'  = 'time_event_end_div'
   ;

 and then made a element.phtml that looked like this:

 div id=?= $this-id ?
   dt
 ?= $this-formLabel($this-element-getName(),
  $this-element-getLabel()) ?
  /dt
  dd
 ?= $this-{$this-element-helper}(
 $this-element-getName(),
 $this-element-getValue(),
 $this-element-getAttribs()
 ) ?
 /dd
 ?= $this-formErrors($this-element-getMessages()) ?
 div class=hint?= $this-element-getDescription() ?/div
 /div

 now my datepicker dosn't have any options set because the onload function
 for it as changed from


 $(#time_event_end).datepicker({showOn:both,buttonImage:\/images\/j
query\/calendar.gif,dateFormat:yy-mm-dd,buttonImageOnly:true});


 to

 $(#time_event_end).datepicker({helper:datePicker,jQueryParams:{sho
wOn:both,buttonImage:\/images\/jquery\/calendar.gif,dateFormat:yy-
mm-dd,buttonImageOnly:true},options:[]});

 What have i done wrong? i don't think its in the .phtm file right? its the
 way ive used setDecorators?

 Any and all help gratefully recieved!

 Will

-- 
Benjamin Eberlei
http://www.beberlei.de


Re: [fw-general] Zendx Jquery Datepicker custom viewscript

2008-11-26 Thread aSecondWill

hmm, ok. thanks.

so can't i specify a phtml file to manage the layout with that?



beberlei wrote:
 
 datepicker needs the UiWidgetElement Decorator, NOT the ViewHelper
 decorator.
 
 

-- 
View this message in context: 
http://www.nabble.com/Zendx-Jquery-Datepicker--custom-viewscript-tp20713703p20714583.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zendx Jquery Datepicker custom viewscript

2008-11-26 Thread Benjamin Eberlei
i dont know about the layout and phtml file, this is not a topic of the 
datepicker. what i said is, you have to change your setDecorators call to:

$time_event_end-setDecorators(array(array('UiWidgetElement', array(
      'viewScript' = '_element.phtml',
      'id'      = 'time_event_end_div'
  ;

DatePicker does not work with ViewHelper but with UiWidgetElement helper.

On Thursday 27 November 2008 08:19:56 aSecondWill wrote:
 hmm, ok. thanks.

 so can't i specify a phtml file to manage the layout with that?

 beberlei wrote:
  datepicker needs the UiWidgetElement Decorator, NOT the ViewHelper
  decorator.

-- 
Benjamin Eberlei
http://www.beberlei.de


[fw-general] SPAM + Zend Filter

2008-11-26 Thread dele454

Hi

I just have a question regarding spam prevention on forms. Does Filtering
input with the Zend_Filter_StripTags help remove injection headers and tags
that could initiate spam sending?

Am using the component at the moment for my forms which strips out any tag
elements and was thinking since it would strip out any tag then the spammer
wont be able to execute his spam sending.

Am i correct on this assumption?

Thanks and looking forward to the responses. Thanks

-
dee
-- 
View this message in context: 
http://www.nabble.com/SPAM-%2B-Zend-Filter-tp20714805p20714805.html
Sent from the Zend Framework mailing list archive at Nabble.com.