Re: MarkupId generation [SOLVED]

2011-02-06 Thread Uwe Schäfer

On 02/06/2011 05:51 AM, msj121 wrote:


I see, well I am happy I could help, and it sounds like you have quite an
interesting project.


humm, indeed ;)

just to let everyone know:
adding this to application init works nicely:

addComponentInstantiationListener(new IComponentInstantiationListener(){
public void onInstantiation(final Component arg0){
arg0.setMarkupId(this.prefix + arg0.getMarkupId());
}
});

thanks again, uwe

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: MarkupId generation

2011-02-05 Thread msj121

I see, well I am happy I could help, and it sounds like you have quite an
interesting project.

Good Luck,
  Matthew

Uwe Schäfer-2 wrote:
> 
> On 02/04/2011 09:07 PM, msj121 wrote:
> 
>> You could have an automatic listener that takes the "getMarkupId(...)"
>> and
>> preppend, or append to the id, or do it by hand (not my favourite
>> choice).
> 
> good idea. i´ll try just setMarkupId(prefix+getMarkupId()) with an 
> IComponentInstantiationListener.
> 
>> Perhaps, you can change the non-wicket ids? would that help? I am not
>> sure
>> why there would be collisions, could you explain more?
> 
> the point is that the functional benefits of the wicket app are supposed 
> to be included in a third-party-web-page with only a script tag (just 
> like banners normally do).
> therefore i have no control over the ids already used in the page, that 
> the wicket app is supposed to be included in.
> 
>  > Perhaps there is a
>  > more elegant solution, without using wicket
> 
> believe me, i tried. what is to be included has quite some conversation 
> & state, so that doing all this ajaxy stuff with just bare-knuckle 
> servlets & jQuery is so incredibly hard to do, that i came back to 
> wicket after almost 2 days, i now deeply regret ;)
> 
> thanks, uwe
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/MarkupId-generation-tp3258525p3262558.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: MarkupId generation

2011-02-05 Thread Uwe Schäfer

On 02/04/2011 09:07 PM, msj121 wrote:


You could have an automatic listener that takes the "getMarkupId(...)" and
preppend, or append to the id, or do it by hand (not my favourite choice).


good idea. i´ll try just setMarkupId(prefix+getMarkupId()) with an 
IComponentInstantiationListener.



Perhaps, you can change the non-wicket ids? would that help? I am not sure
why there would be collisions, could you explain more?


the point is that the functional benefits of the wicket app are supposed 
to be included in a third-party-web-page with only a script tag (just 
like banners normally do).
therefore i have no control over the ids already used in the page, that 
the wicket app is supposed to be included in.


> Perhaps there is a
> more elegant solution, without using wicket

believe me, i tried. what is to be included has quite some conversation 
& state, so that doing all this ajaxy stuff with just bare-knuckle 
servlets & jQuery is so incredibly hard to do, that i came back to 
wicket after almost 2 days, i now deeply regret ;)


thanks, uwe


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: MarkupId generation

2011-02-04 Thread msj121

True, perhaps using ".setMarkupId("someid");". I had no idea about that in
production mode, I guess I never checked, I am still somewhat surprised that
is true.

You could have an automatic listener that takes the "getMarkupId(...)" and
preppend, or append to the id, or do it by hand (not my favourite choice).

Perhaps, you can change the non-wicket ids? would that help? I am not sure
why there would be collisions, could you explain more? Perhaps there is a
more elegant solution, without using wicket 

Matthew


Uwe Schäfer-2 wrote:
> 
> On 02/04/2011 05:02 AM, msj121 wrote:
>> Well I think that all of the markup ids being output are based off of the
>>   in "wicket:id=". If memory serves correct so the "easiest"
>> (ie:
>> less obtrusive) solution is to simply change your tags.
> 
> this is only true for development mode. in deployment, id generation 
> differs (it generates "id1","id2"...)
> 
>> Of course tedious if
>> you already had completed your project, so perhaps overriding the code
>> that
>> generates the markup id. Not sure, but an interesting question.
> 
> overriding is not an option due to this method being on Component. i do 
> not want to use "own" components in my code. imagine smth like
> add(new TextField(...){
>   public String getMarkupId(boolean create){
>...
>}
> });
> 
> yuck ;)
> 
> cu uwe
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/MarkupId-generation-tp3258525p3260937.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: MarkupId generation

2011-02-04 Thread Uwe Schäfer

On 02/04/2011 05:02 AM, msj121 wrote:

Well I think that all of the markup ids being output are based off of the
  in "wicket:id=". If memory serves correct so the "easiest" (ie:
less obtrusive) solution is to simply change your tags.


this is only true for development mode. in deployment, id generation 
differs (it generates "id1","id2"...)



Of course tedious if
you already had completed your project, so perhaps overriding the code that
generates the markup id. Not sure, but an interesting question.


overriding is not an option due to this method being on Component. i do 
not want to use "own" components in my code. imagine smth like

add(new TextField(...){
 public String getMarkupId(boolean create){
  ...
  }
});

yuck ;)

cu uwe

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: MarkupId generation

2011-02-03 Thread msj121

Well I think that all of the markup ids being output are based off of the
 in "wicket:id=". If memory serves correct so the "easiest" (ie:
less obtrusive) solution is to simply change your tags. Of course tedious if
you already had completed your project, so perhaps overriding the code that
generates the markup id. Not sure, but an interesting question.

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/MarkupId-generation-tp3258525p3259445.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org