在模型的頁面上,我顯示兩個鏈接'選擇圖片'和'採取 圖片'。在 選擇圖片並且所選圖像正確顯示後,我很好地成功返回該頁面。 但是,當我點擊'拍照'時,照相機打開,我拍照, 調用頁面加載顯示的圖像,然後立即顯示該模型中的頁面 頁面。Rhomobile Rhodes應用中的頁面導航問題
兩個過程是相同的,只有改變一個叫 「take_picture」和另一個電話「choose_picture」有誰能夠告訴我 爲什麼在第二種情況下的應用程序重定向到索引頁面的模式?
abc_controller.rb:
def takepic
$id = @params['id']
Camera::take_picture(url_for :action => :camera_callback)
end
def choosepic
$id = @params['id']
Camera::choose_picture(url_for :action => :camera_callback)
end
def camera_callback
if @params['status']='ok'
@abc = Abc.find($id)
new_attributes = {"q1img"=>@params['image_uri']}
@abc.update_attributes(new_attributes) if @abc
@abc.save
WebView.navigate(url_for :action => :mypage, :query => {:id =>
$id})
end
end
調用頁面:mypage.bb.erb
<tr>
<td class="itemLabel">
<%= link_to '[Choose Picture]', :action => :choosepic , :query
=> { :id => @property.object } %>
</td>
<td class="itemValue">
<% if System::get_property('has_camera') %>
<%= link_to '[Take Picture]', :action => :takepic, :query =>
{ :id => @property.object } %>
<% end %>
</td>
</tr>
===============
LOG :
I 09/09/2010 07:23:08:83 7a934000 RHO PropertyCon |佈局文件:/apps/app/layout_erb.iseq。內容大小:2202
我09/09/2010 07:23:08:83 7a934000 APP | RhoApplication:使用菜單 - {「Home」=>:home,Refresh「=>:refresh,」Sync「=>:sync,」Options「=>:options,」Log「=>:log,:separator => nil 「關閉」=>:關閉}
我09/09/2010 07:23:08:83 7a934000 RhoConnection |調度端
我09/09/2010 07:23:08:161 7a934000 RhoConnection |發送開始
我09/09/2010 07:23:08:223 7a934000 APP | RhoApplication:使用菜單 - {「Home」=>:home,「Refresh」=> refresh,「Sync」=> :sync,「Options」=>:options,「Log」=>:log,:separator => nil,「Close」=>:close}
I 09/09/2010 07:23:08:223 7a934000 APP | ins ide RHO.serve_index:/apps/app/index_erb.iseq
I 09/09/2010 07:23:08:223 7a934000 RHO Rho :: RhoCon | inst_render_index