Because if it is specified in the markup (the cssid or _javascript_id) then we need to get that one
that is the id of onComponentTag:
cssId = (String)tag.getAttributes().get("id");
if(Strings.isEmpty(cssId))
{
cssId = getCssId();
tag.put("id", cssId);
}
i can't just override that id with a generated one. That generated one is purely a backup if the markup didn't specify one.
The problem is currently that the cssid is only valid after the first render.
Because only then the form knows what id's it could have.
I think 100 is on the safeside but we could remove it if nessesary.
For example if it is deeply nested then only one or 2 parents would already work
Because the ListView, Listitems would then be a parent of the form and that would already be 0:formname 1:formname
So that wouldn't be a problem.
But we could just use getPageRelativePath() this was more a copy of getInputName() of FormComponent
The problem is that i don't like those very long names because pda browser have a real problem with that.
Thats why we have getInputName() in formcomponent.
johan
On 11/25/05, Laurent PETIT <[EMAIL PROTECTED]> wrote:
On 11/25/05, Johan Compagner <[EMAIL PROTECTED]> wrote:
> cssid is something completely internal. And i hope that the current limiting
> factor (that you have to render it first one time)
May I ask 2 questions :
- What does the cssId name mean ? Because css already means something
very concrete to me (cascading style sheet), but I'm almost certain it
is not the intended meaning in cssId ?
- What is the reason for having almost reimplemented the
getPageRelativePath() algorithm in the getCssId() method (except the
fact that you truncate the Id when it is more than 100 characters,
which I considerer a little bit dangerous, because you could have
sibling forms included in a ListView deep in the Component hierarchy,
then resulting, with the truncation, in duplicate ids form the form).
I would suggest (if I understand the things well), the following for
the getCssId() method :
protected final String getCssId()
{
return getPageRelativePath();
}
and get rid of the cssId field as well ?
Oh, and also maybe rename the field and method ? What about getId(),
or getDocumentId(), or getHtmlId(), or something like that ?
ids are concepts used throughout the XML format & variants, they have
primarily nothing to do with css ?
Hope I don't upset you with my remarks,
cu,
--
laurent
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
