Hi group,

I have a problem that may be the result of misunderstanding iui's
functionality. I use iui from within an existing rails application and
it works very well until it comes to display a lot of search results
using target="_replace" connected with Rail's build in pagination.

I'd like to display search results, that have collections of
attributes (description, recommendation, pickup, delivery ....) and I
have prebuild :partial's that belongt to every collection and that I
need to render within ul's so that they are addressable. Therefore I
have a view like that:

# only open ul for the first page, on following pages simply deliver
li's
<% if params[:page].nil? %>
        <ul id="home<%= params[:page] %>" title="results" selected="true">
<% end %>

# iterate over my search results and print one li per result
  <% for shipping in @shippings %>
    <li><a href="#<%= shipping.id %>"><%= h(shipping.title) %></a></
li>
  <% end %>

# bottom follows my paginated link that delivers next 5 results using
exactly that same template rails style
    <li><%= link_to 'Next Five ...', { :page =>
@shipping_pages.current.next },  :target => "_replace" if
@shipping_pages.current.next %></li>

# and I close the ul
  </ul id="duffyduck">

# every result has collections of attributes and one :partial per
collection, so I'd like to load and link them
        <% for shipping in @shippings %>
             <ul id="<%= shipping.id %>" title="<%= h(shipping.title) %>">
                        <li><a href="#<%= 'desc'+shipping.id.to_s 
%>">Beschreibung</a></
li>
                        <li><a href="#<%= 'recom'+shipping.id.to_s 
%>">Anforderungen</a></
li>
                        <li><a href="#<%= 'pickup'+shipping.id.to_s 
%>">Abholung</a></li>
                        <li><a href="#<%= 'delivery'+shipping.id.to_s 
%>">Auslieferung</a></
li>
                </ul>
        <% end %>

# and now for every collection (desc in that case) I print out the
fitting :partial
        <% for @shipping in @shippings %>
                <ul id="<%= 'desc'[EMAIL PROTECTED] %>" title="Beschreibung">
                  <%= render :partial => 'shippings/'+
(ShippingCategory.find(:first, :conditions => ["id = ?",
@shipping.shipping_categories_id])).name %>
                </ul>
        <% end %>
# that i do for every collection now.

Now this results in the problem, that if a user clicks the "Next
Five ..." a template is delivered that has 5 li's with the next 5
results, but also has 5 new collections that are wrapped by ul's, so I
have ul's inside of the target li and that destroys the DOM
structure.

If I try to explicitely close the top most ul with </ul
id="duffyduck"> its ignored (I think because of the recursion). How
can I solve that Problem. Indeed I need 5 separate ul's beneath the
li's per result, so every klick on "Next Five ..." needs to deliver
not only li's, but also ul's.

Every help is welcome!

Thx in advance
Jan
jan [at] roesner [dot] it


--~--~---------~--~----~------------~-------~--~----~
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