How to display combobox only under the lightning-input field which has a User Action? - lightning

I have a JSON which I have extracted. There is a field under the node 'NumberBlockDetails' under that, there is a field 'AreaCode' which is displayed as iterated. Currently based on the iteration, that field 'AreaCode' is displaying four times. It is based on one lightning-input condition only. But now as the user edits any one, the combobox is displayed under all 4 fields of Areacode. How can I display it only on 'Areafield' which has a user Action (like Onchange).
````<ul key={num}>
````<lightning-input type="text" label="AreaCode" value={userValue}> </lightning-input>
````<template if:true={flagValue}
````<lightning-combobox
````name=""
````options={}
````</lightning-combobox>
````</template>
````</ul>
````</template>
Currently for all 4 it is displaying when user clicks inside the field, how to show only under the field which is currently in action by the user for the same <lightning-input> field.
Can anyone suggest on this

Related

Angular 7 Multi field filter

I have 8 input fields. The required fields are only 5. Also have the submit button, filter and clear filter buttons. For form submit all required fields are necessary to submit but for filter functionality all required fields are not necessary. Suppose I've entered the values in two required fields and two other fields then click the filter button. Fetch the entered values from the API. And show in the data table.

Rails: disable input tag upon selection from a dropdown menu

Scenario/Context
I've got a drop down menu with two input elements underneath.
From the dropdown menu, are names of companies (with values set to the respective company id's), and another prompt to Add a new company.
If the option to Add a new company is selected from the dropdown, then the user is to fill out the 2 input field elements (i.e. company name and company email).
Otherwise, if an available company is selected from the dropdown,
then the 2 input fields (for company name and email are to be disabled).
My question
Is this possible to do without an AJAX call if I want things to happen without a page refresh?
Can anyone suggest some other alternatives??
Many thanks!
That is absolutely possible, though you'd need to use some JavaScript to make it happen and load a bit more data to the DOM on the initial page load.
For each option in your company select dropdown, add a data attribute for the name and email.
Then, watch that dropdown for the change event in JavaScript. Whenever that event is fired, if the data-company-name and data-company-email attributes are defined for the selected option, disable the input fields and populate them with those values. If those data attributes are not defined for the option (likely only for your 'Add a new company' option), then clear the values from the input fields and enable them.

Weird behaviour of two option set field in the BPF

I'm facing one weird problem on the Contact entity. I do have one check box type field on the Contact form. When user selects (ticks) this checkbox at that time I'm making one field as mandatory in the BPF. This is a two options (yes/no) field on the BPF.
The problem is when on click of the checkbox on the form, the BPF field displays "click to enter" text, not sure why it is showing this text on the field.

Validate and show validation message one by one

I have a page with 3 input fields with required attribute on each of them. If I click submit without entering any values in them, I get 3 messages on my page all at once. Is it possible to check for the fields in sequence and display messages accordingly?

Joomla: editable list screen

I have a joomla site where users can log in. Once logged in, a user can display a list screen -- say, a contact list with a name column and a phone number column. I call it a list screen, but I guess it could be called a list view, grid view, etc.
I'd like to make one of the columns (say, the phone number column) editable in place; meaning, I don't want to force the user to open a contact editing form. Thus, in the phone number column, a text box should be displayed on each line. The textbox contains the existing data for that row. The user can change the phone number in the text box directly in the list screen, and then press some 'save' icon on that row to save only that row (and only if it has changed). It'd be nice if the saving was done with an AJAX request, but it'd be ok to submit a form for now.
Based on the 'list screen' in the book "Learning Joomla Extension Development", I can currently display the correct list of items for the user. Does any one have example/tutorial of how to do the saving of each row individually? It seems like all list screens that I see have a link which must be clicked to open an edit form, as opposed to allowing editing in place.
Thanks
You have to write a component first. Which will basically do the saving part of the individual row. So basically your component URL takes parameter as row_id phone number etc and have a update query updating the database.
Second is you need to write a javascript function which is called on click of every save button. The javascript function reads row details by reading from the DOM. and then fire an ajax request to the above mentioned component. the URL to the above mentioned component should have format=raw.
The result from the component update queries can be returned as true or false. And accordingly read by javascript ajax response. based on which A flag could be shown saying row updated. I can help you with code further if you describe it in more details

Resources