2sxc - One content-type, one list view, one cshtml, some rows not shown - razor

Using 2sxc to create a new app with only:
- One content type
- 15 rows of data
- One view (razor, single cshtml file)
When I call the #foreach loop, only some of the data is shown in the list view (apparently the ones inserted in the current dnn module and only through the "new" button in the toolbar). If I add the row in the admin panel, it will not show. When I deleted the module and inserted it again, I can see the data in the admin panel, but not in my list view.
Attached screens.
I tried calling the data with:
#foreach(var Content in AsDynamic(Data["Default"])){...}
or
#foreach(var e in List.OrderBy(e => e.Content.Farmaco).Where(e => e.Content.Cat == "1")){
var Content = e.Content;
... }
but the result is the same.
Am I missing something really obvious?
DNN 9.1.1
2sxc 9.04.01
https://drive.google.com/file/d/0B-4bmuuNWVx2MUxxa0g1SExqUkE/view?usp=sharing

Yes, you're clearly not familiar yet with "raw data" and items-assigned to a modules.
In our code you get the module-data with Data["Default"], whereas the raw-data you would get from a query (then also with Data["Default"] or Data["Whatever-Name-Your-Stream-In-Your-Query"])
If you want to work with all data, you would again use a query, or App.Data["TypeName"] and build on that.
Check out http://2sxc.org/en/blog/post/12-differences-when-templating-data-instead-of-content

Related

EXCEL How to change the REST URL based on the cell parameters

