Dynamically add multiple instances of the same model to ActiveForm [closed] - ajax

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a form that uses multiple of the same model. When the user clicks "add item" it creates a new row (in this case a elements of a 'model') to ActiveForm. This is important in cases when you have a form where the amount of items needed to be added are unknown and rather than have the user navigate multiple pages I would like to use one form. I found a way to save these elements but currently my method (I'm using renderAjax()) loses its client validation for the new elements.
I would like to know if anyone has had experience in using ActiveForm and Ajaxing in new form elements from models and still retain client validation.
Thanks in advance.

Not exactly a cookie cutter method like some JS frameworks but this works.
Clone this attr:
$('#someForm').yiiActiveForm('find','id');
Then modify and add to ActiveForm:
$('#someForm').yiiActiveForm('add', cloned_attr);
I'm not exactly sure if I messed something up or if its intended this way but validation is working now.

Related

Using Oracle APEX, how do I accomplish these tasks (customizing a simple SQL report)? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I need to make the following customizations to a basic APEX database-table dump :
The user also needs to be able to edit the data displayed in the grid.
The user needs to be able to add new rows to the grid and enter values
Above each column heading there needs to be a text field where the user can enter a value
To the right of the data grid, there needs to be a search button that will re-display the data in the grid using the values entered above the column heading. If there fields are blank all possible values for that field should be returned
There should be a save button on the page to allow the user to save data they have entered/ updated in the grid
I wanted to know about whether these were possible with APEX, and how do I accomplish these.
It sounds like you are looking for something like an Interactive Report:
http://www.oracle.com/technetwork/developer-tools/apex/application-express/irrs-083031.html
( I know linking to another site with the answer is sometimes frowned upon but there just isn't enough room here for a complete tutorial ;) )

Need to render a joomla component view on every page [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am really new to Joomla and can't solve the following problem:
I have a component installed which renders a small form. I can create a menu, and create a menu element which links to the component view (some links from the component appear and I just have to select them).
The problem is that I need that form to be rendered on every site page and after trying many solutions I still haven't found any reliable solution to do so.
usually each page can render one specific component so for example if you mean rendering your component on page than show single article( that use com_content component ) you can't. see if your component have any module and use it for those situations

mvc where to format strings in controller or in aspx page? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am new to MVC with C#. I need to format strings in different ways. Can you please guide which place is best to do that, control actions or aspx page ?
For formating data which will be display to user, always the best choice is View. It is by definition of MVC
A view requests from the model the information that it needs to
generate an output representation to the user.

How to stay MVC!! :) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I am very new to coding but I am striving to maintain a MVC design pattern at all costs!
I have an app whereby a tableview is selected which pushes to a new tableview. The plist and dictionaries are dealt with in the model class and it returns an array which populates the tableview. When one is selected, do I send that information to the controller than make some sort of query to get the next array, because I believe I can't go from view to model? I've heard of NSNotification, should I set that up somehow so that the model 'knows' what is selected?
In your case, it's perfectly fine to pass along the model data directly to the next tableview. In this case, the controller that manages the first tableview is going to pass the model data to the next controller (the one being pushed one if you're using a navigation controller). That's totally fine from an MVC perspective, and a really common way to do this sort of thing.
From an MVC perspective, all the application logic should reside within the controller itself. Now decide for yourself.
What you want to do is not very clear to me though.

How to implement CrateAndBarrel.com alike shopping-cart? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
We are looking for approach to implement shopping-cart that keep shopping items at the bottom of the page, just like CrateAndBarrels
http://www.crateandbarrel.com/family.aspx?c=837&f=28291
The visitor should be able to add shopping item to the cart by clicking the item's "+ Add to Cart" button. From my understanding, for CrateAndBarrel the bottom shopping-cart is indeed a flash object. However, I wish we could find a way to implement this in ajax-fashion if possible.
We are not expert in anyway in web 2.0 stuff and looking for some guide to implement this feature. Our consultant suggest we use frame to implement this though.
If you were me how would you implement this feature ?
A. Plain WebForms page
B. Use Frame or IFrame.
C. HTML and Flash, just like CrateAndBarrel
D. AJAX
Some simple explanation on how those components should collaborate will be appreciated.
I would definately go with AJAX. Look at jquery or one of the other frameworks to help you do most of the work.
I would create a method to draw the bottom panel. This would then be called when the page loads, with an asynchronous call to get the cart contents. When the user adds an item to the cart, you could either refresh the page (which would re-draw the panel) or call an update method to redraw the cart contents.
1) Personally I would use Ajax (and I am pretty sure CrateandBarrel must be doing that, and using Flash just to render the basket) - weirdly although my Firefox is up to date it won't let me use their site in that)
You can then render the basket with an absolutely-positioned DIV at the bottom of the viewport.
You could use a frame, but I think an absolutely positioned DIV would be a better solution.
(2) As Adam Pope says, when an item is added (via Ajax) the basket can be redrawn (maybe a JSON call to get the basket contents?).
And definitely use a javascript framework.
Edit: And remember to let it degrade gracefully for anyone who does not have javascript!

Resources