cancel
Showing results for 
Search instead for 
Did you mean: 

Read access to UI Elements

Former Member
0 Kudos

Hi,

Is there a possibility to read attributes from UI-Elements instead of using the static wDoModifyView - Method?

Are the views or view elements accessible by the IWDCustomEvent.class?

Thanks.

Cemal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You should use the wdDoModifyView() method exclusively to change the layout of a view, not to change UI element property values.

Use data binding to manipulate UI element property values from within controller methods and event handlers.

Armin

Former Member
0 Kudos

Armin,

I already read your answer in another post. You are right.

But if I want only to know which UI-Element is actually requested / triggered e.g. table columns or tabs of a tabstrip without using the onSelect or onAction-Events how can I reach this aim over data binding?

Cemal

Former Member
0 Kudos

Hi,

Why are u not using the default actions defined.

Can u tel us the scenario where u r looking for a solution like this ?

Regards

Bharathwaj

Former Member
0 Kudos

Hi Bharathwaj,

in case of firing and handling an event the response time is very long.

I've a Tabstrip - UI-Element with two tabs. Tab1 holds a table which displays a media library. Tab2 is form based view of a table row.

1) In case of filtering on a column of a table I need the info which column is to be filtered.

2) In case of switching the table row selection I want to jump to Tab2 in order to show table row data by the form.

I usually can store the mentioned UI-Element in the context by conding in the wDoModifyView-Method. But I mean there must be possible that we are able to access to the View-Interfaces.

Kind regards.

Cemal

Former Member
0 Kudos

Hi again,

even if I prefer to use the actions I can't access the UI-Elements if i did not store the info in the context.

Cemal

Former Member
0 Kudos

I don't understand: What do you mean by "is requested"?

Any user interaction that involves application code must use actions and server round-trips, at least in the HTML client.

Armin

Former Member
0 Kudos

Hi Armin,

I mean which UI-Element is affected or selected by the action e.eg. if I want to filter columns of table.

How do I know which column the user is actually filtering or which Tab he has selected?

Cemal

Former Member
0 Kudos

Concerning the tab selection:

There is an event TabStrip.onSelect with parameter "tab" that contains the ID of the new selected tab.

See Javadoc

https://media.sdn.sap.com/javadocs/NW04/SP12/webdynpro/com/sap/tc/webdynpro/clientserver/uielib/stan...

To transfer the event parameter into an action handler parameter, use the so-called parameter mapping.

Search this forum for "parameter mapping", you will find many posts that explain this. Or read Chris Whealy's book.

For events without parameters, you can attach fixed value parameters.

Example: An input field has an onEnter event. If you "wire" different InputField.onEnter events with the same action, you can attach constant parameter values to identify the event source.

See:

IWDInputField.mappingOfOnAction().addParameter(name, value).

Alles klar?

Armin

Former Member
0 Kudos

Hi Armin,

Thats it what I need.

Thank you.

Cemal

Former Member
0 Kudos

Hi again,

the tip for parameter mapping was very helpful,

but it seems to be not enough to solve my problem.

Now the problem i currently have is that I don't have the info about the table column the user filter on it.

The class IWDTable has an event onFilter which has no parameters.

How can I get the info in the onFilter-Action method which column is to filter?

I tried the following in the wDoModifyView-Method:

final IWDTableColumn[] columns = table.getColumns();

for (int i = 0; i < columns.length; i++) {

IWDTableColumn tc = columns<i>;

// tc.mappingOfOnAction().addSourceMapping("column", tc.getId());

table.mappingOfOnFilter().addParameter("column", tc.getId() );

}

But in this case only the last column is mapped to the key "column". And I don't know yet which column it to filter.

Is it possible to get the id of the "selected" column, the column which is to filter?

Cemal

Former Member
0 Kudos

Pressing the filter button should filter the table rows according to the content of all filter fields.

To determine which filter fields are non-empty, you have to loop over the context attributes that contain their values.

Armin

Former Member
0 Kudos

Hi,

yes, this is the only available possibility to do this.

Thank you for your helps.

Cemal

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Hint : We can use parameter mapping in actions for this.

@All : Please correct me if i am wrong.

Regards, Anilkumar

Former Member
0 Kudos

Hi,

In that case it will be restricted to a particular type of UI element ...Isn't it ?

Say if there are 5 links we can get the link id to differentiate which one is clicked..

For different UI elements this wont work..

I think ...I understood anil s statement correctly !

(Oops ! a lot of post inbetween anils and mine ! )

Regards

Bharathwaj

Message was edited by: Bharathwaj R

Former Member
0 Kudos

Hi,

In this case you can go for Context Programming.

I mean you can bind the attributes of UIElements to contextattributes and you can access the values through context attribs.

Regards, Anilkumar