I dynamically build a pick-list with a collection I retrieve from a table, using "collection_select".
I would like to color differently the list items, according to an attribute from the collection, ie :
black if they're available /
grey if they're not.
How can I do this ?
Thank you for your help
I found out by myself. I use the parameter
:disabled => << sub-collection >>
Related
I'm working in an old project creating a User Control to add code that will change as I need.
I'd like to add a list element but I only found the property to create list type of <select> using <asp:ListBox, but this is not that I'm looking for
Do you know how generate a <ul><li> elements using Global.System.Web.UI.WebControls? or at least modify its CssClass properties since my VB code. It'd be amazing if I can use a loop to generate the list items.
Thanks in advance
One solution would be to add a BulletedList in your WebForm.aspx:
<asp:BulletedList ID="BulletedList1" runat="server"></asp:BulletedList>
Then in your WebForm.aspx.vb you can add items:
For i As Integer = 1 To 3
BulletedList1.Items.Add("item" & i)
Next
If you inspect your page in a web browser you will see these are equivalent to <ul><li> HTML tags.
Im working on a squish based test and try to get decent (visible) items from a QML ListView that are deeply nested that i just can't pick due to its dynamic behavior
I've get the list itself by using waitForObject with a object map name
There are several nested items in the list an i want to get all occurrences of the MyTypeCCC_QMLTYPE_72 when property visible is true
I've dumped my current class/property child-hierachy:
MyTypeAAA_QMLTYPE_195
children[0] QQuickItem
children[0] QQuickColumn
children[0] MyTypeBBB_QMLTYPE_189
children[0] MyTypeCCC_QMLTYPE_7 visible(true)
I've found this in the Squish-KB: https://kb.froglogic.com/display/KB/Example+-+Finding+child+objects+by+type+and+property+values
so i can write my own search code traversing the tree etc. but i think that could(should) be an easier solution?
can i rely on the exact hierarchy? (but what i the UI design changed another time)
i could maybe add ids to the MyTypeCCC_... if that helps
I've got several of this list with different types/nesting and i hope to find a easy solution that works for all/many of the case
any ideas?
ListView is a subclass of Flickable and all its delegates are immediate children of ContentItem, you can safely iterate over its children to get all list items, but be aware that not all of its children are list delegates, so you have to filter them, e.g. by type. To find nested elements just search for them inside list item, i.e. use list item as a container. To create container locator you can use its coordinates (these are coordinates within the list, so they will be unique). Code may look like this:
list_view = findObject(list_locator)
nested = []
for i in range(list_view.contentItem.children.count):
item = list_view.contentItem.children.at(i)
if className(item) == 'MyTypeAAA':
netsed.append(findObject({'container': {'x': item.x, 'y': item.y, 'type': className(item)}, 'type': 'MyTypeCCC'}))
I have to look at an application which I can't use the normal selectors (like "id", "name", etc - this is a design flaw) but I do have a custom tag which has been applied to elements on the page:
test-tag='x'
and this is fine, I can interact with this using (simple script)
var tag = '[test-tag="x"]';
var selector = $(tag);
However, I have now found that some elements (notably textboxes) have a title and a box element - both have the same custom tag applied. Now the text box is an input type. Anyone know how I can change the above to target specifially input types?
try this:
'input[test-tag="x"]'
for the input box
Take a look at this as well:
https://www.w3schools.com/cssref/css_selectors.asp
I have some text field page items on my APEX 5.0 page and I want to make the textboxes as read only/non-editable. During the page load I want to use these text boxes for only the data display on the page and should be non-editable.
Can somebody advice on how to do that? What attributes need to set for this?
This answer is a bit late to the party, but I found myself confronted to this problem and I wanted to share the solution I came up with.
In fact you just need to create your item as a text area, let say P1_Text_Area and you give it a readonly attribute using JavaScript. Write thoses 2 lines in the "Function and Global Variable Declaration" of your page:
var disItem = document.getElementById('P1_Text_Area');
disItem.readOnly = true;
Hope this helps someone in need.
in item properties find the
Read Only group
and set Read Only Condition Type as Always
or the option that suits to you
You can use disabled + save session state ==> read only
I have a zend form which is using a view script. I want to get access to the individual radio button items but I'm not sure how to do so. Right now, I just print them all out using:
echo $this->element->getElement('myRadio');
That prints them all out vertically. I need a little more control. I need to be able to print the first 5 options in one column then the next 5 in a second column.
I have the same issue. There is no nice way to do this that I have found (circa ZF 1.10.8)
Matthew Weier O'Phinney had some advice on this page:
http://framework.zend.com/issues/browse/ZF-2977
But I find that approach cumbersome in practice. The original poster on that ticket had a good idea, and I think they should ultimately incorporate some nice way to do this along those lines.
But since there is no better way at the moment, I just follow Matthew's suggestion for now.
For my form I was working on, to render just one single radio button out of the group, I had to do this:
In my form class:
$radio = new Zend_Form_Element_Radio('MYRADIO');
$radio->addMultiOption('OPTION1', 'Option One')
->addMultiOption('OPTION2', 'Option Two');
$this->addElement($radio);
In my view script, just rendering OPTION1:
echo $this->formRadio(
$this->form->MYRADIO->getFullyQualifiedName(),
$this->form->MYRADIO->getValue(),
null,
array('OPTION1' => $this->form->MYRADIO->getMultiOption('OPTION1'))
);
That will render a <input type="radio" /> element, and an associated <label>. No other decorators will be rendered, which is a pain.
For your case, you will probably want to render your radio elements and other elements using the ViewScript view helper - so you can line all of the elements up amongst your own custom table markup as you described.
Figured this one out too. Just use
$this->element->getElment('myRadio')->getMultiOptions();
and it will return an array of the key/value options.