on 11-18-2005 2:03 PM
Hello,
Maybe somebody has solved such problem
I have a Table and few columns in it.
I need to have every third row in one of the columns
editable. First I have created standard Table element
Bind it to my RFC function table.
I was trying also to create within a table
one column with type of InputField but when I run
my application this column is still not editable.
Maybe somebody has some idea how to manage (and make every third row editable?
Thank you very much in advance
Bogusia
I think I found the solutions but both are not satisfying
1. I have created new column:
- I have created by using right-menu
Insert TableCellEditor an InputField
Now I see that column is editable but...
I have to click a row (row must be marked) to be
able to write something and I do not like
it because I want that user has not to wait
while the row will be marked.
2. I have created Master Column
- Like above using TableCellEditor (InputField)
I see now that all rows in column are editable
without a neccesity of marking single row
but the column has strange arrows at the begining
and when I click on them error occurs...
Maybe somebody has an idea and also for only the every third row editable?
Thank you in advance
Bogusia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bogumila,
Create calculated attribute under your data node with type boolean (readOnly). Map property Read only of InputField cell editor to this attribute. And in calculation method put:
public boolean getResultEditable(IPrivateNewComponentView.IResultElement element)
{
//@@begin getResultEditable(IPrivateNewComponentView.IResultElement)
final int index = element.index();
return !(index%3==0);
//@@end
}
Best regards, Maksim Rashchynski.
Hi Bogumila,
You have bound some value node/model node with the table ui element.
Now make one value/model attribute inside this node.
Set its calculated property to "true". and set type to boolean.
It generates its setter and getter method. In getter method write following code.
if(element.index()%3 == 0)
{
return true;
}
else
{
return false;
}
Now, bind this newly created value/model attribute with the table celleditor's read only property.
Regards,
Bhavik
Hello Bogumila,
1) Create firstVisibleRow attribute with type integer. Map it to table property firstVisibleRow.
2) Create visibleRowCount attribute with type integer. Map it to table property visibleRowCount. In method wdDoInit set it to appropriate value (5 for example. it is default value. increase or reduce as necessary)
3) To calculate index of selected row you can use following code:
int visibleRowCount = wdContext.currentContextElement().getVisibleRowCount();
int index = wdContext.nodeResult().currentResultElement().index();
int firstVisibleRow = wdContext.currentContextElement().getFirstVisibleRow();
return
((index >= firstVisibleRow + visibleRowCount) || (index < firstVisibleRow) ?
-1 :
index - firstVisibleRow + 1);
Best regards, Maksim Rashchynski.
Thank you for everybody!:
MY STEP-BY-STEP SOLUTION:
1. Create in a Context for View but! on the Diagram Model level (to do this double click on the Your Component/double click on the arrow between your View and a Model) and create WITHIN your table new Attribute Value
(not outside!!! I have done it and the number of row was not visible in the implementation) right-menu-> New->Attribute Value and give it a name..
Go back to View -> Go to tab Context
than select in table your newly created Attribute Value
Go to the Properties of this Attribute
Set:
-calculated: True(after doing it you see below 2 new methods they will be also added to the Implementation
of your View)
-type: boolean
Go to the Outline then to a table column and its attribute you want to change (in my case that was: ReadOnly Attribute) to the Properties, set as a value for ReadOnly the Newly Created Attribute Name.
Go to the Implementation of your view
and find the getXXXXX method which was created
after clicking true for calculated properties
for Your Attribute Value.
I have used such solution for implementation:
(I need to have every third row in specific column editable)
The code is:
public boolean getMyObjectReadyOnly(IPrivateResultView.IMyObjectElement element)
{
//@@begin getMyObjectReadyOnly(IPrivateResultView.IMyObjectElement)
int i = element.index() + 1;
if (i % 3 == 0){
return false;
}else{
return true;}
//@@end
}
That was really simple...
With greetings
Bogusia
Thank you very much to all for your support
Hi Bogumila,
As u asked what is a data node?A data node is a collection of different attributes.An attribute is just like a variable that holds ur data.But the node is where u can hav multiple values for a single attribute.
Local dictionary is a place where you can create ur simple types.Simple types are nothing but just a storage area of values that is being used in the drop down box,radio buttons etc.
Hope this satisfies ur queries.
Regards,
Nagarajan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.