Editing: the search works in a very simple way, the search for any text is entered into all fields of the String element of the corresponding model without special search operators.
If there is a way to tweak the search, I would like to know. Right now, it looks like I just need to ignore the built-in search materials and collapse my own.
With the addition of the field, noteshe began to return nothing, not all. The only thing that has worked so far is to enter a “test” in the search field, which returns a record with the “test” in the comments field. The search for "notes: test" or "notes = test" does not work, nor does it try to find the agentor fields status. I tried things like "1400", the value of which I checked, is present in the agent field via phpMyAdmin, and things like "0" or "VALID" for the status field, which is all the entries.
model fields:
public class AgentShift extends Model {
public enum Status { VALID, RESCHEDULED, EXTENDED, DELETED }
@Required @Min(1000) @Max(99999)
public int agent;
public Status status = Status.VALID;
@Required
@Columns(columns={@Column(name="start_time"),@Column(name="end_time")})
@Type(type="org.joda.time.contrib.hibernate.PersistentInterval")
public Interval scheduled;
@Type(type="org.joda.time.contrib.hibernate.PersistentLocalTimeAsTime")
public LocalTime agent_in;
@Type(type="org.joda.time.contrib.hibernate.PersistentLocalTimeAsTime")
public LocalTime agent_out;
public String notes;
}
modified crud list page:
#{extends 'main.html' /}
#{set title: 'Agent Shifts' /}
<div id="crudList" class="${type.name}">
<h2 id="crudListTitle">&{'crud.list.title', type.name}</h2>
<div id="crudListSearch">
#{crud.search /}
</div>
<div id="crudListTable">
#{crud.table fields:['id','agent','scheduled','status','notes'] }
#{crud.custom 'scheduled'}
#{if object.scheduled.getStart().toDateMidnight().equals(object.scheduled.getEnd().toDateMidnight())}
${org.joda.time.format.DateTimeFormat.forStyle("SS").printTo(out, object.scheduled.getStart())} to
${org.joda.time.format.DateTimeFormat.forStyle("-S").printTo(out, object.scheduled.getEnd())}
#{/if}
#{else}
${org.joda.time.format.DateTimeFormat.forStyle("SS").printTo(out, object.scheduled.getStart())} to
${org.joda.time.format.DateTimeFormat.forStyle("SS").printTo(out, object.scheduled.getEnd())}
#{/else}
#{/crud.custom}
*{
#{crud.custom 'entered_by'}
#{if object.entered_by}
${object.entered_by}
#{/if}
#{else} ?
#{/else}
#{/crud.custom}
#{crud.custom 'created'}
${org.joda.time.format.DateTimeFormat.forStyle("SS").printTo(out, object.created)}
#{/crud.custom}
}*
#{/crud.table}
</div>
<div id="crudListPagination">
#{crud.pagination /}
</div>
<p id="crudListAdd">
<a href="@{blank()}">&{'crud.add', type.modelName}</a>
</p>
</div>