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
最满意答案
相关问答
更多-
Python图库[已关闭](Python Graph Library [closed])[2022-07-16]
有两个很好的选择: 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 ... -
python中的接近图(Proximity Graph in python)[2022-05-02]
图形工具库具有您需要的大部分功能 。 所以你可以做这样的事情,假设你有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 ...
-
调试NEURON MOD文件?(Debugging NEURON MOD files?)[2023-07-13]
使用 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 ... -
如何在python中使用pydot附加2个图形(graph1和graph2)(how to append 2 graphs (graph1 and graph2) using pydot in python)[2022-01-09]
我找不到描述加入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) 它会工作。 完整代码 ...
-
用Python表示这个图(Representing this graph in Python)[2022-03-21]
如果您只使用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], [ ... -
Python:导入图表(Python: Importing a graph)[2023-06-06]
如果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 ... -
Python图形更改(Python Graph Changes)[2023-08-24]
但我得到的是,原始图表中也发生了变化 你在做什么被称为:“浅拷贝”。 你需要做的是“深层复制”。 你想要使用: 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 ...