从 vf 页面中的动态选项列表中选择值时如何更新 URl?
当我从选项列表中选择一个值时,我遇到了更改 url 的问题。
<apex:actionFunction name="updateCategory" action="{!updateCategory}" rerender="posts" status="updateStatus">
<apex:param name="param" assignTo="{!selectedCategory}" value="{!discussionPageNum}" />
</apex:actionFunction>
<div class="ibtFilterStatus">
<apex:actionStatus startText="Updating..." id="updateStatus" startStyle="padding-right: 10px;"/>
<span class="select" id="select7">All Categories</span>
<apex:selectList id="ideacategories" value="{!selectedCategory}" size="1" onchange="hideSubscribeButton(); updateCategory(this.options[this.selectedIndex].value); doSearch('select7', this, 'ideaCategories')">
<apex:selectOptions value="{!categories}" />
</apex:selectList>
</div>
<div style="float: right" id="test">
<apex:outputLink style="margin-right:5px;font-size: 13px;{!IF(hasDiscussionNextPage,'','display:none;')}" value="?discussionPg={!discussionPageNum + 1}&ideaCategory={!selectedCategory}">Previous Discussion</apex:outputLink>
</div>
当我选择类别时,如何使用 id="test" 重新渲染我的 div?
I have an issue with changing url when i am selecting a value from my picklist.
<apex:actionFunction name="updateCategory" action="{!updateCategory}" rerender="posts" status="updateStatus">
<apex:param name="param" assignTo="{!selectedCategory}" value="{!discussionPageNum}" />
</apex:actionFunction>
<div class="ibtFilterStatus">
<apex:actionStatus startText="Updating..." id="updateStatus" startStyle="padding-right: 10px;"/>
<span class="select" id="select7">All Categories</span>
<apex:selectList id="ideacategories" value="{!selectedCategory}" size="1" onchange="hideSubscribeButton(); updateCategory(this.options[this.selectedIndex].value); doSearch('select7', this, 'ideaCategories')">
<apex:selectOptions value="{!categories}" />
</apex:selectList>
</div>
<div style="float: right" id="test">
<apex:outputLink style="margin-right:5px;font-size: 13px;{!IF(hasDiscussionNextPage,'','display:none;')}" value="?discussionPg={!discussionPageNum + 1}&ideaCategory={!selectedCategory}">Previous Discussion</apex:outputLink>
</div>
How can I rerender my div with id="test" when i am selecting a category?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信你只能重新渲染通过 VF 标签生成的页面元素(我在这里可能是错的,我没有尝试过!
用outputPanel替换div(它将生成相同的标记):
你会注意到我使用了 CSS 类而不是内联样式,最好的做法是执行此操作,然后将样式放入标头中的
块中
,然后在更改为输出面板后指定 。它用于重新渲染updateCategory 操作函数:
当然,如果正如我怀疑的那样,doSearch 也是一个操作函数,我建议从该函数进行重新渲染,因为这是最后一个要执行的函数。
I believe you can only rerender page elements that have been generated though a VF tag (I may be wrong here, I've not tried it!
replace the div with an outputPanel (it'll generate the same markup):
You'll notice I've used a CSS class rather than inline styling, it's best practice to do this and then put the styling in a
<style>
block in your header.After changing to the output panel, then specify it for rerender in the
updateCategory
action function:Of course, if, as I suspect, doSearch is also an action function, I'd suggest doing the rerender from that one since that is the last function to execute.
我对此有一个解决方案。
我只是在名为更新类别的操作函数方法中进行重定向。并且运行良好..
感谢 laceySnr 的所有回复...
I got a solution for this..
I just do redirection in my action function method named update category. and its working well..
thanks laceySnr for all your replies...