I created a web query as below in Excel.
New Queries --> From Other Sources --> From Web
How do I pass in the cell value as a parameter to the Url?
I have search bunch of articles, including in the stackoverflow. None of them work.
There is 1 article says I can do this in VBA.
ThisWorkbook.Sheets("[SheetName]").QueryTables("[TableName]").Connection =
But it is not there.
Any one know how to do this?
More information:
It is connecting to a REST server, and geting back the JSON result.
I found an article discussing how to create a query link mine, but it has not options to add the parameters. Please see the link. Step 3 have the URL typed in.
https://success.planview.com/Planview_LeanKit/Reporting/Advanced_Reporting/030Configure_A_Connection_To_The_Reporting_API_With_Excel
Give the cell a name, e.g. pMyParameter.
Open the query editor and create a new blank query (New Query --> Other Sources --> Blank Query). Give that query a name similar (or same) to the cell name (let's call it pMyParameterQuery). Open the Advanced Editor and replace everything with the following.
let
Source = Excel.CurrentWorkbook(){[Name="pMyParameter"]}[Content]{0}[Column1]
in
Source
You'll see in the query list that this query does not return a table but text (or a number / date / ... depending on the contents of your named cell).
Now switch to your web query and open its Advanced Editor. Find the line that has the URL, probably something like this:
Source = Web.Page(Web.Contents("http://www.example.com?someParameter=someValue")),
Here you can use the result of the parameter-query in the URL like this:
Source = Web.Page(Web.Contents("http://www.example.com?someParameter=" & pMyParameterQuery)),

How to display returned data json to grid in firemonkey?

I have received data from json web service with RESTRequest component
but I do not know how I should display the returned data in a grid?
How can I use RESTResponseDataSetAdapter to improve this?
Try this - it took me about 15 minutes to get working
Open the RESTDemos in your Delphi install's Samples\Object Pascal\Database\RESTDemo
Drop a TStringGrid on the RHS of the the Delphi-Praxis tab (I chose this one because
the URI on the Fetch to DataSet produces a 404 error).
If necessary, make the non-visual controls on the form visible.
Dbl-click BindingList and use the QuickBindings to add a LinkGridToDataSource. Set its
DataSource to ClientDataSet and its GridControl to StringGrid1. Thus will cause DBSourceDB1 to be created'.
Set the Response property of RestReponseDataSetAdaptor to `RESTResponse'.
Compile, run and click the fetch list of forums button. You should see the StringGrid populates
from the contents of memo_ResponseData
That should show you that LiveBindings can work with a RESTReponse to populate a grid. The RESTDemos demo has a lot more things in it, but if this is your first experience of LiveBindings, you might want to backtrack and try setting up a simple test project which populates a TStringGrid and a few TEdits from a dataset of your own.

Can't save the data using wbragancia widget yii2 for more than one dynamic form in single view

I am new in yii2 and i am using wbraganca/yii2-dynamicform widget in my view. My question is that I have to use more than two dynamic form in a single view. For single dynamic widget it works fine while saving from controller but others are saving just the last data of dynamic widget, while inspecting the post data in network array index for others except first dynamic form are not increasing (there index is only zero). Would you please suggest how should I have to do. How can I use multiple dynamic-form widget in single view. Thank you in advance.
I believe the problem must be in your view. You should ensure that each control has a unique name and then loop through the post variables in the controller.
<?= $form->field($modelx, "[{$i}]MyVariableName", ['labelOptions' => ['label' => false]])->textInput(['name' =>'myClassNameHere'."{$block}[$i][MyVariableName]"]) ?>
See the 'name' option in the code above. It gives a unique name to each field. Here the $block variable is a unique code I append to each widgetItem class in the DynamicFormWidget.
If I now look at my POST data, I see something like the following:
myClassNameHere0[0][MyVariableName]:1
myClassNameHere1[0][MyVariableName]:11
If this does not help - post a simply example that you cannot get working and I will have a look at it.

Make grails pagination

My controller returns results in a Array like this:
render (template: 'show' , model: [changes: changes])
Show is a default action and changes is an Array created with a query(createCriteria).
How can I make pagination in my index.gsp page which is displaying results in a HTMl div?
My problem:
Controller:
def list() {
[terminHistorie: changes, terminHistorieCount: changes.size()]
}
gsp:
<g:paginate controller="terminHistorie" action="list" total="${terminHistorieCount}"/>
Error: Tag [paginate] is missing required attribute [total] at C:/Users/matejb/Documents/NetBeansProjects/gutmann/grails-app/views/terminHistorie/index.gsp:309
The way pagination works is you first need to create a view using paginate tag, then on your show action you need to slice your changes. Meaning that the view will send the offset and max parameter and your createCriteria will query the database only for those data. Take a look at this page and then here to see how you can pass max and offset into your createCriteria method.
To see an example, see this page or create a new application with one simple domain and generate scaffolding for it. Grails will generate a paginated result for you.
Btw, if you are using ajax you might want to use remote paginate plugin.

Typo3: How to read from database to produce UL for view

OK, in good old fashioned PHP MVC, I might use a model to hit the DB, send info to my PHP controller that I pass on to the View. In the View, I might take that info (say i ajax'ed my controller for the info) and create a table or ul to display the data returned.
I've had trouble finding any modern (ver 6.1 is what i'm on) tutorial to show me how to preform this action in typo3.
Can anyone just "steer" me in the right direction? Perhaps provide an example via answer, or some links to further information that may compare it down to "old fashioned MVC"?
Extension has been suggested, but I'd like to know the very base process of what I'm asking before I try writing some extension, unless the extension is the only way. Although, my table is now on the SAME DB my typo3 is on, so shouldn't there be some command to just simply call my table and get the rows? Maybe send them to a ###sub-part###?
You can use a typoscript cObj content and the select option together with the function render_obj when your table name is like the typo3 nameing convention. The select pulls the record from the table and pass it to the render_obj function. It's a function that can apply to all cObj and iterate over the entire selection. stdWrap works only on the entire cObj. When you need to work through each record you need the render_obj function. For example:
10 = CONTENT
10 {
select {
pidInList = 1
where = colpos=1
orderBy = sorting
}
table = tt_content
renderObj.stdWrap.wrap = <li>|</li>
renderObj.stdWrap.required = 1
}
10.stdWrap.wrap = <ul>|</ul>
This gives you an unorderd list from the tt_content table with pid=1 and the content from the far left column.