Create new custom tag from netui select tag - taglib

For example, I have this code:
enter code here
<netui:select id="smt" dataSource="smt" >
<netui:selectOption value="1" title="one">red</netui:selectOption>
<netui:selectOption value="2" title="two">green</netui:selectOption>
<netui:selectOption value="3" title="three">blue</netui:selectOption>
</netui:select>
<div>This is my new custom tag</div>
How can I turn all this code above into one custom tag?

Related

Angular 2 select editable

I have a simple select like this:
<select [style]="{width : '100%' }" [(ngModel)]="rule.valoreImmesso" class="lm-custom-dropdown">
<option *ngFor="let valore of rule.comboValues" [value]="valore.value">{{valore.label}}</option>
</select>
I want to add an input text inside the dropdown in order to filter the options. Is it possible? How to do it?
You can do like this
<input type="text" list="cars" [(ngModel)]="rule.valoreImmesso"/>
<datalist id="cars">
<option *ngFor="let valore of rule.comboValues" [value]="valore.value"></option>
</datalist>
But datalist tag not supported in Safari So you must write a custom dropdown on your own. You can find some in the internet and modify them as you desired.

grails: select like numeric up down

I've searched around the net but I have not found a solution.
Is there something like numeric up down, for numeric selection in Grails?
How can I create it?
You can achieve your requirement via simple html as:
<input type="number" name="quantity">
you can set range also as:
<input type="number" name="quantity" min="1" max="5">
and If you want you can add value attribute to be shown as:
<input type="number" name="quantity" min="1" max="5" value="${domainInstace.attribute}">
and Enjoy.......
Within a gsp ?
<g:select id="orderby" name="orderby" from="${1..10}" noSelection="['':'-Define Display Order 1 top 10 bottom-']" required="" value="${youdomainClassInstance?.orderby}" class="many-to-one"/>

Grails and form input multiple

I didn't find the part about this in the documentation, so I will be very happy if someone can help me =)
I have this form on my page to upload multiple pictures, using multiple for my input:
<g:uploadForm controller="photo" action="add" autocomplete="off">
<label for="files">Files to upload:</label>
<input type="file" id="files" name="files" multiple="multiple" />
<input type="hidden" id="MAX_FILE_SIZE" name="MAX_FILE_SIZE" value="300000" />
<g:submitButton name="add" class="save button medium" value="ADD" />
</g:uploadForm>
And now, I don't know how to "separate" files in my controller.
It is ok for one file, using request.getFile(..), but how can I handle the "multiple" property of my field ?
Thanks for reading,
Alexandre
You can do this within your controller:
List fileList = request.getFiles('files') // 'files' is the name of the input
fileList.each { file ->
println 'filename: ' + file.getOriginalFilename()
}
request.getFiles(<param>) returns a list of CommonsMultipartFile objects. You can use these objects to get the file names (like in the example) or the file content (file.getInputStream())
You got the answer, but this just for a record
request.multiFileMap?.each { name, map ->
//do the logic
}

How to init data when use jquery ui?

I have one checkbox use jQuery UI
<input type="checkbox" id="checkbox_1" name="checkbox_1" value="1" />
<label for="checkbox_1" class="checked">checkbox_1</label>
<script>
$(function){
$("input:checkbox").button();
};
</script>
And I query the data from database,the checkbox should be checked.
But it doesn't works when I added the attribute of "checked" in checkbox like normal usage.
How to achieve it?
add in html
<input type="checkbox"checked="checked"id="checkbox_1" name="checkbox_1" value="1" />

List Box Multiple Selected values

how to pass multiple selected list box values which are in a session in one ascx page to another ascx page
Code is
NameObjectCollection eeSearchString=new NameObjectCollection();
for(i = 0;i <= LbStatus.Items.Count - 1){
if LbStatus.Items(i).Selected {
eeSearchString.Add(new NameObjectPair("status", LbStatus.SelectedItem(i).Text));
}
}
And in another page can i access the status like this?
_status=Convert.ToString(eeSearchString.ItemValue("status"));
Pls let me know?? or do i need to use loop again???
I don't know about aspx but in HTMl you can declare an array for some elements.
For example:
Group XPTO
In the server, in my case, in PHP I only receive the Value of the ones that are selected inside the array.
Image you have this:
<input type="checkbox" name="group[]" value="1" /> Group 1 <br />
<input type="checkbox" name="group[]" value="2" /> Group 2 <br />
<input type="checkbox" name="group[]" value="3" /> Group 3 <br />
Imagine you've selected the Group 1 and 3. In the server you'll receive the array with the values of the group1 and 3.
group(1, 3);
Hope this helps with you're question =)
Regards,
Elkas
make use of session variable or make use of properties of the control, i.e create property and assign value.

Resources