OK, this may not be of interest to anyone, but I modified iui.js so
that, when you use target="_replace", you need to give the element you
want to replace the id ="_replace". If the id of the link itself is
"_replace", it will replace the link as it does now; however, if you
assign the id to another element, it will replace that element
instead.

I'm not the greatest of javascript authors, and there is probably a
much better way than to do this than what I did, but it seems to work.

Under the appropriate addEventListener("click", function(event), I
added another param to link.target == "_replace" like this


        else if (link.target == "_replace")
        {
            link.setAttribute("selected", "progress");
            iui.showPageByHref(link.href, null, null, link, unselect,
link.target );
        }

It's the last param link.target which is passed to showPageByHref:
function(href, args, method, replace, targElem).
The link.target is mapped to targElem and is passed to the function
replaceElementWithSource(replace, req.responseText, targElem)

Then I modified replaceElementWithSource thusly:

Instead of
var frag = document.createElement(parent.localName);
It's now
var frag = document.getElementById(targElem);


If anyone wants to chime in with a better way to do this, by all means
do so.



On Nov 9, 3:42 pm, Peter Blazejewicz <[EMAIL PROTECTED]>
wrote:
> hi,
>
> you can freely modify iUI.js source and method which does that replace
> so it will accept unique element instaed of serachable div with
> _replace data (it if works fine you can consider adding that different
> implementation to iUI source as patch so others can benefit from it),
> that way you can load data in background to fill your content (portlet
> like page) I think,
>
> regards,
> Peter
> On Nov 8, 6:19 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > How can I use/modify a link with target="_replace" so that the replace
> > target is another element instead of the link element itself? In other
> > words, when the user clicks the link, I'd like to replace the contents
> > of another element that has a unique id instead of the link. Does iUI
> > have a provision for this in place already?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to