How to set width to InputText in ADF - oracle-adf

I have ADF application, which is a film database. I have a big problem with settings ADF component af:inputText.
I tried a lot of different width settings of the various components, but I always failed.
There are pictures...
You do not know how to do it please? Thank you.

Set the contentStyle
Example: contentStyle="width:240px;"
(Setting inlineStyle only adds CSS to the wrapper span - which is an inline style, so cannot set a width.)
It's also worth setting simple="true" to remove other styling emitted by the control.

If you are using ADF BC then by default the width will be the number of character in your database, for instance if you have VARCHAR2(255) then your text box will have 255 columns.
2 Ways you can solve this:
From the Entity Object, Select an Attribute and in UI Hints and change the width to suite the number of characters you want - 70 seems good width.
From the page itself, change columns attribute of inputText to whatever you want - Still 70 should look ok

You don't give the data source, but assuming it is coming from a VO via a Data Control,
Find the VO that is the basis for it, and select the attribute and change its display width property in the UI hints area.
If not a VO, then indicate the source of the data for further help.

i think width / height of input components can be set using CSS as well. you can try setting content style property to value something like :
width:100px; height:15px;
By default, width will come through EL expressions from width values set as UI hints for ADF BC objects.
you can edit input text component size / appearance using rows / columns properties as well.

Possible solution is to change the number of Columns.
Select the TextBox you wan to change its width.
Go to the Property Inspector
Under Appearance, Change the Columns property based on what is good for you.
hope That's help you

Go to the Entity Object
Select attribute, give the DisplayWidth What you want
Later give contentStyle="width:240px;"

Try using Panel Grid Layout as shown
Select the TextBox you want to change its width.

Related

How to Conditionally Size Columns to Fit in Ag-Grid

We are currently using this prop in ag-grid.
onDisplayedColumnsChanged={event => event.api.sizeColumnsToFit()}
It is helpful for preventing whitespace from showing up when we hide a column, as well as keeps horizontal scrolling to a minimum when we unhide a column. We also use it for similar reasons when grouping on a particular column(s).
Unfortunately, it prevents us from using other features of Ag-Grid, such as selecting the option to resize a column to fit its contents. It also prevents columns that have been manually resized from keeping their size when they are moved somewhere else on the grid.
Is there any way to check for whether a column is being added/removed/grouped? the event object provided by the onDisplayedColumnsChanged prop only exposes the columnApi, api, and type properties. I haven't found anything useful in those so far.
I've considered creating a useEffect that will sizeColumnsToFit when the gridApi changes, but I believe I hit the same issue there with not having any useful properties to trigger the effect.
You can tell AG Grid columns to ignore sizeColumnsToFit() by setting the property suppressSizeToFit to true:
https://www.ag-grid.com/javascript-data-grid/column-sizing/#size-columns-to-fit
You can set the property on-the-fly by listening to one of the column events where auto-sizing should be disabled:
https://www.ag-grid.com/javascript-data-grid/grid-events/#reference-columns

Winforms PropertyGrid per-GridItem row height

I'm using the Winforms PropertyGrid; the target of the SelectedObject includes a property of type Image. Everything is fine, except that with all items the same height, the image is too small to see properly. I'd like to have some control over the height of grid items such that the image can be displayed a bit larger. One other detail is that the SelectedObject of one PropertyGrid control may be assigned an object of any of a variety of different classes (which may or may not have image properties), so I'm hoping the height can be driven by data in the instance of the SelectedObject itself, rather than making it a static behavior of the control, although I'd settle for a custom attribute of the image property to make the item height at least class-specific if it can't be instance-specific.
How can I do this? Custom attribute? PropertyGrid event? Something else?
As Simon commented on your question, this is not possible to have a custom height for a GridItem.
You have 2 solutions to be able to show an image with a reasonable size:
You can code your own UITypeEditor. That way, the user would just click the down arrow and see a nicely sized image in the dropdown box.
Sorry for the plug but I think it directly answers your question: only 3rd party PropertyGrids may allow you to get variable size rows in the grid. Smart PropertyGrid.Net is one of them. You set a HeightMultiplier to the row so that it expands on let's say 4 rows. Then you code your own Look class that handles the drawing of the image the way you want in this space.

Silverlight RadGridView change TextBox background

I am facing a small problem using silver light . I have a RadGridView, with four columns. My second columns contains text boxes and the third column contains validation errors. If the third column contains validation errors, i want the second column background to turn red. How can i do this. I have tried binding the text box background column to a string with the desired color but that does not work. Really stuck here. Any help with be much appreciated.
Regards,
Mateen
Assuming your binding is otherwise valid, you cannot change colour by binding to a text string of a colour. The background property is of type Brush.
You need to either bind to a Brush instead, or use a brush/colour converter to return a Brush instead of a Color/string etc.
Try these links for converter examples:
http://forums.silverlight.net/p/20392/70263.aspx
http://forums.silverlight.net/p/20392/70263.aspx
You need a StringToObjectConverter found here. This class has the advantage that it has wider uses that eliminate the need to create a plethora of similar converters.
Further rather than having the bound object have a property called "Background" which tell the UI to "be red". I would be better that the Model had a property called "Status" which is an enum of the possible states the object is in.
Going further and looking at your specific requirement it would be better that your model exposed a boolean IsValid property which a converter could be applied to. See this blog on a generic BoolToValueConverter.

How do I adjust the size of the dropdown portion of the a combobox with PyQt

I'm creating a program where the width of column needs to be relatively narrow, but when I add a combo box I have to increase the width so that I can read the listings in the drop down. I know that in HTML the drop down adjust to the length of longest entry, in Iron Python you can adjust the drop down width manually, but I can't seem to find any reference to either of these options in PyQt. If I'm missing it in the documentation, a friendly pointer to the right spot would be of great help. Thanks.
The dropdown portion is a component that inherits QAbstractItemView (usually QListView).
It is accessible via the view() getter of the QComboBox. You can play with its sizePolicy to get what you want.
If it is not satisfying, you can even set your own QAbstraItemView to the QComboBox via `setView'.
In Qt a widgets size is usually controlled by its layout. The layout management docs should help. In particular, take a look at QSizePolicy. If you're using designer, you can set these directly as properties, otherwise you'll need to do it in code. The basic layouts example may help as well.

Placing of components in Silverlight

I wanted a bit of advice.
I want to have a placeholder for an image (the image changes at the users will) and I want a placeholder for some other component.
Now, I have to interchange the z-index of these components so that some time the image is on the top and some other time the second component is on the top.
I am building the interface in Silverlight. This is a newbie question. Can anyone please suggest me, which component should I use as-in canvas, grid etc. that could facilitate the easy switching of the z-indices of the 2 components.
Thanks for your help.
Both Canvas and Grid honour the Canvas.ZIndex attached property, so either will do. However a more elegant approach might be to use the Visibility property to show / hide the placeholder elements.
i.e. when you want to hide your placeholder use the following:
placeholder.Visibility = Visibility.Collapsed
This is better than using Z index in my opinion

Resources