Re: Javascript getElementById Issues [update]

2005-01-28 Thread Sean Schofield
Just wanted to let everyone know that I have implemented a "forceId" attribute on the MyFaces extended components. This allows you to specify the id to be used for the elements and ignores the wacky JSF version of the tag. It also adds a '[row index]' suffix to elements inside dataTable (like St

Re: Javascript getElementById Issues

2005-01-04 Thread Sean Schofield
> ...I am glad someone else raised this issue, it was quite a disappointment > to have to > write our javascript differently than we have been doing for the last few > years. I knew I was not alone! I think there is enough momentum to go forward with the fix I was proposing. Heath is already w

RE: Javascript getElementById Issues

2005-01-04 Thread Cote . Mark
Title: RE: Javascript getElementById Issues I raised this issue a while back in a previous thread, because our current application contains a lot of _javascript_ and dhtml. There were no real solutions proposed so we had to write some really evil code in order to attain dynamic elements in a

Re: Javascript getElementById Issues

2005-01-04 Thread Heath Borders
Both #2 and #3 will provide solutions to this problem. For #2, you can just give all the components you need the proper styleIds and then you can access them from wherever you want. For #3, you have to pass all of the components as parameters to the tag, but you can still pass in as many as you'

Re: Javascript getElementById Issues

2005-01-04 Thread Ray Clark
I haven't had time to fully catch up on this thread, so I hope I am not stating something that has already been said.   My problem/concern about any _javascript_ solution is cross field _javascript_.  I need the ability with any of these solutions to manipulate a different element from the one that

Re: Javascript getElementById Issues

2005-01-03 Thread Sean Schofield
> The whole point of using something like > JSF is that you are moving away from writing direct html code. In the long > run, every single thing on your page should be a JSF component, including > the script portions. I don't see myself writing all of my javascript via components anytime soon.

Re: Javascript getElementById Issues

2005-01-03 Thread Travis Reeder
Sean Schofield wrote: moving your web-application from one framework to another though will always include some handling of _javascript_/html, so I wouldn't weigh that in too much. I'm not so sure about that. Maybe you change a few pieces of _javascript_ (like when switchin

Re: Javascript getElementById Issues

2005-01-03 Thread Travis Reeder
+1 Heath Borders wrote: Its clear that there are two different ways that we could possibly need better id support, and that's why we should develop #2 and #3 together. #2 supports legacy code. #3 supports new code. #1 (do nothing) can obviously still exist. If people want to totally ign

Re: Javascript getElementById Issues

2005-01-03 Thread Sean Schofield
> Consider the case in which I want to create a set of JSF components that > essentially wrap the widgets from an existing JavaScript framework, to > make them easier to use in a JSF environment. The JavaScript framework > almost certainly wants a great deal of control over the resulting HTML. > Ch

Re: Javascript getElementById Issues

2005-01-03 Thread Heath Borders
Its clear that there are two different ways that we could possibly need better id support, and that's why we should develop #2 and #3 together. #2 supports legacy code. #3 supports new code. #1 (do nothing) can obviously still exist. If people want to totally ignore these features, that's fine.

Re: Javascript getElementById Issues

2005-01-03 Thread Martin Cooper
On Mon, 3 Jan 2005, Martin Marinschek wrote: well, what I meant is that in fact the html is almost completely generated in the JSF case, so there usually is so much change in the structure and layout of the HTML code that you almost certainly need to rewrite large portions of your javascript anywa

Re: Javascript getElementById Issues

2005-01-03 Thread Martin Marinschek
well, what I meant is that in fact the html is almost completely generated in the JSF case, so there usually is so much change in the structure and layout of the HTML code that you almost certainly need to rewrite large portions of your javascript anyways; fine though if that is not true in your ca

Re: Javascript getElementById Issues

2005-01-03 Thread Sean Schofield
> moving your web-application from one framework to another though will > always include some handling of javascript/html, so I wouldn't weigh > that in too much. I'm not so sure about that. Maybe you change a few pieces of javascript (like when switching to Struts maybe you open a window with f

Re: Javascript getElementById Issues

2005-01-03 Thread Sean Schofield
> an easy solution for 2: > > In fact you can always use the id - if you set the id of the naming > containers, you know what your client-id will look like - and you can > easily change your javascript functions to use that (I admit a little > longer) id. I don't think your solution addresses som

Re: Javascript getElementById Issues

2005-01-03 Thread Martin Marinschek
As to the three proposals: I personally would deliver both 2 and 3, the proposal number 2 does have problems though, Craig has pointed them out... an easy solution for 2: In fact you can always use the id - if you set the id of the naming containers, you know what your client-id will look like -

Re: Javascript getElementById Issues

2005-01-02 Thread Heath Borders
The doesn't HAVE to drop variables into the global namespace. It depends upon how it is used. In the example I gave, there are two affected namespaces: that of the tag and that of the enableOrNot() function. Of course, the tag is powerful enough to allow for additions to the global namespace

Re: Javascript getElementById Issues

2005-01-02 Thread Martin Cooper
On Sun, 2 Jan 2005, Sean Schofield wrote: What the tag would have to do is search its body content for ids specified in the tag and replace them with the clientId's of the components specified in the 's "for" attribute. Thoughts? I'm personally not too wild about this. Why do we want to subject

Re: Javascript getElementById Issues

2005-01-02 Thread Sean Schofield
> As for difficulties, it seems like #3 would be vastly easier to code > (I might even do it tomorrow at work), as opposed to #2. Maybe I was missing something then. I will re-examine your idea tomorrow when I am less tired. > I don't see this as an either-or problem. Both ways can coexist pea

Re: Javascript getElementById Issues

2005-01-02 Thread Heath Borders
#3 is just a possibility I came up with recently, so I thought I'd put it out there. I think I like #3 the best because I don't have any legacy javascript that I am worried about including. Most of the javascript i'm developing is very lightweight interactions between components as I described in

Re: Javascript getElementById Issues

2005-01-02 Thread Sean Schofield
> What the tag would have to do is search its body content > for ids specified in the tag and replace them with > the clientId's of the components specified in the > 's "for" attribute. > > Thoughts? I'm personally not too wild about this. Why do we want to subject the user to all of this extr

Re: Javascript getElementById Issues

2005-01-02 Thread Heath Borders
I'll have to wait until monday to get an answer on where exactly the convertClientId method is used. As for the interface: For HTML, we have to ensure that all clientIds are unique. This is achieved through the spec by requiring that all id's are unique under a namincontainer, and all clientIds

Re: Javascript getElementById Issues

2005-01-02 Thread Sean Schofield
> All renderers have a method "convertClientId" which we could override > in our renderers to output whatever clientId we want. I was just wondering about this method in the Renderer interface... When exactly is this called? I couldn't find anything substantial about it in the spec. It seems li

Re: Javascript getElementById Issues

2005-01-02 Thread Heath Borders
With regards to javascript, here is an extended solution: Let's say you have the following JSP code: Now, obviously, if the user initially enters the page and the checkbox is unchecked, the inputText will be disabled. If they check the box, we would ideally like the input to be enabled with cl

Re: Javascript getElementById Issues

2005-01-02 Thread Heath Borders
Yes, I was aware of the no-duplicate id dependency. That's why I was saying that we would want to register styleId's with the view to ensure that we don't have duplicates. Obviously, if you defined a styleId on a component in a UIData, it would have to fail for the same reason that defining an id

Re: Javascript getElementById Issues

2005-01-02 Thread Sean Schofield
> If you're hard coding them today, what stops you (like you, ignoring > the repeating case) from hard coding the JSF-generated values? They > are perfectly predictable if you use "id" elements on the form and the > input field itself. While its true that these elements are predictable, I think t

Re: Javascript getElementById Issues

2005-01-02 Thread Sean Schofield
> I'm in favor of doing this, though I don't think I'll have much time > at work to dedicate to it since we're not really aching for the > change. If I get some time, I'll try to do something, but I can't > really commit to it. OK. I've spent a few days looking over things in more detail. I wou

Re: Javascript getElementById Issues

2005-01-02 Thread Craig McClanahan
On Sun, 2 Jan 2005 18:04:27 -0500, Sean Schofield <[EMAIL PROTECTED]> wrote: > > Actually, there *is* an important server side use of the clientId > > value -- it also becomes the name of the request parameter used to > > decode the values of submitted input fields. Indeed, this is why the > > dec

Re: Javascript getElementById Issues

2005-01-02 Thread Travis Reeder
I'm wondering if there's a way we could make an tag that would make available certain components that we want to use in _javascript_ for example: You have an inputText you want to be able to access: Then you use the x:script like so: function foo(){    myInput.value = "xyz"; } And x:scri

Re: Javascript getElementById Issues

2005-01-02 Thread Sean Schofield
> Actually, there *is* an important server side use of the clientId > value -- it also becomes the name of the request parameter used to > decode the values of submitted input fields. Indeed, this is why the > decode and encode functionality was merged into a single API > (Renderer) -- only the co

Re: Javascript getElementById Issues

2005-01-02 Thread Craig McClanahan
On Sat, 1 Jan 2005 10:56:40 -0600, Heath Borders <[EMAIL PROTECTED]> wrote: > No, it is only used for uniqueness on the client-side. Component tree > doesn't require unique id's. Id's must only be unique beneath a given > NamingContainer. Actually, there *is* an important server side use of the

Re: Javascript getElementById Issues

2005-01-01 Thread Martin Marinschek
I believe almost all components are available in an extended version (due to several enhancements in MyFaces), so that shouldn't be to big a problem. regards, Martin On Sat, 1 Jan 2005 13:01:32 -0500, Sean Schofield <[EMAIL PROTECTED]> wrote: > > Yes, Myfaces would still be following the spec f

Re: Javascript getElementById Issues

2005-01-01 Thread Sean Schofield
> Yes, Myfaces would still be following the spec for the behavior of > components if we did this. However, we could only do this on our > extended component set, rather than the default set of components. > This is because the components under the javax.faces.component.html > package are part of

Re: Javascript getElementById Issues

2005-01-01 Thread Heath Borders
I think its called styleId because the html "id" attribute was originally used for CSS, not just to uniquely identify an element. Yes, Myfaces would still be following the spec for the behavior of components if we did this. However, we could only do this on our extended component set, rather tha

Re: Javascript getElementById Issues

2005-01-01 Thread Ray Clark
I always found styleId confusing also.  But for myFaces it can't be id, it has to be something else, so styleId makes sense.  This is a fantastic idea.   Also, implementing the tag and the tag are great ideas as well.   Thanks all, RaySean Schofield <[EMAIL PROTECTED]> wrote: > No, it is only use

Re: Javascript getElementById Issues

2005-01-01 Thread Sean Schofield
> No, it is only used for uniqueness on the client-side. Component tree > doesn't require unique id's. Id's must only be unique beneath a given > NamingContainer. So if MyFaces were to continue to generate this guaranteed unique id by default it would still be observing the spec right? This wou

Re: Javascript getElementById Issues

2005-01-01 Thread Heath Borders
No, it is only used for uniqueness on the client-side. Component tree doesn't require unique id's. Id's must only be unique beneath a given NamingContainer. On Sat, 1 Jan 2005 06:31:12 -0800 (PST), Ray Clark <[EMAIL PROTECTED]> wrote: > Is the clientId in the component used for anything > other

Re: Javascript getElementById Issues

2005-01-01 Thread Ray Clark
Is the clientId in the component used for anything other than generating uniqueness for the client side tag? Is it used on the server side in the processing of the component tree? Thanks, Ray --- Heath Borders <[EMAIL PROTECTED]> wrote: > I'm in favor of doing this, though I don't think > I'll

Re: Javascript getElementById Issues

2004-12-31 Thread Heath Borders
I'm in favor of doing this, though I don't think I'll have much time at work to dedicate to it since we're not really aching for the change. If I get some time, I'll try to do something, but I can't really commit to it. On Fri, 31 Dec 2004 11:59:15 -0800, Craig McClanahan <[EMAIL PROTECTED]> wro

Re: Javascript getElementById Issues

2004-12-31 Thread Craig McClanahan
If you wanted to be more familiar to Struts users, you might consider using "styleId" instead ... that's the attribute all the Struts HTML tags use to specify the "id" attribute to be emitted. Craig On Fri, 31 Dec 2004 14:47:55 -0500, Sean Schofield <[EMAIL PROTECTED]> wrote: > > A possible sol

Re: Javascript getElementById Issues

2004-12-31 Thread Sean Schofield
> A possible solution would be to implement direct id's (that is any id > specified in the JSP translates into the same client id) in the > MyFaces extended components. > > We could provide a separate attribute on all extended components > called "directId". If specified, directId would be both t

Re: Javascript getElementById Issues

2004-12-30 Thread Heath Borders
A possible solution would be to implement direct id's (that is any id specified in the JSP translates into the same client id) in the MyFaces extended components. We could provide a separate attribute on all extended components called "directId". If specified, directId would be both the id and th

Re: Javascript getElementById Issues

2004-12-30 Thread Craig McClanahan
On Thu, 30 Dec 2004 09:51:49 -0500, Sean Schofield <[EMAIL PROTECTED]> wrote: > A major stumbling block for me with JSF is how the implementations all > seem to "munge" the id attributes of my JSF tags. I'm assuming this > helps with constructing the component tree and mapping the posts to > the r

Re: Javascript getElementById Issues

2004-12-30 Thread Werner Punz
I am not a myfaces developer but ran into the id issue today due to the fact that I tried to implement a custom control. I dont thing the myfaces should introduce its own standard unless it does not break the specs (isn't the id naming scheme defined in the specs) What I could see probably, and tha

Re: Javascript getElementById Issues

2004-12-30 Thread Sean Schofield
> Could we not come up with our own standard for myfaces for the time being? > And hopefully the JCP will follow suit or at least make for an easy > transition. This is such an essential thing these days especially with > everyone seeing what Google is doing lately. That would be my vote. I wou

Re: Javascript getElementById Issues

2004-12-30 Thread Travis Reeder
Could we not come up with our own standard for myfaces for the time being?  And hopefully the JCP will follow suit or at least make for an easy transition.  This is such an essential thing these days especially with everyone seeing what Google is doing lately. Travis Matthias Wessendorf wrote

Re: Javascript getElementById Issues

2004-12-30 Thread Sean Schofield
On Thu, 30 Dec 2004 12:04:39 -0500, Sean Schofield <[EMAIL PROTECTED]> wrote: > > There needs to be a better way than that. Every decent JavaScript library > > out there uses getElementById() to manipulate elements and allow people to > > build dynamic web apps. A "solution" that requires either wr

RE: Javascript getElementById Issues

2004-12-30 Thread Matthias Wessendorf
[EMAIL PROTECTED] > Cc: Sean Schofield > Subject: Re: Javascript getElementById Issues > > > There needs to be a better way than that. Every decent > JavaScript library > out there uses getElementById() to manipulate elements and > allow people to > build dynamic

Re: Javascript getElementById Issues

2004-12-30 Thread Martin Cooper
There needs to be a better way than that. Every decent JavaScript library out there uses getElementById() to manipulate elements and allow people to build dynamic web apps. A "solution" that requires either wrapping every component usage in a proxy tag or overriding all of the components isn't

Re: Javascript getElementById Issues

2004-12-30 Thread Heath Borders
It really becomes a problem when you start using dataTables extensively in your applications. Since JSF is iterating over the content, you can't exactly specify an id for it (it would always be the same!). My suggestion is to use j4j's proxyId tag. It basically allows you to define a clientId.

Javascript getElementById Issues

2004-12-30 Thread Sean Schofield
A major stumbling block for me with JSF is how the implementations all seem to "munge" the id attributes of my JSF tags. I'm assuming this helps with constructing the component tree and mapping the posts to the right components, but does it have to be this way? Both MyFaces and the RI change the