cancel
Showing results for 
Search instead for 
Did you mean: 

Different UI in same column in the table

Former Member
0 Kudos

Hi Experts,

I have a table, its have 4 column(name,id,task,status)Based on some task type, status column should be edited.

1. If "status" column is editable, "column" should be "dropdown" UI

2.If "status" column is non editable "column" should be "text field" UI

How can i achieve this? Give me your suggestions?

Regards,

Manivannan P

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

You can disable the dropdown key, else do one thing create one textview element with dropdown element in that same column and try to play with visibility property.

Former Member
0 Kudos

Hi sheik,

Thanks for your reply.

Can you please tell me more brief on this?How i can create textview with dropdownby Key?

Regards,

Manivannan P

Former Member
0 Kudos

Hi Manivannan,

I think another option would be using table cell variant.

Do the following step :

1. create a text field in the column in which you want to show two different Ui element at run time. now right click on that column and click Insert Cell variant. select Table Standard Cell.

2. Set the variant key property of the Table Standard Cell to some String value as Ex - DropDown.

3. Insert required cell editor inside this table standard cell ex. - DropDown by Key.

4. create an attribute "SelectedKey" of type string and two different attribute one of type String for Text Field and another of simple type for dropdown by key.

5. bind the SelectedKey attribute to the selectedCellVariant property of Table column and simple type attribute to dropdown and string attribute to Text field .

6. Now in coding based on condition if you want to show the dropdown just set the value of attribute SelectedKey to "DropDown" else it will by default show text field. Set the value of text field in text field attribute.

Thanks & Regards

Ravindra Singh

Former Member
0 Kudos

Hi Experts,

Dropdown enabled and disabled worked

taskCode.get(i).contains(arrList.get(j)

instead of

taskCode.get(i).equals(arrList.get(j)

using this code

Regards,

Manivannan P

Former Member
0 Kudos

HI,

See http://wiki.sdn.sap.com/wiki/display/WDJava/UsingTableCellVariantsinNW2004s

Also search for "table cell variant" on SDN.

You can also try to disable your drop down in case of non editable.Not a solution but a workaround.

Regards,

Himanshu

Former Member
0 Kudos

Hi Experts,

Thanks for your replies.

I am using enabling the dropdown for editable field and disabled the dropdown for non editable field.

I am using following code.based on the backend data(Using BAPI for editable fieldI) i am displaying the dropdown(for enabling and displaying). I am able to compare the data for backend data and portal table data. for enabling the dropdown is not work. can you please correct the below code.

Context structure is

Task

--name

-id

- task

-statusmode(boolean--> I binded the dropdown enabled property)


try
			{
				int size = wdContext.nodeTask_List().size();
				int taskSize = wdContext.nodeTasks().size();
				for (int i = 0; i < taskSize; i++)
				{
				
					ele = wdContext.nodeTasks().getTasksElementAt(i);
					task = wdContext.nodeTasks().getTasksElementAt(i).getTaskType();
					taskCode.add(task);
					
						
				
					
					for (int j  = 0; j <size; j++)
					{
					
						taskType =wdContext.nodeTask_List().getTask_ListElementAt(j).getTasktype();
						arrList.add(taskType);
					
					

						if (arrList.get(j).equals(taskCode.get(i)))
						{
							
							ele.setStatusMode(true);
							break;
							
						}
					
						else 
						{
							ele.etStatusMode(false);

													
						}
					}
				
				
				
				}
				wdContext.nodeTasks().addElement(ele);
			
			}
			catch (Exception e)
			{
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

Regards,

Manivannan P

Former Member
0 Kudos

HI,

The code seems to be fine at a first glance.

Try using the actual value i.e. task and tasktype instead of arrays while comparing. It might work.

Regards

Former Member
0 Kudos

Hi Himansu,

I am able to compare the values in the table. My problem is enabling the dropdown.

If i remove the "break" statement in the if loop i am able to print all vaues in the backend and portal table.here dropdown is not enabled..any other way for doing this


	if (taskCode.get(i).equals(arrList.get(j)))
						{
							
							ele.setStatusMode(true);
													wdComponentAPI.getMessageManager().reportSuccess(
								"Equal: " + taskCode.get(i) + ": " + arrList.get(j));
							break;
							
						}
					
						else 
						{
							ele.setStatusMode(false);

							wdComponentAPI.getMessageManager().reportSuccess(
								"Not equal: " + taskCode.get(i) + ": " + arrList.get(j));

Regards,

Manivannan P

Former Member
0 Kudos

Hi ,

If you can compare correctly then recheck your Binding and Mapping between View and Controller .

Also towards the end of the code you posted originally, you are adding element "ele" to the node. Is it really required?

I can't think of anything else apart from this. Check the output from the code you have posted recently and see if there are any ambiguities.

Regards

gill367
Active Contributor
0 Kudos

HI

after filling the all the elments once, check the values for the attribute statusmode.

check whether the values filled are proper and check again whether you have bound the enable property to status mode.

bind it again and save all metadata and build the project again

Thanks

Sarbjeet singh

Former Member
0 Kudos

Hi ,

I done all the way.

I am able to compare and print all the elements in the if and else condition...

I am strucking in the enabling the dropdown.I binded Statusmode attribute to table->status>celleditor--->enabled property


if (taskCode.get(i).equals(arrList.get(j))  )
						{
							
							ele.setStatusmode(true);
							
							
													wdComponentAPI.getMessageManager().reportSuccess(
								"Equal: " + taskCode.get(i) + ": " + arrList.get(j));
							break;
							
						}
					
						else 
						{
							ele.setStatusmode(false);

							wdComponentAPI.getMessageManager().reportSuccess(
								"Not equal: " + taskCode.get(i) + ": " + arrList.get(j));
								
						
							
							
							
						}

Regards,

Manivannan P

gill367
Active Contributor
0 Kudos

HI

i am saying could you please try to print the vaues of attribute once using message manager

for(int i =0; i<wdcontext.nodetasks.size; i++)
{
wdcomponentAPI.getmessagemanager().reportSucess(wdcontext.nodetasks.gettaskselement.getstatusmode()+"");

}

this will show whether the values are gettign populated there in stastus mode or not.

thanks

sarbjeet

Former Member
0 Kudos

Hi sarbjeet,

Thanks for your reply


for(int i =0; i<wdcontext.nodetasks.size; i++)
{
wdcomponentAPI.getmessagemanager().reportSucess(wdcontext.nodetasks.gettaskselement.getstatusmode()+"");
 
}

I printed the above value. result is coming with true only.but dropdown is not enabled still it sin disabled mode only.(I already binded boolean value to enabled properties in the dropdown properties). where i have missed? my node cardinality is --> 0...n and selection is --> 0..1

Regards,

Manivannan P

Former Member
0 Kudos

Hi Mani,

How about having multiple columns? One for Dropdown and one for Text field and controlling their visibility on checking the table editable/non editable conditions??

Few simple validations must do the thing. This may help. Thanks!

Regards,

Gaurav Bhardwaj