Igor Vaynberg wrote:
>
> also i tried wrapping tr and td in divs/spans and that did not help at 
> all either. i wish you better luck, it would be great to have a 
> solution for this but im not holding my breath.
>
I have a work around,  Its not quite as elegant as directly updating the 
TR element though.


I used the dojo publish/subscribe event framework.  I created a 
EventBehavior, somewhat similiar to the existing AjaxEventBehavior.  It 
allows me to add a onClick() event to each TR element/Item of my table, 
that publishes a message using dojo.event.topic.publish(..,..,..) with 
the row number.


I then extended AbstractDefaultAjaxBehavior to call 
dojo.event.topic.subscribe during the onload() event of the page.  I 
register the getCallbackScript with the dojo subscribe method to update 
the component that I added the Behavior to.  I also pass the row index 
from the publish message as a parameter in the callback url.  Once the 
callback is made I first pull out the selected row index from the url 
parameter, and then update the table.


It seems to work fine on Firefox and IE6, and solves the problem of 
having duplicate rows appearing to be selected, since all the TR 
elements are getting updated with the callback.  Hopefully this is 
helpful to someone.



-Lorin


>
> On 8/11/06, *Pierre-Yves Saumont* <[EMAIL PROTECTED] <mailto:[EMAIL 
> PROTECTED]>> 
> wrote:
>
>     Hi Lorin,
>
>     Quoting Igor :
>
>     "you cannot update tr/tbody/etc tags via outerhtml "
>
>     (see
>     
> http://www.nabble.com/Ajax-Submit-default-to-Non-Ajax-Submit---tf2081101.html#a5751334
>     
> <http://www.nabble.com/Ajax-Submit-default-to-Non-Ajax-Submit---tf2081101.html#a5751334>)
>
>     I had a similar problem with TBODY. Although it was supposed not to
>     work, it worked in Firefox, but not in IE6 (which was quite
>     confusing).
>     For me, the solution was to use the whole table as a target or
>     wrap it
>     in another container and use that lat one as teh target. Perhaps you
>     could wrap the row content in a container. (I do not know if this
>     would
>     cause problem in HTML) Alternatively, you could wrap each TD
>     content in
>     a SPAN or DIV and add each one to the target.
>
>     I am working myself on such an example (a table where you can for
>     example select a row, drag it between others to reorder and drag
>     it on a
>     dustbin icon to delete it, and so on, but I have not yet reach
>     that point !)
>
>     Pierre-Yves
>
>     Lorin Metzger a écrit :
>     > Hi,
>     >
>     >
>     > I was trying to create a DataTable that allowed row selection,
>     by adding
>     > a AjaxEventBehavior to the Item of a DataTable.    This works
>     fine with
>     > Firefox 1.5, but I'm having problems with IE6.   The onEvent()
>     method
>     > gets called when the user clicks a row in the table, but calling
>     > AjaxRequestTarget.addComponent(item); does not cause the table
>     item to
>     > be updated to indicate that it has been selected in IE6.  
>     Similarly as
>     > a test calling AjaxRequestTarget.addJavascript("alert(\"This is a
>     > javascript Alert\")"); Does not get executed in IE6.
>     >
>     >
>     > This only seems to apply to the table Item or <TR> element, in
>     IE6.  I
>     > can add a AjaxEventBehavior to the table itself, and the table gets
>     > updated when addComponent() is called, and the addJavascript("")
>     gets
>     > executed as expected even in IE6.
>     >
>     >
>     > Does anybody know if this is a limitation with IE6?
>     >
>     >
>     > A crude example of what I'm trying do is shown below.
>     >
>     >
>     > Thanks for any help you can provide.
>     >
>     >
>     > int selected_row = -1;
>     > DataTable table = new DataTable(..., ..., ..., ...)
>     > {
>     >     protected Item newRowItem(String id, final int index, IModel
>     model)
>     >     {
>     >          final Item item = super.newRowItem(id, index, model);
>     >          item.add(new AjaxEventBehavior("onclick")
>     >          {
>     >               protected void onEvent(AjaxRequestTarget target)
>     >               {
>     >                    selected_row = index;
>     >                    target.addComponent(item);
>     >                }
>     >          };
>     >          item.add(new SimpleAttributeModifier("class", "selected")
>     >          {
>     >             public boolean isEnabled()
>     >             {
>     >                  return index == selected_index;
>     >             }
>     >          };
>     >      }
>     > };
>     >
>     >
>     >
>     >
>     > -Lorin
>     >
>     >
>     -------------------------------------------------------------------------
>     > Using Tomcat but need to do more? Need to support web services,
>     security?
>     > Get stuff done quickly with pre-integrated technology to make
>     your job easier
>     > Download IBM WebSphere Application Server v.1.0.1 based on
>     Apache Geronimo
>     >
>     http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>     <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>     > _______________________________________________
>     > Wicket-user mailing list
>     > Wicket-user@lists.sourceforge.net
>     <mailto:Wicket-user@lists.sourceforge.net>
>     > https://lists.sourceforge.net/lists/listinfo/wicket-user
>     >
>     >
>     >
>
>
>     -------------------------------------------------------------------------
>     Using Tomcat but need to do more? Need to support web services,
>     security?
>     Get stuff done quickly with pre-integrated technology to make your
>     job easier
>     Download IBM WebSphere Application Server v.1.0.1 based on Apache
>     Geronimo
>     http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>     <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>     _______________________________________________
>     Wicket-user mailing list
>     Wicket-user@lists.sourceforge.net
>     <mailto:Wicket-user@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ------------------------------------------------------------------------
>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>   


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to