Forums

Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Lee Chamberlain
Autofields - iteration number
December 7, 2016 5:40 AM
Answer

Lee Chamberlain

Rank: Junior Member

Posts: 92

Join Date: May 5, 2016

Recent Posts

When I'm using Autofields is there an easy way to get which iteration of the field is? (IE a #3 for the third clone of the form fields I'm duplicating).

I need to perform a calculation (with jquery) on some of the fields, but can only perform it on the original fields at the moment.

Thanks
Lee
Byran Zaugg
RE: Autofields - iteration number
December 20, 2016 12:12 PM
Answer

Byran Zaugg

LIFERAY STAFF

Rank: Regular Member

Posts: 239

Join Date: April 5, 2012

Recent Posts

I don't believe this is supported out-of-the-box.

You might be able to get something from the private property _guid, as it increments as you add rows. Not sure about that though.

You could also extent AutoFields, with your own component, and override the method addRow(), to add some count reference. But this may get messy, because you also may need to code for removeRow(), and sortable rows.
Byran Zaugg
RE: Autofields - iteration number
December 20, 2016 12:14 PM
Answer

Byran Zaugg

LIFERAY STAFF

Rank: Regular Member

Posts: 239

Join Date: April 5, 2012

Recent Posts

Here's the source for reference. auto_fields.js
Lee Chamberlain
RE: Autofields - iteration number
January 9, 2017 6:29 AM
Answer

Lee Chamberlain

Rank: Junior Member

Posts: 92

Join Date: May 5, 2016

Recent Posts

Thanks

I'm also now having problems with datepickers in the autofileds.

I'm using liferay-ui:input-date but whenever I try to use the datepicker in the automatically generated field I'm not able to, and it just remains set as mm/dd/yyyy

Is this a known issue too?

Lee
Byran Zaugg
RE: Autofields - iteration number
January 11, 2017 4:13 PM
Answer

Byran Zaugg

LIFERAY STAFF

Rank: Regular Member

Posts: 239

Join Date: April 5, 2012

Recent Posts

That sounds like a bug.

Could you file a ticket with detailed reproduction steps?
Lee Chamberlain
RE: Autofields - iteration number
January 12, 2017 1:17 AM
Answer

Lee Chamberlain

Rank: Junior Member

Posts: 92

Join Date: May 5, 2016

Recent Posts

Byrån Zaugg:
That sounds like a bug.

Could you file a ticket with detailed reproduction steps?



Unfortunately I don't have an account to raise such an issue.
Byran Zaugg
RE: Autofields - iteration number
January 12, 2017 9:32 AM
Answer

Byran Zaugg

LIFERAY STAFF

Rank: Regular Member

Posts: 239

Join Date: April 5, 2012

Recent Posts

Please write detailed replication steps, with code examples if necessary, here than. I'll create the ticket and share the link here.

FYI, if you sign-up for a Jira account, you'll be able to track the progress of the ticket easily.
Lee Chamberlain
RE: Autofields - iteration number
January 23, 2017 2:43 AM
Answer

Lee Chamberlain

Rank: Junior Member

Posts: 92

Join Date: May 5, 2016

Recent Posts

I've got a datepicker working now.


I'm still having issues with getting an iteration number so I can do JQuery calculations on fields.


Thanks
Lee
Lee Chamberlain
RE: Autofields - iteration number
January 23, 2017 7:39 AM
Answer

Lee Chamberlain

Rank: Junior Member

Posts: 92

Join Date: May 5, 2016

Recent Posts

Is there any documentation on this? The lack of available information to help me work this out for myself is astonishing.

I am writing a shopping cart, for each row of items (which I'm using auto fields for) i need to multiply the quantity with the unit cost and populate a third input with the total.

There is nothing available online to show me how to identify each clone of the item row in order to make the calculation possible
Byran Zaugg
RE: Autofields - iteration number
January 30, 2017 6:28 PM
Answer

Byran Zaugg

LIFERAY STAFF

Rank: Regular Member

Posts: 239

Join Date: April 5, 2012

Recent Posts

Lee Chamberlain:
Is there any documentation on this? The lack of available information to help me work this out for myself is astonishing.

I am writing a shopping cart, for each row of items (which I'm using auto fields for) i need to multiply the quantity with the unit cost and populate a third input with the total.

There is nothing available online to show me how to identify each clone of the item row in order to make the calculation possible


You are correct. Our documentation is lacking.

We are working on improving our coverage. Infact, your forum post initiated a ticket for this specific module.


It needs additional content, and is still in review. But we hope, over time, our documentation meets the needs of developers like yourself.

You can see the current, in progress, doc here: https://github.com/mwilliams2014/liferay-docs/blob/50ff0754f57e65255e16c67055364511cf4bf7d6/develop/tutorials/articles/244-liferay-js-api/using-liferay-auto-fields.markdown