Christian's solution seems to work is now implemented and can be found
in contrib-dojo HEAD. Sorry for the delay, we are having some problems
with our example application.
Marco
Igor Vaynberg wrote:
this is what i was going to suggest also but Christian beat me to it.
with my solution every component in the hierarchy would have to use it
otherwise any component not using it would break it for everything
upstream. not worth it unless we are willing to change the way we
create components - doing intiialization in an init() method as
opposed to the constructor. it was an idea to fix the more general
problems, but for this specific one the Model in attr modifier will be
just fine.
-Igor
On 12/8/05, *Christian Essl* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Maybe you can use for the AttributeModifiers a model which calcs
the url
value on rendering:
In FXValidationAjaxHandler.onBind():
add(new AttributeModifier(eventName,true,new Model(){
getObject(Comp co){
return .... + getCallBackURL() + ....;
}});
I think this than gets executed during rendering and than the
component
will be in the hierarchy.
Just my 2c.
Christian
On Thu, 08 Dec 2005 09:47:56 +0100, Marco van de Haar
<[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:
> To clarify the reason for the restriction, in order to make an
Ajax call
> to a component we need the component's Url
> (AjaxHandler.getCallBackUrl()). This method cannot be called
unless the
> component 'knows' it's page. (no page, no url...). Before the
> restriction the attributes were added in a way I think is incorrect
> (directly accessing the AttributeMap in stead of using
> AttributeModifiers) and incompatible with TextArea (AttributeMap is
> immutable). It did work with TextField, but don't ask me why.....
>
> I'm not completely familiar with wicket's internals, but I think
Igor's
> solution might work.
>
> Marco & Ruud
>
> Igor Vaynberg wrote:
>
>> ive ran into this myself a few times. especially when i need to
know a
>> path of the component in the constructor, but it has not been
added to
>> the hierarchy yet.
>>
>> what i was thinking is to add an void init() method to
component that
>> gets called after its been added to its parent component. that
way you
>> can create the hierarchy in that method instead of the constructor.
>>
>> this can also help with dependency injection because we can
initialize
>> the component before it initializes itself.
>>
>> i dont really know if this is a place we want to take wicket
because it
>> would make it a bit more managed.
>>
>> what do others think?
>>
>> -Igor
>>
>>
>>
>>
>>
>> On 12/7/05, *Ingram Chen* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
>> <mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>>
wrote:
>>
>> I tried 0.3.1 and found that new restriction is a really BIG
>> restriction.
>>
>> I have lots of panel which contains form:
>>
>> class MyPage extends WebPage {
>> public MyPage() {
>> add(new MyPanel("aPanelContainForm"));
>> }
>> }
>>
>> class MyPanel extends Panel {
>> public MyPanel(String id) {
>> Form form = new Form("form");
>> add(form);
>> TextField field = new TextField(...);
>> form.add(field);
>> field.add(new FXValidationAjaxHandler("onblur"));
>> }
>> }
>>
>> Although I can control adding FXValidationAjaxHandler after
the
>> FormComponent
>> added into component hierarchy. However, Page is still not
>> available for FXValidationAjaxHandler because MyPanel is
not added
>> into Page yet !
>>
>> no idea how to fix this.....
>>
>> On 12/7/05, *Marco van de Haar* < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
>> <mailto: [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>>> wrote:
>>
>> We have released 0.31 of the contrib-dojo package (well....
>> ok, Martijn
>> did). In this release our FXFeedbackIndicator works
when built
>> in a jar.
>> (yes... it was a lousy filename-case error). It also
has the
>> fixes
>> previously released in the SNAPSHOT release.
>>
>> so, feel free to check it out at
>> site:
>>
http://wicket-stuff.sourceforge.net/wicket-contrib-dojo/index.html
>> download:
>>
http://sourceforge.net/project/showfiles.php?group_id=134391&package_id=164293
<http://sourceforge.net/project/showfiles.php?group_id=134391&package_id=164293>
>> <
http://sourceforge.net/project/showfiles.php?group_id=134391&package_id=164293
<http://sourceforge.net/project/showfiles.php?group_id=134391&package_id=164293>>
>>
>>
>> Marco & Ruud
>>
>> p.s. Juergen, this should also fix the bug in our examples
>> package. So
>> you could use the War file in the new release for the
online
>> demo.
>>
>>
>> -------------------------------------------------------
>> 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_id=7637&alloc_id=16865&op=click
<http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click>
>> <
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
<http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click>>
>> _______________________________________________
>> Wicket-user mailing list
>> [email protected]
<mailto:[email protected]>
>> <mailto:[email protected]
<mailto:[email protected]>>
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
>>
>>
>>
>> -- Ingram Chen
>> Java [EMAIL PROTECTED]
>> Institue of BioMedical Sciences Academia Sinica Taiwan
>> blog: http://www.javaworld.com.tw/roller/page/ingramchen
>> <http://www.javaworld.com.tw/roller/page/ingramchen
<http://www.javaworld.com.tw/roller/page/ingramchen>>
>>
>>
>
>
>
> -------------------------------------------------------
> 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_id=7637&alloc_id=16865&op=click
<http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click>
> _______________________________________________
> Wicket-user mailing list
> [email protected]
<mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/wicket-user
--
Christian Essl
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier
anmelden: http://mail.yahoo.de
-------------------------------------------------------
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_id=7637&alloc_id=16865&op=click
<http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click>
_______________________________________________
Wicket-user mailing list
[email protected]
<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------
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_id=7637&alloc_id=16865&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user