我在java中遇到动态数据表的问题。我在一个简单的切换面板中创建了多个动态数据表。生成数据表并正确显示在表单(jsp页面)中。数据也填充在表格中。当我点击表格中的任何命令链接时,它会打开模态面板但不显示任何数据。当我再次刷新页面然后单击命令链接时,模式面板显示数据。
所以问题是第一次数据表生成时我点击任何链接所需的数据永远不会出现在第一个按钮点击的模态面板中。但如果我再回到同一页面,那么所需的数据会出现在modalpanel中。请为我建议解决方案。
我还注意到奇怪的事情是通过比较第一次和第二次加载页面的视图源,数据表名称在第一次出现时没有表单名称,如DATA_TABLE_NAME,第二次数据表名称出现表单名称,例如表格名称:DATA_TABLE_NAME
我一直在复制数据表的日志两次。 这是第一次:
17:04:14,327 WARN [HtmlLabelRenderer] Attribute 'for' of label component with id scopeItemsForm:taskMoreInfoNonScopePanelForm:j_id_jsp_151042
17:04:14,327 WARN [HtmlLabelRenderer] Attribute 'for' of label component with id scopeItemsForm:taskMoreInfoNonScopePanelForm:j_id_jsp_151042
17:04:14,327 WARN [HtmlLabelRenderer] Attribute 'for' of label component with id scopeItemsForm:taskMoreInfoNonScopePanelForm:j_id_jsp_151042
17:04:14,327 WARN [HtmlLabelRenderer] Attribute 'for' of label component with id scopeItemsForm:taskMoreInfoNonScopePanelForm:j_id_jsp_151042
17:04:14,327 WARN [HtmlLabelRenderer] Attribute 'for' of label component with id scopeItemsForm:taskMoreInfoNonScopePanelForm:j_id_jsp_151042
17:04:14,327 WARN [HtmlLabelRenderer] Attribute 'for' of label component with id scopeItemsForm:taskMoreInfoNonScopePanelForm:j_id_jsp_151042
17:04:14,343 WARN [HtmlLabelRenderer] Attribute 'for' of label component with id scopeItemsForm:taskMoreInfoNonScopePanelForm:j_id_jsp_151042
17:04:14,343 WARN [HtmlLabelRenderer] Attribute 'for' of label component with id scopeItemsForm:taskMoreInfoNonScopePanelForm:j_id_jsp_151042
17:04:14,343 WARN [HtmlLabelRenderer] Attribute 'for' of label component with id scopeItemsForm:taskMoreInfoNonScopePanelForm:j_id_jsp_151042
17:04:14,343 WARN [HtmlLabelRenderer] Attribute 'for' of label component with id scopeItemsForm:taskMoreInfoNonScopePanelForm:j_id_jsp_151042
17:04:14,343 WARN [UIComponentBase] WARNING: Component scopeItemsForm:j_id165 just got an automatic id, because there was no id assigned yet.
17:04:14,343 WARN [UIComponentBase] WARNING: Component scopeItemsForm:j_id166 just got an automatic id, because there was no id assigned yet.
17:04:14,343 WARN [UIComponentBase] WARNING: Component ST_DATATBL_ID_0:j_id167 just got an automatic id, because there was no id assigned yet
17:04:14,343 WARN [UIComponentBase] WARNING: Component ST_DATATBL_ID_0:j_id168 just got an automatic id, because there was no id assigned yet
17:04:14,358 WARN [UIComponentBase] WARNING: Component ST_DATATBL_ID_0:j_id169 just got an automatic id, because there was no id assigned yet
17:04:14,358 WARN [UIComponentBase] WARNING: Component ST_DATATBL_ID_0:j_id170 just got an automatic id, because there was no id assigned yet
17:04:14,358 WARN [UIComponentBase] WARNING: Component ST_DATATBL_ID_0:j_id171 just got an automatic id, because there was no id assigned yet
17:04:14,358 WARN [UIComponentBase] WARNING: Component ST_DATATBL_ID_0:j_id172 just got an automatic id, because there was no id assigned yet
17:04:14,358 WARN [UIComponentBase] WARNING: Component ST_DATATBL_ID_0:j_id173 just got an automatic id, because there was no id assigned yet
17:04:14,358 WARN [UIComponentBase] WARNING: Component ST_DATATBL_ID_0:j_id174 just got an automatic id, because there was no id assigned yet
17:04:14,358 WARN [UIComponentBase] WARNING: Component ST_DATATBL_ID_0:j_id175 just got an automatic id, because there was no id assigned yet
17:04:14,358 WARN [UIComponentBase] WARNING: Component ST_DATATBL_ID_0:j_id176 just got an automatic id, because there was no id assigned yet
17:04:14,358 WARN [UIComponentBase] WARNING: Component ST_DATATBL_ID_0:j_id177 just got an automatic id, because there was no id assigned yet
17:04:14,358 WARN [UIComponentBase] WARNING: Component ST_DATATBL_ID_0:j_id178 just got an automatic id, because there was no id assigned yet
17:04:14,358 WARN [UIComponentBase] WARNING: Component ST_DATATBL_ID_0:j_id179 just got an automatic id, because there was no id assigned yet
这是第二次
16:49:34,264 WARN [UIComponentBase] WARNING: Component scopeItemsForm:ST_DATATBL_ID_0:j_id105 just got an automatic id, because there was no id assigned yet. If this compo
16:49:34,264 WARN [UIComponentBase] WARNING: Component scopeItemsForm:ST_DATATBL_ID_0:j_id106 just got an automatic id, because there was no id assigned yet. If this compo
16:49:34,264 WARN [UIComponentBase] WARNING: Component scopeItemsForm:ST_DATATBL_ID_0:j_id107 just got an automatic id, because there was no id assigned yet. If this compo
16:49:34,264 WARN [UIComponentBase] WARNING: Component scopeItemsForm:ST_DATATBL_ID_0:j_id108 just got an automatic id, because there was no id assigned yet. If this compo
16:49:34,279 WARN [UIComponentBase] WARNING: Component scopeItemsForm:ST_DATATBL_ID_0:j_id109 just got an automatic id, because there was no id assigned yet. If this compo
16:49:34,279 WARN [UIComponentBase] WARNING: Component scopeItemsForm:ST_DATATBL_ID_0:j_id110 just got an automatic id, because there was no id assigned yet. If this compo
16:49:34,279 WARN [HtmlImageRendererBase] ALT attribute is missing for : null
16:49:34,279 WARN [UIComponentBase] WARNING: Component scopeItemsForm:ST_DATATBL_ID_0:j_id111 just got an automatic id, because there was no id assigned yet. If this compo
16:49:34,295 WARN [UIComponentBase] WARNING: Component scopeItemsForm:ST_DATATBL_ID_0:j_id112 just got an automatic id, because there was no id assigned yet. If this compo
16:49:34,295 WARN [UIComponentBase] WARNING: Component scopeItemsForm:ST_DATATBL_ID_0:j_id113 just got an automatic id, because there was no id assigned yet. If this compo
16:49:34,295 WARN [HtmlImageRendererBase] ALT attribute is missing for : null
16:49:34,295 WARN [UIComponentBase] WARNING: Component scopeItemsForm:ST_DATATBL_ID_0:j_id114 just got an automatic id, because there was no id assigned yet. If this compo
16:49:34,295 WARN [UIComponentBase] WARNING: Component scopeItemsForm:ST_DATATBL_ID_0:j_id115 just got an automatic id, because there was no id assigned yet. If this compo
首次使用HTML CODE:
<table class="rich-table " id="ST_DATATBL_ID_0" border="0" cellpadding="0" cellspacing="0" width="100%">
<colgroup span="12"></colgroup>
<thead class="rich-table-thead">
<tr class="rich-table-header ">
<th class="rich-table-headercell " id="ST_DATATBL_ID_0:j_id107" width="20"></th>
<th class="rich-table-headercell " id="ST_DATATBL_ID_0:j_id108" width="2"></th>
<th class="rich-table-headercell " id="ST_DATATBL_ID_0:j_id109">ITEM #<img alt="" class="rich-spacer " height="1" id="ST_DATATBL_ID_0:j_id110" src="/pgsportal/a4j/g/3_3_3.Finalimages/spacer.gif.jsf" width="10%" />
<a href="#" id="ST_DATATBL_ID_0:j_id111" name="ST_DATATBL_ID_0:j_id111" onclick="A4J.AJAX.Submit('scopeItemsForm',event,{'status':'notrequired','similarityGroupingId':'ST_DATATBL_ID_0:j_id111','parameters':{'ST_DATATBL_ID_0:j_id111':'ST_DATATBL_ID_0:j_id111'} ,'containerId':'j_id0'} );return false;">
和第二个timme看起来像:
<table class="rich-table " id="scopeItemsForm:ST_DATATBL_ID_0" border="0" cellpadding="0" cellspacing="0" width="100%">
<colgroup span="12"></colgroup>
<thead class="rich-table-thead"><tr class="rich-table-header ">
<th class="rich-table-headercell " id="scopeItemsForm:ST_DATATBL_ID_0:j_id107" width="20"></th><th class="rich-table-headercell " id="scopeItemsForm:ST_DATATBL_ID_0:j_id108" width="2"></th>
<th class="rich-table-headercell " id="scopeItemsForm:ST_DATATBL_ID_0:j_id109">ITEM #
<img alt="" class="rich-spacer " height="1" id="scopeItemsForm:ST_DATATBL_ID_0:j_id110" src="/pgsportal/a4j/g/3_3_3.Finalimages/spacer.gif.jsf" width="10%" />
<a href="#" id="scopeItemsForm:ST_DATATBL_ID_0:j_id111" name="scopeItemsForm:ST_DATATBL_ID_0:j_id111" onclick="A4J.AJAX.Submit('scopeItemsForm',event,{'status':'notrequired','similarityGroupingId':'scopeItemsForm:ST_DATATBL_ID_0:j_id111','parameters':{'scopeItemsForm:ST_DATATBL_ID_0:j_id111':'scopeItemsForm:ST_DATATBL_ID_0:j_id111'} ,'containerId':'j_id0'} );return false;"><img src="../images/down_arrow.png" /></a>
答案 0 :(得分:0)
好像你有身份证问题。
创建标签时,您可以将for
属性设置为指向具有相同ID的输入:
<label for="someId">
<input name="someInput" id="someId"/>
</label>
由于您没有发布任何HTML,因此很难准确说出,但您的标签可能为空for
:
<label for="">
或for
指向错误的ID:
<label for="someId">
<input name="someInput" id="someOtherId"/>
</label>