pub struct Tabs<C = Schema> { /* private fields */ }Expand description
A block showing one Tab at a time, each holding a form’s fields
(Tab::schema) or a detail page’s columns (Tab::columns).
use tablo_core::{Field, Schema, Tab, Tabs};
let user = User::fields();
Schema::new(Tabs::new([
Tab::new("Account").schema((Field::text(user.name()), Field::text(user.email()))),
Tab::new("About").schema(Field::text(user.bio()).multiline(4)),
]));Every tab’s fields render and post: an inactive tab’s are only hidden, so a submission carries them as if no tab held them, and the browser’s own checks still refuse what they refuse. The page opens on the first tab holding a field error, else on the first tab; the browser opens the tab of a control it refuses on submit. A tab whose every field or column the request may not see renders no trigger, and a block with no such tab renders nothing.
Implementations§
Source§impl<F> Tabs<Schema<F>>
impl<F> Tabs<Schema<F>>
Sourcepub fn visible_when(
self,
watched: &impl Watched<F>,
values: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn visible_when( self, watched: &impl Watched<F>, values: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Shows the block and every field it holds only while watched posts one of
values, as TextField::visible_when shows a
field.
Trait Implementations§
Source§impl<M> IntoDetail<M> for Tabs<Detail<M>>
impl<M> IntoDetail<M> for Tabs<Detail<M>>
fn into_detail(self) -> Detail<M>
Source§impl<F> IntoSchema<F> for Tabs<Schema<F>>
impl<F> IntoSchema<F> for Tabs<Schema<F>>
fn into_schema(self) -> Schema<F>
Auto Trait Implementations§
impl<C> Forget for Tabs<C>
impl<C> Freeze for Tabs<C>where
C: Freeze,
impl<C> Move for Tabs<C>
impl<C> RefUnwindSafe for Tabs<C>where
C: RefUnwindSafe,
impl<C> Send for Tabs<C>where
C: Send,
impl<C> Sync for Tabs<C>where
C: Sync,
impl<C> Unpin for Tabs<C>where
C: Unpin,
impl<C> UnsafeUnpin for Tabs<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for Tabs<C>where
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more