0
私は機能を使用しています。ここで、妥当性検査のエラーが発生した場合、gotoリンクはフォーカス()を持つ必須コンポーネントのIDをページの上部に生成しています。そのリンクをクリックすると、必要なコンポーネントが強調表示されます。今はそのエラーが同じタブにある場合の作業です。しかし、最初のタブはアクティブなフォーカス機能で、3番目のタブの中に必要なテキストボックスをポイントしません。javascript focus()はプライムフェイスのtab1からtab2には作用しません
void encodeGotoLabel(FacesContext context, UIComponent component, ResponseWriter writer,
FacesMessage msg) throws IOException {
String id = getid(context, msg);
if (id != null && !FacesMessage.SEVERITY_INFO.equals(msg.getSeverity())
&& !FacesMessage.SEVERITY_FATAL.equals(msg.getSeverity())) {
String inputLabel = findInputLabel(context, id);
if (inputLabel != null) {
ResourceBundle bundle ="bundle";
writer.writeText(" (", null);
writer.writeText(bundle.getString("goTo") + " ", null);
writer.startElement("a", component);
writer.writeAttribute("href", "javascript:document.getElementById('" + id
+ "').focus();",
null);
writer.writeText(inputLabel, null);
writer.endElement("a");
writer.writeText(")", null);
}
}
}
多分要素idが同じであるため、最初の要素しか取得できません。 – user1087079
質問が明確ではない、正確に何が必要なの? –
検証エラーのあるタブに切り替えたいですか? –