You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Patrick Lightbody <fo...@opensymphony.com> on 2006/08/14 01:33:18 UTC

Random IDs for form elements - Why?

http://mail-archives.apache.org/mod_mbox/struts-commits/200608.mbox/%3c20060813064529.BE2F81A981A@eris.apache.org%3e
http://mail-archives.apache.org/mod_mbox/struts-commits/200608.mbox/%3c20060813065517.AABC21A981F@eris.apache.org%3e

A few questions:

 - What is FormButton.java? Is that new?
 - Why are we rendering random numbers? Why not something more predictable, such as a sequence that starts at zero on every page load?

I ask because tm_jee's recent changes caused a test on HostedQA to fail, since the submit button ID is no longer predictable, and therefore no longer scriptable.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=40158&messageID=79815#79815


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Random IDs for form elements - Why?

Posted by tm jee <tm...@yahoo.co.uk>.
Thx for the link. I'll keep an eye on the test whenever I do some commit.  

> I can set up email alerts to go to some list (which one?) as well.
What about the struts dev list?

> And of course, just let me know if you want a HostedQA account.
Ok, will do. Thx. 

regards

----- Original Message ----
From: Patrick Lightbody <fo...@opensymphony.com>
To: dev@struts.apache.org
Sent: Monday, 14 August, 2006 8:14:38 AM
Subject: Re: Random IDs for form elements - Why?

You can always view the latest reports here:

https://struts.hostedqa.com/project/7/session/suite/list

I can set up email alerts to go to some list (which one?) as well.

And of course, just let me know if you want a HostedQA account.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=40158&messageID=79910#79910


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org






Re: Random IDs for form elements - Why?

Posted by Patrick Lightbody <fo...@opensymphony.com>.
You can always view the latest reports here:

https://struts.hostedqa.com/project/7/session/suite/list

I can set up email alerts to go to some list (which one?) as well.

And of course, just let me know if you want a HostedQA account.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=40158&messageID=79910#79910


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Random IDs for form elements - Why?

Posted by tm_jee <fo...@opensymphony.com>.
Hi Pat, 

How do one check the tests result of Struts2 in HostedQA? Is there a link? Do one need an account for that? Thx.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=40158&messageID=79820#79820


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Random IDs for form elements - Why?

Posted by Ted Husted <hu...@apache.org>.
Another issue with the id and name atttributes on the form tags is the
use of characters like "/" and "!". I find that these characters don't
work with a JavaScript like

onLoad="self.focus();document.Register_save.username.focus()"

With wildcard support, it will be natural for people to want to use
names like "Register/save" or "Register!save" as regular action names.
When generating tags in Struts 2, the forms should replace other
special characters with "_", so as to work with JavaScript.

We probably don't need to worry about this in WW2, since it doesn't
have wildcard support, but I should work up a patch for Struts 2.

-Ted.


On 8/14/06, tm jee <tm...@yahoo.co.uk> wrote:
> I've made the changes to both WebWork cvs head and Struts2 svn head.
>
> With this change, the submit button id (if can't be generated when name is not given, eg. when an action and / or method attribute is used) will be a running sequence number starting from 0.
>
> eg.
>
> <ww:form id="myFormId">
>      .....
>      <ww:submit action="execute1" value="Execute 1" />
>     <ww:submit action="execute2" value="Execute 2" />
> </ww:form>
>
> The id for both submit button will be 'myFormId_0' and 'myFormId_1' respectively, unique to within the form they are contained in. The Submit should be used within a form for it to be able to have a unique id .
>
>
> rgds
>
>
>
>
>
>
> ----- Original Message ----
> From: tm jee <tm...@yahoo.co.uk>
> To: Struts Developers List <de...@struts.apache.org>
> Sent: Monday, 14 August, 2006 10:19:00 AM
> Subject: Re: Random IDs for form elements - Why?
>
> > Any chance you can make the change in WebWork 2.2.3 too before the release?
> Yup, definitely. :-)
>
> rgds
>
> ----- Original Message ----
> From: Patrick Lightbody <fo...@opensymphony.com>
> To: dev@struts.apache.org
> Sent: Monday, 14 August, 2006 8:12:48 AM
> Subject: Re: Random IDs for form elements - Why?
>
> We should give them unique sequence IDs for each form. We should never encourage random numbers - that makes things much harder to automate for testing, which has always been a strong point for WebWork.
>
> Any chance you can make the change in WebWork 2.2.3 too before the release?
> ---------------------------------------------------------------------
> Posted via Jive Forums
> http://forums.opensymphony.com/thread.jspa?threadID=40158&messageID=79909#79909
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
>
>
>
>
>
>
>
>
>


