on 01-22-2006 10:59 AM
Hello,
I've created a UI dynamically using this code:
IWDTextView t = (IWDTextView) view.createElement(IWDTextView.class, null);
and I would like to set it's alignment at the screen at the right corner (the default is left). I beleive I need to use the method bindHAlign but I don't know how to use it. Can anyone please show me code example?
Roy
Roy,
Try to do this statically first, i.e. inside view's layout designer.
If it is impossible using designer, then it is a WebDynpro bug, if designer view and run-time view are different, then it's either a WebDynpro bug or locale issue.
Valery Silaev
EPAM Systems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Put the TextView inside a MatrixLayout, set TextView.layoutData=MatrixHeadData with hAlign=WDCellAlign.FORCED_RIGHT.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IWDTransparentContainer c = (IWDTransparentContainer) view.createElement(IWDTransparentContainer.class, null);
c.createLayout(IWDMatrixLayout.class);
IWDTextView text = (IWDTextView) view.getElement("<ID>");
IWDMatrixHeadData layoutData = (IWDMatrixHeadData) text.createLayoutData(IWDMatrixHeadData.class);
layoutData.setHAlign(WDCellAlign.FORCED_RIGHT);
c.addChild(text);
Armin
Hi,
Assuming it is not resolved due to some unknown error..
U can still create a transparent container statically..
set its height and widtha and align it wherever necessary,..
and while u r creating ur UI elements which u want to align to right.. add them to this container.
so.. u will acheive that effect..
This will save a lot of dynamic UI code..
I prefer this is most of the scenarios.. and u can always say it will work in the manner u want to..:)
Rgeards
Bharathwaj
Hi,
Thats strange..
Let me assume i start with a clean view.
I have the RootContainerUI element, i will set its width to 800.StretchHorizontally to false.(No reson for this).
Now i will create a gridlayout or a matrix layout..
Grid - with 2 columns.. First a invisible element of say width 600. Then a transparent container,of width 200.
Now i will add the dynamically created elements in this container..
Works fine ?
Regards
Bharathwaj
Very sorry. One small problem with the screen shot.. Its the part2scroll container..i get it.. but i cant fine it in the view.. is it the one set with the value "b".. and in you right to left applciations.. isnt the placing of UI elements the reverse direction.. ?
And can u add a inivisible element.. whch u have not added till now and set its width.. !
Message was edited by: Bharathwaj R
Hi Roy,
I haven't tried this, I've just had a look at the API but have you tried setHAlign(WDInputFieldAlignment.FORCED_RIGHT)?
Patrick.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Strange one. I don't think though that bindHAlign is going to help since it just binds the hAligh property to a context attribute that you'd then have to set to one of the WDInputFieldAlignment values, such as FORCED_RIGHT; which we already know doesn't work.
Have you tried WDInputFieldAlignment.BEGIN_OF_LINE, that should push the UIElement to the right if you're settings are Right to Left, which I suspect they may be.
Strange one indeed.
Patrick.
EDIT: You may as well try all of the WDInputFieldAlignment.FIELD values just to rule out any left to right / right to left issues. WDInputFieldAlignment.CENTER should be a good one to rule out those issues.
Message was edited by: Patrick O'Neill
Hi Roy,
>But why using an WDInputFieldAlignment when I build lables and text fields?
For IWDTextView, like you originaly asked about, the hAlign property wants a WDInputFieldAlignment.FIELD value.
IWDLabel objects don't have an hAligh property, but a TextDirection, which wants a WDTextDirection.FIELD value.
It could be related to the container type that you have your UI elements inside.
Patrick.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
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.