在iOS中使用其他对话框控件 [英] Using other dialog controls in iOS

查看:89
本文介绍了在iOS中使用其他对话框控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Dialog控件制作一个弹出选择器.我的想法是创建一个带有列表的列表框,选择后应设置一个sessionScope并关闭.在PC上,我已经完成了它,并且效果很好.在ipad上,我得到一个空对话框.

I'm trying to make a pop up selector using the Dialog control. My idea is to have a list box with a list and upon selection it should set a sessionScope and close. On the pc i have finished it and it works perfectly. On the ipad i get an empty dialog.

我是否认为这是IOS和数据源经常发生的问题?无论如何,这是我的代码:

Im thinking its some of the reoccurring issues with IOS and datasources? Anyway here is my code:

< unp:unpDialog callback ="SetCoolList" title =选择列表">
< xp:this.facets>
< xp:panel xp:key ="facet_1" >


< xp:listBox id ="listBox1" styleClass ="mychooser">
< xp:selectItems>
< xp:this .value><![CDATA [#{javascript:sessionScope.bitsnbobs;}]]]></xp:this.value>
</xp:selectItems>

< xp:this.attrs>
< xp:attr name ="onchange">
< xp:this.value><![CDATA [#{javascript:
      return"$('.OptionsButton').click();"; 
}]]></xp:this.value>
</xp:attr>
</xp:this.attrs>
</xp:listBox>

< xp:button id ="OptionsButton" styleClass ="OptionsButton隐藏">
< xp:eventHandler事件="onclick"提交="true"
refreshMode ="complete"立即="true">
< xp:this.action>
< xp:actionGroup>

< xp:executeScript>
< xp:this.scrip t><![CDATA [#{javascript:sessionScope.coollistwa = getComponent("listBox1").getValue();
}]]><//xp:this.script>
< ;/xp:executeScript>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:按钮>


</xp:panel>
</xp:this.facets>
</unp:unpDialog>

是否有一种解决方法,可为与对话框控件和ios一起使用的列表框提供字符串集合?

<unp:unpDialog callback="SetCoolList" title="List of Choices">
<xp:this.facets>
<xp:panel xp:key="facet_1">


<xp:listBox id="listBox1" styleClass="mychooser">
<xp:selectItems>
<xp:this.value><![CDATA[#{javascript:sessionScope.bitsnbobs;}]]></xp:this.value>
</xp:selectItems>

<xp:this.attrs>
<xp:attr name="onchange">
<xp:this.value><![CDATA[#{javascript:
      return "$('.OptionsButton').click();"; 
}]]></xp:this.value>
</xp:attr>
</xp:this.attrs>
</xp:listBox>

<xp:button id="OptionsButton" styleClass="OptionsButton hidden">
<xp:eventHandler event="onclick" submit="true"
refreshMode="complete" immediate="true">
<xp:this.action>
<xp:actionGroup>

<xp:executeScript>
<xp:this.script><![CDATA[#{javascript:sessionScope.coollistwa = getComponent("listBox1").getValue();
}]]></xp:this.script>
</xp:executeScript>
</xp:actionGroup>
</xp:this.action>
</xp:eventHandler>
</xp:button>


</xp:panel>
</xp:this.facets>
</unp:unpDialog>

Is there a workaround for providing a collection of strings to the listbox that works with a dialog control and on the ios?

推荐答案

我使用未插入控件3.3 数据库,您就可以在桌面浏览器中看到与iOS不同的行为:在桌面浏览器中,您将获得一个<select>控件,该控件一次显示多个条目,在iOS上,您将看到一个空白框.点击该空白框会弹出标准的iOS值选择器.我看到的唯一问题是对话框中的空白框看起来很奇怪.

I tested your code using the Unplugged Controls 3.3 database and you're right in seeing a different behaviour in a desktop browser vs iOS: in the desktop browser you'll get a <select> control that shows multiple entries at once, on iOS you'll see a blank box. Tapping on that blank box brings up the standard iOS value picker. The only issue I see is that the blank box looks strange in the dialog.

在我看来,这似乎不像是未插电问题,而是这些控件在不同浏览器中呈现方式的结果.另请参阅线程以了解某些背景.那里讨论了一些解决方法.

This doesn't seem to me like an Unplugged issue, but rather the result of the way these controls are rendered in different browsers. See also this thread for some background. There are some workarounds discussed there.

如果要显示选项列表,还可以在对话框中使用<xp:repeat>控件,该控件显示每个条目的文本,并将onclick处理程序附加到每个条目,就像在代码中对选项所做的一样<xp:listBox>.

If you want to display a list of choices you can also use an <xp:repeat> control in the dialog that shows the text of each entry and attach an onclick handler to each entry like you did in your code to the options of the <xp:listBox>.

这篇关于在iOS中使用其他对话框控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