-- 
HTH, Ted.
* http://www.husted.com/struts/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Random IDs for form elements - Why?

Posted by tm jee <tm...@yahoo.co.uk>.
Thx. Actually, I am just fixing what I kindof screw up in the first place.... hopefully things are ok now. 

----- Original Message ----
From: Patrick Lightbody <fo...@opensymphony.com>
To: dev@struts.apache.org
Sent: Monday, 14 August, 2006 1:58:56 PM
Subject: Re: Random IDs for form elements - Why?

Awesome work, Toby!
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=40158&messageID=79981#79981


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org






Re: Random IDs for form elements - Why?

Posted by Patrick Lightbody <fo...@opensymphony.com>.
Awesome work, Toby!
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=40158&messageID=79981#79981


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Random IDs for form elements - Why?

Posted by tm jee <tm...@yahoo.co.uk>.
I've made the changes to both WebWork cvs head and Struts2 svn head. 

With this change, the submit button id (if can't be generated when name is not given, eg. when an action and / or method attribute is used) will be a running sequence number starting from 0.

eg.

<ww:form id="myFormId">
     .....
     <ww:submit action="execute1" value="Execute 1" />
    <ww:submit action="execute2" value="Execute 2" />
</ww:form>

The id for both submit button will be 'myFormId_0' and 'myFormId_1' respectively, unique to within the form they are contained in. The Submit should be used within a form for it to be able to have a unique id .


rgds



 


----- Original Message ----
From: tm jee <tm...@yahoo.co.uk>
To: Struts Developers List <de...@struts.apache.org>
Sent: Monday, 14 August, 2006 10:19:00 AM
Subject: Re: Random IDs for form elements - Why?

> Any chance you can make the change in WebWork 2.2.3 too before the release?
Yup, definitely. :-)

rgds

----- Original Message ----
From: Patrick Lightbody <fo...@opensymphony.com>
To: dev@struts.apache.org
Sent: Monday, 14 August, 2006 8:12:48 AM
Subject: Re: Random IDs for form elements - Why?

We should give them unique sequence IDs for each form. We should never encourage random numbers - that makes things much harder to automate for testing, which has always been a strong point for WebWork.

Any chance you can make the change in WebWork 2.2.3 too before the release?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=40158&messageID=79909#79909


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org










Re: Random IDs for form elements - Why?

Posted by tm jee <tm...@yahoo.co.uk>.
> Any chance you can make the change in WebWork 2.2.3 too before the release?
Yup, definitely. :-)

rgds

----- Original Message ----
From: Patrick Lightbody <fo...@opensymphony.com>
To: dev@struts.apache.org
Sent: Monday, 14 August, 2006 8:12:48 AM
Subject: Re: Random IDs for form elements - Why?

We should give them unique sequence IDs for each form. We should never encourage random numbers - that makes things much harder to automate for testing, which has always been a strong point for WebWork.

Any chance you can make the change in WebWork 2.2.3 too before the release?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=40158&messageID=79909#79909


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org






Re: Random IDs for form elements - Why?

Posted by Patrick Lightbody <fo...@opensymphony.com>.
We should give them unique sequence IDs for each form. We should never encourage random numbers - that makes things much harder to automate for testing, which has always been a strong point for WebWork.

Any chance you can make the change in WebWork 2.2.3 too before the release?
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=40158&messageID=79909#79909


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Random IDs for form elements - Why?

Posted by tm_jee <fo...@opensymphony.com>.
> What is FormButton.java? Is that new? 
No it's not new. Its the parent of Submit, abstracting the code generating the type of button i guess.

> Why are we rendering random numbers? Why not something more predictable, such as 
> a sequence that starts at zero on every page load? 
This is due to 

[code]
  <ww:form id="formId">
     <ww:submit value="Submit 1" />
     <ww:submit value="Submit 2" />
  </ww:form>
[/code]

would generate both submit button having id of "formId_". I guess having a sequential number would be a better alternatives.

thoughts?

rgds
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=40158&messageID=79819#79819


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org