I assign an associative array values to my view in the action controller.
<f:debug>{values}</f:debug> outputs the following, which means, the data is in the view.
array (3 items)
63 => 158 (integer)
49 => 0 (integer)
164 => 0 (integer)
In my fluid template I have a loop over some items. In that loop, I create select fields with the f:form.select viewhelper. The form is not bound to an object, I can not use the property argument. But I want to reflect the current (last selected) value of each of the select fields.
Each select is named filter_{loopItem.uid}.
<f:debug>{values.63}</f:debug> outputs 158 (integer) wich is correct, too.
If I set value={values.63} in the value argument of the f:form.select viewhelper, the corresponding option is selected in filter_63.
What I want to do, is use the uid as index for the filters array, so that I can write something like value={values.{loopItem.uid}} and the select selects the corresponding option. But this does not work, debug outputs NULL.
{values.63} with a constant 63 works fine.
Even an alias mapped {index: loopItem.uid} with {values.index} results in NULL.
How can I substitute the fixed 63 by a variable value based on the loopItem.uid?
This is only possible out of the box with TYPO3 8 or you can try VHS https://viewhelpers.fluidtypo3.org/fluidtypo3/vhs/5.0.1/Variable/Get.html
Related
I'm trying to populate my combo box in a form, based on another 3 combo box selection in another form.
I have managed to work it out with one problem.
The code I'm using is:
Private Sub Command715_Click()
DoCmd.OpenForm "SCPrices"
Forms!SCPrices![QuoteRef] = Me![Quote Ref]
Forms!SCPrices![Combo285] = Me![Scope 1] & Me![Scope 2] & Me![Scope 3]
End Sub
It does work fine, however it brings the value of the 3 other combo box as 1
e.g:
Scope 1 selected as CCTV,
Scope 2 selected as CAD,
Scope 3 selected as Survey.
and I get the Combo285 value as "CCTVCADSurvey" instead of individual choice.
What should I use instead of & sign in the code to get the wanted result?
Thank you for any help
In MS Access, '&' will just concatenate values. If you are looking to create a value list to populate a combobox, then the values must be concatenated, but also separated by a ';'. You may need to wrap your values in Cstr() if they are somehow not strings.
However, you cannot just set a combobox to be a string, Access will not convert this to a valid rowsource, you will just get one value consisting of the string you have defined.
To set the rowsource you must specify the rowsource property itself. Something like this should work, although personally I would pass the values via OpenArgs for use in the form being opened (generally because I am doing much more with the values then just setting a property).
But, this approach works too:
Forms!SCPrices![Combo285].RowSource = Me![Scope 1] & ";" & Me![Scope 2] & ";" & Me![Scope 3]
I'm trying to select the second option in a <select> tag with the DOMCcrawler. First of all, I select the second form in the page:
$form = $DOMCrawler->filter('form')->eq(1)->filter('input[type=submit]')->form();
Then I could change each value of the form by:
$form['value'] = "new value";
but I don't have a fixed key for each value. Instead, I have a variable number. E.g. I could have something like:
$form[1234];
but also could be
$form[4321];
depending on other variables. So I need to change the form values without knowing the key values, but its position in the node <form>. E.g. something like $form->firstKey();
Also, I want to select the second option inside <select> tag, not a fixed value. Any ideas on how to achieve it?
I have a select_list that gets populated in runtime. I need to select a value based on the item index.
Eg.
self.myselectlist1.option(indexval).select
If the indexval I pass is 3, it should select the third item.
The above code errors out. Is there an alternate way?
Assuming that myselectlist1 is the name of a select list defined in an accessor, you want:
self.myselectlist1_element.options[0].click
Explanation:
myselectlist1_element is used to get the select list element.
options returns an array of option elements for the select list.
[0] returns the first item of the options array
click clicks the option to select it. There is no select defined for options (ie you will get a deprecation warning).
You have 3 issues:
The method you're looking for is "options" not "option"
Use brackets instead of parenthesis.
use click instead of select.
myselectlist1.options[indexval].click
I have a form in VFP 9 that is usually called from another form with 2 parameters.
I've got a strange thing happening: when I execute DO FORM jobless_add in command window, the first parameter is always set to "2", while no parameters were added.
As a result, I have EMPTY(par1) == false and EMPTY(par2) == true. After that I've tried to open the form in the normal way (from the other form's button click with 2 parameters) and I've gotten this result in debugger
This is my first visit, so I cant insert images. Link: image
(hint: Locals: all ok, Watches: "2" again)
NOTE: I have no global variables yet.
You most likely have a table with a field/column called 'jobless_id'.
To clarify further, a table's field takes precedence over a memory variable if you reference just the unqualified field name. Try "m.jobless_id" to explicitly reference the variable (i.e., the parameter).
print $tree->findvalue('//a[1]');
I am using HTML::TreeBuilder::XPath in perl. Now i expect the above statment to return the value of second "a" element but instead it returns the value of all "a" elements in the page. I cant understand Why?
what you have shall return first a-child of every element.
so //a[1] will work as follows (result will be 2 nodes):
X
Y
a <-- give you this
a
Z
a <-- and this
a
try (//a)[1] instead
That XPATH expression looks for all a elements at every level of the document and the predicate filter selects the first a at every step.
So, depending on how your XML is structured, you might not get every a element (if there were more than one a that were siblings, you would only get the first one of those siblings).
However, if you intended to just select the first a in the document, you could use this expression: (//a)[1]
Wrapping the selection of //a in the parenthesis creates a collection that the predicate filter is then applied, selecting the first in the collection, rather than the first a encountered at each step of the //.