首页 \ 问答 \ Iframe的目标更新(Target Update of Iframe)

Iframe的目标更新(Target Update of Iframe)

我在<c:forEach>迭代器中更新iframe时遇到了一些问题:

<h:form>
    <p:outputPanel rendered="#{dd.render()}">
        <p:tabView dynamic="true">
        <c:forEach var="aba" items="#{dd.abas}">
        <p:tab title="#{aba.orelha}" >
        <h2>
            <h:outputText value="#{aba.titulo}" />
            <p:selectOneMenu style="width:250px;  float:right;" value="#{aba.ln}" rendered="#{aba.selecaoAtiva}">
            <f:selectItems value="#{aba.itens}" />
             <p:ajax update="WHAT SHOULD GO HERE???" event="change" />
        </p:selectOneMenu>
        </h2>
            <f:view>
                <iframe src="very-Boring-And-Long-E.L.-Built-URL" width="#{dd.largura}" frameborder="0" height="#{dd.altura}" />
            </f:view>
            </p:tab>
        </c:forEach>
        </p:tabView>
    </p:outputPanel>
</h:form>

我想在用户选择<p:selectOneMenu>上的内容时仅更新iframe内容。 原始代码在ajax标记上有@form ,并且正在更新整个表单并将用户放回第一个选项卡。

如何让ajax更新iframe而不会搞乱活动标签?


I have some problem with the update of a iframe inside a <c:forEach> iterator:

<h:form>
    <p:outputPanel rendered="#{dd.render()}">
        <p:tabView dynamic="true">
        <c:forEach var="aba" items="#{dd.abas}">
        <p:tab title="#{aba.orelha}" >
        <h2>
            <h:outputText value="#{aba.titulo}" />
            <p:selectOneMenu style="width:250px;  float:right;" value="#{aba.ln}" rendered="#{aba.selecaoAtiva}">
            <f:selectItems value="#{aba.itens}" />
             <p:ajax update="WHAT SHOULD GO HERE???" event="change" />
        </p:selectOneMenu>
        </h2>
            <f:view>
                <iframe src="very-Boring-And-Long-E.L.-Built-URL" width="#{dd.largura}" frameborder="0" height="#{dd.altura}" />
            </f:view>
            </p:tab>
        </c:forEach>
        </p:tabView>
    </p:outputPanel>
</h:form>

I want to update ONLY the iframe contents when the user selects something on the <p:selectOneMenu>. The original code had @form on the ajax tag, and was updating the whole form and putting the user back into the 1st tab.

How can I make the ajax update the iframe whithout messing with the active tab?


原文:https://stackoverflow.com/questions/14137887
更新时间:2024-02-10 10:02

最满意答案

创建Graph()对象后,还将其添加到全局graphList。 它将在run()期间更新:

g = h.Graph()
g.addvar(...)

h.graphList[0].append(g)

h.run()

在此处输入图像描述


After creating the Graph() object, also add it to the global graphList. It will then be updated during run():

g = h.Graph()
g.addvar(...)

h.graphList[0].append(g)

h.run()

enter image description here

相关问答

更多
  • 有两个很好的选择: NetworkX 和 IGRAPH 我喜欢NetworkX,但我也读了关于igraphㄧread的好东西。 我经常使用具有100万个节点的网络的NetworkX,没有任何问题(它的大小是V + E大小的开销的两倍) 如果要进行功能比较,请参阅Networkx讨论列表 特征比较线程 There are two excellent choices: NetworkX and igraph I like NetworkX, but I read good things about igraph ...
  • 图形工具库具有您需要的大部分功能 。 所以你可以做这样的事情,假设你有numpy和graph-tool : coords = numpy.meshgrid(*(numpy.linspace(0, (n-1)*delta, n) for i in range(d))) # coords is a Python list of numpy arrays coords = [c.flatten() for c in coords] # now coords is a Python list of 1-d nump ...
  • 创建Graph()对象后,还将其添加到全局graphList。 它将在run()期间更新: g = h.Graph() g.addvar(...) h.graphList[0].append(g) h.run() After creating the Graph() object, also add it to the global graphList. It will then be updated during run(): g = h.Graph() g.addvar(...) h.graph ...
  • 子测试员() Dim rngDates As Range, sht As Worksheet Dim wsf As WorksheetFunction Set wsf = Application.WorksheetFunction Set sht = ActiveSheet Set rngDates = sht.Range(sht.Range("B5"), sht.Cells(Rows.Count, 2).End(xlUp)) 'set x-axis (with a padding of 1 hour ...
  • 使用 printf() 语句 例如,在.MOD文件中的任何部分中,添加下面的printf()语句将在模拟期间每次评估该部分时打印变量t, i, and v值: BREAKPOINT { SOLVE state METHOD cnexp g = (B - A)*gmax i = g*(v - e) printf("time: %g, current: %g, voltage: %g \n", t, i, v) } 会产生如下所示的内容: time: 231.062, cur ...
  • 我找不到描述加入2个图表的文档。 通常的做法似乎是加入2个子图(集群)。 这里的答案显示了它是如何完成的: pydot中两个子图之间的边缘 另一个有用的答案: 在python中的公共节点处合并两个点图 更新,回答已编辑的问题: 你的代码有一些问题: graph1.get_node(B)返回节点列表 当您想要所有其他节点和边时,您只添加用于连接图形的节点和边 此代码应返回您想要的结果: graph3 = pydot.Dot(graph_type='digraph') for node in graph1.ge ...
  • 你可以在Model类的__init__中执行self.sess.run(tf.global_variables_initializer()) ,但是只有在train()方法中才能设置tf.train.AdamOptimizer() 。 后者也创建了一些需要初始化的变量。 移动 self.sess.run(tf.global_variables_initializer()) 后面一行 train = tf.train.AdamOptimizer(0.1).minimize(loss) 它会工作。 完整代码 ...
  • 如果您只使用matplotlib ,代码可能如下所示: import numpy as np import matplotlib.patches as patches import pylab pp = np.array([ [-400, -50000], [800, -50000], [6000, -16000], [6000, 30000], [4400, 40000], [-3000, 40000], [-6000, 12000], [ ...
  • 如果sys.argv[3]是包含要导入的图形的文件的名称,则可以使用ast.literal_eval : with open(sys.argv[3], "r") as f: graph = ast.literal_eval(f.read()) # If you don't trust your users, check that graph is indeed a dict # and that it has the right structure If sys.argv[3] is the na ...
  • 但我得到的是,原始图表中也发生了变化 你在做什么被称为:“浅拷贝”。 你需要做的是“深层复制”。 你想要使用: copy.deepcopy 。 but What i get is that change also happens in the original Graph What you are doing is called: "Shallow copy". What you need to do is "Deep copy". You'd want to use: copy.deepcopy inst ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。