You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jonathan O'Connor <Jo...@xcom.de> on 2005/03/30 15:47:06 UTC
Re: XTile: integrating XMLHttpRequest (aka Ajax) with Tapestry [ndc] [auf
Viren geprueft]
gvp, Yes, I just finished a find people page that uses XTile. The XTile
basics took me less than half an hour to get working. The hard part was
making sure I could modify a <select> tag and have the options seen back
inside my page.java.
Summary: XTile is easy. MultiplePropertySelection is hard to get working.
Points to note:
1. I wrote a tiny amount of JavaScript to add my options into the select
box:
function recvCompletions(arr) {
var comps = document.getElementById('comps');
comps.options.length = arr.length;
for (var i = 0; i < arr.length; i++) {
comps.options[i] = new Option(arr[i], i, false,
true);
}
}
Its easier to use document.getElementById to find the select box, than
using the DOM model. The reason is that I don't want to rely on how
Tapestry renders my code. Also, and more importantly, I don't care what's
in my border component.
2. Multi-selection is messy to implement. I used the following:
<select id="comps" jwcid="@Select" multiple="ognl:true" size="10">
<span jwcid="@Foreach" source="ognl:foundPeople" value=
"ognl:person">
<option jwcid="@Option" selected=
"ognl:selectedPerson" label="ognl:person.commonName"/>
</span>
</select>
And then I had to some rotten code to implement isSelectedPerson() and
setSelectedPerson(boolean).
Also, the foundPeople collection must be persistent. This is updated by
the XTile server listener. This allows the rewinding to work, and I get
the correctly selected items.
3. I tried contrib:MultiplePropertySelection, but the default rendering is
a table with 2 columns of checkboxes and labels for the options. I wanted
a select with options instead. So, I wrote my own renderer, but the
component wouldn't allow informal parameters. I created my own component
using the MultiplePropertySelection java class and marked it as allowing
informal params.
Next Problem: The renderer class could access the component, but the
renderInformalParameters() method is protected. Eventually, I copied the
AbstractComponent(?).renderInformalParameters into my renderer class. But
even reserving parameters, I can't stop it rendering all those component
specific properties (model, renderer, selectedList).
4. I finally gave up on MultiplePropertySelection when I was not getting
any selected values back from it. I have no idea why. Maybe the rendering
interface is not sufficient for my non table implementation.
This all leads me to think that MultiplePropertySelection needs a
redesign. I guess it should be like PropertySelection component, except it
should have a selectedValues param instead of value.
Anyway, as far as XTile goes, it's great! Thanks MindBridge.
Ciao,
Jonathan O'Connor
XCOM Dublin
gvp <bl...@gmail.com>
30/03/2005 13:31
Please respond to
"Tapestry users" <ta...@jakarta.apache.org>
To
"Tapestry users" <ta...@jakarta.apache.org>
cc
Subject
Re: XTile: integrating XMLHttpRequest (aka Ajax) with Tapestry [auf Viren
geprueft]
Hello All,
Has anybody tried to implement Google Suggest like component using
XTile? BTW I've found GS Dissected by C.Justus
http://serversideguy.blogspot.com/2004/12/google-suggest-dissected.html.
--
Best regards,
gvp
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org