cancel
Showing results for 
Search instead for 
Did you mean: 

Consistent looking UI

0 Kudos

Hi,

imagine we are building a webdynpro application that

will contain 50 input forms. A goal is to provide

consistent look across all forms. For example:

each form has to have a centered/bold title on top

with gray background. Additionally, each form will

have an "OK" button and a horizontal line at the bottom.

The action of "OK" button, however, should be specific

to a concrete form.

If the requirements change and the title has to be left

aligned (instead of centered) or the title has to be removed completely,

ideally, we would like to do the change on one place only

and affect the look of all 50 forms.

The goal is to do as much formatting as possible at

design time using visual editing and to avoid repetitive

work as much as possible.

Which technique would you advise?

regards

Sasa

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Try the following approach:

1. Create WebDynpro component interface IInputForm. Define necessary context, methods, windows here

2. Create WebDynpro components that implement IInputForm.

3. Create WebDynpro component FormTemplate, that has component usage of type IInputForm. Setup necessary context mapping, embed one of IInputForm interface views into FormTemplate view. FormTemplate provides header, footer, actions etc.

4. At run-time create concrete implementation of IInputForm [2] inside of FormTemplate.

Regards,

VS

0 Kudos

Hi Valery,

thank you very much for the answer!

I think I understood your idea: define a FormTemplate

which defines common parts (header, footer, actions...)

for all forms and embeds instances of IInputForm that

are implemented by concrete forms.

Since I have been exposed to webdynpro for only 5 days

I am still struggling with the usage of the framework

and I will need some time to try what you described here.

Actually, it would be helpfull if somebody can provide

a code fragment illustrating the step 4:

"4. At run-time create concrete implementation of IInputForm [2] inside of FormTemplate."

I suppose one have to use a ViewContainerUIElement in the

FormTemplate and assign contained view at runtime.

However, looking at the WDF docs and here in the forum,

I could not figure out a way to do that.

regards

Sasa

Message was edited by: Sasa Zivkov

Former Member
0 Kudos

One could construct the static parts with the view designer and define configuration data that are evaluated by code that modifies the view layout.

Then you could get the required changes by providing different configuration data.

Armin

0 Kudos

Hi,

one concrete example would probably help more than

further questions/answers. It would be enough to have an

example with 2 forms where common parts of both can

be controlled/changed from one place.

Actually, what I want to find out is how much can be

achived generically and what (if anything) has

to be done on each conrete form (except defining

the form specific properties).

Is there any piece of code that has to be replicated

or invoked from each concrete form?

regards

Sasa

Message was edited by: Sasa Zivkov

Former Member
0 Kudos

Hi sasa

Well we have a similar situation and we are using Development Components.

Anyway if you are having all 50 forms in one Webdynpro application then you can maintain a properties file which maintains all your properties. You can write a generic method which sets or gets the properties and map the return values to the respective context attributes.

Hope that helps you.

regards

ravi

Former Member
0 Kudos

Hi Sasa

Is each form a separate Component or are they all a part of one webdynpro application.

If they are components under a single app you can use Context attributes to all the properties that you would like to change.

But if they are different development components then you would have to create a component that contains a properties file. Read the properties file and get back the data using get methods in the component.

Now all the other components will behave based on the results sent back by the properties get method.

Hope that helps you. Let me know if you need more information.

regards

ravi

0 Kudos

Hi Ravi,

I am not sure I understood your answer.

All forms are part of one webdynpro application.

I understand that it is possible to use Context attributes

for setting properties but still there is a lot of

repetitive work to do. On each form I would have to

put the title (taking formatting properties from the

context). This means 50 times inserting the title.

If we decide to remove it later or to add an image

into the title then we would again have to repeat the

same task 50 times.

What I was thinking about is to have a kind of base

form that other forms "inherit" from filling in only

missing parts.

regards

Sasa