-- duyhung <[EMAIL PROTECTED]> wrote
(on Tuesday, 22 July 2008, 05:59 AM -0700):
> Do you mean I can use the getDijitParam('type') and
> setDijitParam('type','password')? I was playing with that a while but then
> when I looked into the Zend code, I think 'type' is not a dijit param.
> Correct me if I am wrong, mate. I found out that it's actually the HTML
> element type I need to change from 'text' to 'password' type.
It is, but the functionality in the abstract Dijit helper will do one of
the following
* If using declarative dojo, it will add the type HTML attribute.
Whatever type attribute is defined last wins in HTML.
* If using programmatic dojo, it will mixin the type HTML attribute,
with the same result as above.
> So I created an element PwdValidationTextBox extends the
> ValidationTextBox class:
> Code:
> <?php
>
> require_once 'Zend/Dojo/Form/Element/ValidationTextBox.php';
>
> class Helpdesk_Form_Element_PwdValidationTextBox extends
> Zend_Dojo_Form_Element_ValidationTextBox
> {
>
> public $helper = 'PwdValidationTextBox';
>
> }
>
> And a view helper which is just almost identical to ValidationTextBox view
> helper but with a minor modification:
> protected $_elementType = 'password';
>
> I'm not sure it's a good way to implement it or not, but it's working now.
It's actually how I plan to do this for RC2 (albeit with a different
helper name). :)
> Matthew Weier O'Phinney-3 wrote:
> >
> > -- Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote
> > (on Monday, 21 July 2008, 12:37 PM -0400):
> >> -- duyhung <[EMAIL PROTECTED]> wrote
> >> (on Monday, 21 July 2008, 05:10 AM -0700):
> >> > Yes, I was using the old incubator version. Thanks Matthew, you saved
> >> my day.
> >>
> >> Glad I could help!
> >>
> >> > Btw, I'm wondering how can you set the password field
> >> > (validationtextbox in my case) to be asterisk input as I haven't seen
> >> > anyway to do that? I did read the ZF doc though.
> >>
> >> You know, really not sure. There isn't a dijit for password fields to my
> >> knowledge. I'll ask on the #dojo IRC channel -- you might want to do the
> >> same.
> >
> > It appears that you have two possibilities:
> >
> > * Create an element that extends ValidationTextBox or TextBox and
> > which sets the 'type' dijit param to 'password'. (This will be the
> > route I will officially take)
> > * Alternately, pass the 'type' dijit parameter with the value
> > 'password' to either a TextBox or ValidationTextBox element. (You
> > can do this _now_.)
> >
> > --
> > Matthew Weier O'Phinney
> > Software Architect | [EMAIL PROTECTED]
> > Zend Framework | http://framework.zend.com/
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Steps-to-integrating-Dojo-with-Zend-Framework--tp18561545p18587454.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
--
Matthew Weier O'Phinney
Software Architect | [EMAIL PROTECTED]
Zend Framework | http://framework.zend.com/