Is there any restriction for v-model in vue? - vuejs3

I am getting syntax error for the following code snippet.
<Dropdown v-model="function.moduleId" :options="modules" optionValue="moduleId"
:filter="true" optionLabel="moduleName" required="true">
</Dropdown>
Problem is with v-model="function.moduleId" this. It seems to me I can't use 'function' word for v-model name. But for a good naming convention I have to use this. Any idea?

Related

ElementUI + Vue3. Why doesn't v-model work on a form with checkboxes? How to correct?

On this page in the documentation, I found how to display a table with checkboxes:
https://element-plus.org/en-US/component/table.htm...
I want the rows with checked checkboxes to be stored in a specific array variable (resourcesSelected).
I added v-model="resourcesSelected" directive to el-table. But the code doesn't work. It's like v-model doesn't exist at all. I tried adding v-model for el-table-column. Same.
<el-table
:data="resources"
v-model="resourcesSelected"
>
<!-- Чекбокс -->
<el-table-column type="selection" width="55" v-model="resourcesSelected">
</el-table-column>
<!-- Id -->
<el-table-column label="id">
<template #default="scope">
<a :href="'/update&id=' + scope.row.id" target="_blank">{{scope.row.id}}</a>
</template>
</el-table-column>
</el-table>
If you manually hang handlers:
<el-table #select-all="itemHandleSelectionAll" #select="itemHandleSelectionChange" #selection-change="selectionChangeHandler" ...
Then it works (functions are called. And in them I can fill in the resourcesSelected array).
Questions.
Why doesn't v-model work?
How to fix it?
If this cannot be fixed in any way, because v-model is not supported for a table in ElementUI, how do I know which elements are not yet supported by v-model? To understand when I made a mistake, and when it should not work?

ArgsTable storybook 6 MDX

I am trying to insert ArgsTable inside an MDX file but it does not show the table.
The components are developed with Litelement.
Have you also encountered the same problem?
<ArgsTable story="name-story" />
I think if you want to use the ArgdTable in MDX, you need to do this:
<Story name="Foo Bar"> ... </Story>
<ArgsTable story="Foo Bar" />
What is the name on your Story?

Spring MVC: Does <Form:Label> really solves any additional purpose or is it okay to use HTML label tag?

Does Form:Label class and path solves any purpose?
<form:label class="boldText" path="comments.commentOnChild">
<spring:message code="label.commentOnChild" />
</form:label>
What if we write statement simply in -label- tag? What additional benefits does form:label provides over HTML Label? What if i do not use Form:Label at all?
As we know that <form:label /> tag is associated to spring so it will have access to the model and binding results also and it can use another css class in case of any error.
<form:label cssClass="title" cssErrorClass="title error" path="student" />
In case of error this code will render differently than the normal label.You could also do this with normal tag but for that you need to include some logic into your pages, which will be extra you will be doing.
The <form:label /> tag has access to the underlying model and binding results through path variable and as such can, on error, use another style class.
The <spring:message /> tag provides you with internationalization support using Spring's MessageSource concept. The MessageSource is an interface providing functionality for retrieving messages. It closely resembles JSTL's fmt:message-tag, however, the MessageSource classes can be integrated with the Spring context. Also, the <spring:message /> tag, works with the locale support that comes with Spring.
Also you can do this without the form tag but that would mean you need to include some logic into your pages but it isn't advisable.

How to deal with "The ID '...' is already used by another control when conditionally removing controls?

I have a custom control that currently conditionally renders content:
<me:CustomControl>
<switch>
<if "expression is true">
<textbox id="Name" />
</if>
<if "expression is true">
...
</if>
<else>
<textbox id="Name" />
</else>
</switch>
</me:CustomControl>
My example above makes no logical sense, but gets straight to the point. The <if> tag is evaluated by overriding the GetChildControlType function. The <textbox> inside is evaluated in the <if>'s control builder.
What I want to do is completely remove the control from the collection, or even better yet, prevent child controls of <if> from being added to the collection to begin with. If I try to remove them OnInit, I still get the error "The ID 'Name' is already used by another control."
I can't evaluate them in the:
Public Overrides Function GetChildControlType(ByVal tagName... ) As Type
Because I need to perform logic on all the if's and else's within it.
Maybe there's a better way?
Update
I get a compilation error even if I break this thing down to bare bones if there are more than one controls with the same ID, even though overriding CreateChildControls. not sure if I can get around this at all.

Custom ASP binding mechanism problem

know ASP since about 6 months, and I've go hard problem. I've created my own DataBinding mechanism and I need some solution to do somthing like this:
I have this example code in my ASPX
<myButton id="someID" runat="server" Text="SomeText" BackColor="{SomeContext}" />
and I have in this control my property Context of type Object. I want to bind property which is inside Context to BackColor property. Name of the property from Context is SomeContext (in brackets). All I need is to use some TypeConverter or other technology to identify that there is a name inside {} and remember that name inside instance of myButton control. Any ideas???
I thought that I can use my own class inherited from TypeConverter and catch the moment of converting value {SomeContext} to Color (the BackColor property). I can catch this moment, but I have no info about target control, only empty context of String value. If anyone know how to get target property somehow, will be very!! helpful.
I've been searching web, and nothing...
You can set this in your code behind directly:
someID.BackColor = context.Color;
Ya might give ASP.NET Custom Expression builders a try.
I won't use codebehind in my project. Website will be rendered from compiled customized aspx from database. I have special approach for my system, and my binding is a main part of it. Regular databinding expression won't help because it use ASP binding, which I don't want to use.
Unfortunately I didn't find any solution of my problem, so I decided to use inner properties. I'll use ASPX code like this:
<myButton runat="server" ID="someID">
<Binding>
<Bind Target="BackColor" Source="ColorOfBackgroundFromContext" />
<Bind Target="ForColor" Source="ColorOfForegroundFromContext" />
</Binding>
</myButton>

Resources