Hi,

So the difference between getId() and getClientId() is that the last one
generates the Id if necessary, am I right?

>From my point of view getId() is the getter for the id property which can be
set with setId(). However, there is no method setClientId(). So I think the
sence is that getId() returns non-null if the user assigned an id to the
component and null otherwise, whereas getClientId() always returns a valid
id, because it generates one if the component has no assigned id.

So you are able to check if the user assigned an id to the component if the
result of getId() is non-null. Nevertheless I don't know if that makes a lot
of sence...

Regards,
Jakob

2010/2/9 Matthias Wessendorf <mat...@apache.org>

> Hi,
>
> Blake committed an interesting patch to Trinidad:
> http://bit.ly/dtghOs
>
> I see that MyFaces can actually return NULL on getId(), however the
> MyFaces implementation
> goes ahead and creates the ID if getClientId(facesCtx) is called AND!
> the getId() returns null.
>
> So, why not directly ensuring that getId() can't return null ?
>
> Checking the JavaDoc of getClientId(FacesCtx), I see that MyFaces is
> doing what is required.
> But does that really make sense?
>
> -Matthias
>
> --
> Matthias Wessendorf
>
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> twitter: http://twitter.com/mwessendorf
>

Reply via email to