我有两个ADF面孔表A
和B
,其rowSelection
属性设置为“single
”。现在要求是从A
中选择一行时,它应清除B
中的所有选项,反之亦然。所以我在两个表上都注册了selectionListeners
,并且在该方法中执行的代码对未被选中的表执行以下操作:
tablenNotSelected.setSelectedRowKeys(null);
我在这里缺少什么?
答案 0 :(得分:2)
您可能需要在桌面或可能的周围容器上设置部分触发器,以实际强制更新屏幕。
答案 1 :(得分:0)
不要将所选行键设置为null。而是使用getSelectedRowKeys().RemoveAll();
API。
要刷新其他表格,请执行以下操作。
table_1_selectionListener() {
RequestContext.getCurrentInstance().addPartialTarget(T2);
}
类似于表2的监听器
答案 2 :(得分:0)
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
//this code works on ZERO INDEXING
struct Empdetails
{
char name[25];
char id[8];
char password[4];
int casual;
int medical;
int earned;
} emp[5];//declaring array of structures
/*I am trying to convert the file to a structure and then use the
structure to access the data and
I'm also using files to store the information*/
extern void table()
{
FILE *fp;//definig a file pointer
char ch;
char line[4096];
char *token;//token pointer that points to a
int tokenposition=0;//token here means the particular text separated by comma
int lineposition=0;//line here is the entire line which has entire details of the an emmployee
fp=fopen("emplyoyeeinfo.txt","r");//opening the file and reading it
while(fgets(line,4096,fp) !=NULL) //accessing the lines one by one and using a \n to recognize the end of a line
{
tokenposition=0;//when we tokenize the line we need the count to keep a track of where we are int he string
//printf("%s \n",line);//used to check which line is not being read by the compiler
token = strtok(line,",");//this seperates a line into token(entity) based on a delimiter,here the delimiter is a comma
//string tokenization`
while(token != NULL)
{
switch(tokenposition)//acessing the required element through the tokenposition counter
{
case 0:
strcpy(emp[lineposition].name,token);
break;
case 1:
strcpy(emp[lineposition].id,token);
break;
case 2:
strcpy(emp[lineposition].password,token);
break;
case 3:
emp[lineposition].casual=atoi(token);
break;
case 4:
emp[lineposition].medical=atoi(token);
break;
case 5:
emp[lineposition].earned=atoi(token);
break;
}
token =strtok(NULL,",");
tokenposition++;//to access the next token in the same line
}
lineposition++;//after all the tokens are put in a structure,wwe move to the next line and redo the entire process
}
}
void main()
{
int i;
for (i = 0; i < 5; i++)
{
printf("\033[34m\n\n\tNAME : %s\033[0m\n", emp[i].name);
printf("\033[34m\n\n\tID : %s\033[0m\n", emp[i].id);
printf("\033[34m\n\n\tPASSWORD : %d\033[0m\n", emp[i].password);
printf("\033[34m\n\n\tCASUAL : %f\033[0m\n", emp[i].casual);
printf("\033[34m\n\n\tMEDICAL : %c\033[0m\n", emp[i].medical);
printf("\033[34m\n\n\tEARNED : %s\033[0m\n", emp[i].earned);
}
}